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

How do I add markers to a map with coordinates? I saved the extent in database along with X,Y coordinat

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

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745494009a4630113.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信