最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to add markers to ArcGIS map with XY coordinates - Stack Overflow

programmeradmin0浏览0评论

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 ing back to the application, I don't know how to add markers with coordinates.

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.

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.

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 ing back to the application, I don't know how to add markers with coordinates.

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.

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.

Share Improve this question edited Mar 6, 2011 at 16:39 stakx - no longer contributing 85k20 gold badges176 silver badges277 bronze badges asked Jan 28, 2011 at 16:47 VaniVani 1,3534 gold badges27 silver badges49 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 3

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

Hope this helps Cheers Al

发布评论

评论列表(0)

  1. 暂无评论