如何使用XY坐标向ArcGIS地图添加标记

时间:2021-01-25 21:23:28

How do I add markers to a map with coordinates? I saved the extent in database along with X,Y coordinates after finding the location. When coming back to the application, I don't know how to add markers with coordinates.

如何使用坐标向地图添加标记?在找到位置后,我将数据库中的范围与X,Y坐标一起保存。回到应用程序时,我不知道如何添加带坐标的标记。

var s =  "XMin: " + ext.xmin + 
        " YMin: " + ext.ymin +
        " XMax: " + ext.xmax + 
        " YMax: " + ext.ymax;
document.getElementById('extent').value = s;  

function showCoordinates(evt) {
    //get mapPoint from event
    var mp = evt.mapPoint;
    //display mouse coordinatesLabel1
    dojo.byId("Label1").innerHTML = mp.x + ", " + mp.y;
}

Please help me with setExtent! Thanks.

请帮我setExtent!谢谢。

Updated:

更新:

I am using the ESRI map on the client side and I'm trying to refresh with asp:button; that's the reason why the map didn't get refreshed.

我在客户端使用ESRI地图,我正在尝试使用asp:button刷新;这就是为什么地图没有刷新的原因。

1 个解决方案

#1


2  

You can add marker using this example: http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm

您可以使用以下示例添加标记:http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm

Hope this helps Cheers Al

希望这有助于Cheers Al

#1


2  

You can add marker using this example: http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm

您可以使用以下示例添加标记:http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm

Hope this helps Cheers Al

希望这有助于Cheers Al