Select to view content in your preferred language

Get position of markers

1123
6
Jump to solution
06-04-2014 10:57 PM
SamarthGupta
Deactivated User
Hi everyone,

How can i get the position of the markers if the markers are overlapped at certain zoom level. If they are overlapped then i want to show the number of overlapped maker on the marker point or the picture marker.
Is this possible?
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
AnthonyGiles
Honored Contributor
Sam,

You can add a cluster to a graphics layer pretty easy. Have a look at the attached mxml file

Regards

Anthony

View solution in original post

0 Kudos
6 Replies
SamarthGupta
Deactivated User
Hi Anthony,

I am getting my data from database, and i am getting data in this format and placing them on map like this.

protected function getLocation1_resultHandler(event:ResultEvent):void
{
 if(event.result.information.rmk != "error")
 {
  filterXML = event.result as XML;     
  var testPoint:MapPoint;
  var projParams:ProjectParameters = new ProjectParameters();
  for each(table2 in filterXML.information)
  {
   testPoint = new MapPoint(table2.ax, table2.ay);      
   var ptGraphic:Graphic = new Graphic(null, new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 5, 0x0000FF));
   ptGraphic.geometry = testPoint;
   ptGraphic.addEventListener(MouseEvent.CLICK, onClick);
   myGraphicsLayer.add(ptGraphic);      
  }
 }
}


These all mapPoints are in INDIA. How will i use cluster with this code?
0 Kudos
SamarthGupta
Deactivated User
Hi Anthony,

I have seen some of the examples of using clusters, they are being placed when a feature layer is called.

For example:
<esri:FeatureLayer id="featureLayer"
                           clusterer="{clusterer}"
                           definitionExpression="POP1990 &gt; 75000"
                           mode="snapshot"
                           outFields="*"
                           symbol="{defaultsym}"
                           url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/0">


The URL in this feature layer points to "ESRI_StatesCitiesRivers_USA/MapServer/0". But, i could not find any URL for feature layer which could point out INDIA.
0 Kudos
AnthonyGiles
Honored Contributor
Sam,

You can add a cluster to a graphics layer pretty easy. Have a look at the attached mxml file

Regards

Anthony
0 Kudos
SamarthGupta
Deactivated User
Thanks Anthony,

This has helped in no time.
0 Kudos
AnthonyGiles
Honored Contributor
Sam,

Glad I could help, if your question has been answered could you also please check the tick on the post that helped, to mark the question as answered,

Regards

Anthony
0 Kudos