admin管理员组

文章数量:1427333

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

本文标签: javascriptHow to add markers to ArcGIS map with XY coordinatesStack Overflow