Select to view content in your preferred language

Displaying marker on ArcGIS map

1660
4
05-16-2014 04:45 AM
SamarthGupta
Deactivated User
Hi everyone,

I am building a flex desktop application for displaying some co-ordinates using ArcGIS Maps. As, i am new to ArcGIS map's, i have been going through API reference, and other things to be friendly.
When i was going through map point to display marker's on map, i wasn't able to find out in which format did map point takes the co-ordinates of the location to display marker.

I have a list of co-ordinates where i wish to show multiple markers i have northings, eastings, latitude, longitude (555388.31, 3455103.45, 31.22878668, 75.581577) respectively which correspond to location some where near "Jalandhar, Punjab, India"

Can, some knows about the format of map point?
Tags (2)
0 Kudos
4 Replies
KomanDiabate
Deactivated User
I think all you need is X and Y coordinates to create mappoints.

Assuming you have you data in an arrayCollection or a tempArray you can add XY data to the map in the following fashion:

for(var i:int=0;i<tempArray.length;i++)
{
 var obj:Object=tempArray.getItemAt(i);     
 var myGraphicPoint:Graphic = new Graphic(new MapPoint(obj.X , obj.Y, new SpatialReference(3857)));
 myGraphicPoint.symbol = pointSymbol;
 myGraphicsLayer.add(myGraphicPoint);
}
0 Kudos
SamarthGupta
Deactivated User
I have tried as you suggested, and got i my markers as well. Thanks

But, the problem is that when i placed the latitudes value in x and longitudes value in y markers were scattered all over the map as if positions weren't recognized, i even tried placing my earthing value in x and northing value in y but i got the same result.

I have used this code:

protected function getLocation_resultHandler(event:ResultEvent):void
{
 if(event.result.information.rmk != "error")
 {
  filterXML = event.result as XML;
     
  var data:Array = new Array();
  for each(table1 in filterXML.information)
  {
  }
  var myGraphicPoint:Graphic = new Graphic(new MapPoint(table1.lng , table1.lat, new SpatialReference(3857)));
  myGraphicPoint.symbol = pictureMarker;
  myGraphicsLayer.add(myGraphicPoint);
 }
}


This code gets me last latitude and longitude which are in table1 as i have already written those correspond to location some where in Punjab, but in AcrGIS map marker is placed some where near Africa
0 Kudos
KomanDiabate
Deactivated User
This is more than likely a spatial reference issue. Make sure you are using the right Spatial reference . Also make sure X is long and Y is lat.

var myGraphicPoint:Graphic = new Graphic(new MapPoint(table1.lng , table1.lat, new SpatialReference(3857)));
0 Kudos
SamarthGupta
Deactivated User
How to decide which spatial reference should i use? Any, reference...
0 Kudos