使用ArcGis Api显示InfoWindo

问题描述 投票:0回答:1

大家好,我实际上使用ArcGsi JavaScript API处理地理应用程序,我正在寻找在用户点击搜索栏中的建议菜单时运行的方法,以显示特定功能InfoWindow

javascript api arcgis esri
1个回答
0
投票

有几种方法。第一个鼠标拖动选项;

  var services = new FeatureLayer("http://blablabla/MapServer/0", {
        // mode: FeatureLayer.MODE_SNAPSHOT,
        // infoTemplate: popupTemplate,
        outFields: ["NAME", "ID", "VALUE"]
    });
    services.on("mouse-over", function (evt) {

        var t = "<div class='title'><b>${NAME}</b></div><p>${ID}<br>${VALUE}<br>${VALUE}<br><strong>value: </strong>${VALUE}</p>";

        var content = esriLang.substitute(evt.graphic.attributes, t);
        //var highlightGraphic = new Graphic(evt.graphic.geometry, highlightSymbol);
        //map.graphics.add(highlightGraphic);

        dialog.setContent(content);

        domStyle.set(dialog.domNode, "opacity", 1);
        dijitPopup.open({
            popup: dialog,
            x: evt.pageX,
            y: evt.pageY
        });
    });
    services.on("mouse-out", function (evt) {

        closeDialog();
    });

或者第二个离开。点击图示;

  var services = new FeatureLayer("http://blablabla/MapServer/0", {
       mode: FeatureLayer.MODE_SNAPSHOT,
        // infoTemplate: popupTemplate,
        outFields: ["NAME", "ID", "VALUE"]
    });

    services.on("click", function (evt) {

        var name = evt.graphic.attributes.NAME;
        var value = evt.graphic.attributes.VALUE;

        // your custom html
        $("#SevicesContainer").collapse("show");
        $("#SevicesContainer").draggable({ containment: "map", scroll: false });
        $("#SevicesContainer .close").click(function () {
            $("#SevicesContainer").collapse("hide");
        });

    });
© www.soinside.com 2019 - 2024. All rights reserved.