You are here: > ESRI Forums > arcgis explorer discussion forums > Thread Replies

ArcGIS Explorer Discussion Forums

ArcGIS Explorer: SDK Developers forum

Placement of Marker Graphic   Clay Harter Dec 02, 2009
Re: Placement of Marker Graphic   David Piesse Dec 04, 2009
Re: Placement of Marker Graphic   Clay Harter Dec 04, 2009
Re: Placement of Marker Graphic   Brian Kowalski Dec 10, 2009
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Placement of Marker Graphic 
Author Clay Harter 
Date Dec 02, 2009 
Message It appears that a marker graphic is not centered about it's point location but is always displayed above its location. So if a graphic has this outline:
---------
|---------|
|---------|
|---------|
----X----

It would always be positioned at the "x". Is there any way of specifying that a graphic should be positioned at it's center. The current behavior is only appropriate for a "push-pin" and not any symmetric graphic (e.g. a circle, a square, a well symbol, etc...)

Thanks,

Clay Harter
OpenSpirit Corp. 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Placement of Marker Graphic 
Author David Piesse 
Date Dec 04, 2009 
Message This is correct!
The best way to reposition a graphic over the location is to take 50% of the height (in map units) from the y value of the Graphics location.

Here's some code I have used to combat this. This doesnt compensate for map rotation however! For this you would need to do some trig using the current rotation and both the window height and width.

 
 
double mapUnitHeight = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay.Extent.Height;
double mapPixHeight = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay.Size.Height;
double units2pixel = mapUnitHeight / mapPixHeight;
double GraphicSize = Your_Graphic_Object.Height / 2;
double offset = GraphicSize * units2pixel;
//You then take 'offset' from your current y value to shift the graphic down
 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Placement of Marker Graphic 
Author Clay Harter 
Date Dec 04, 2009 
Message Yes, I thought of doing this but then this means having to recompute the location of all displayed points every time a window resize or map zoom occurred.

A better solution would be if a Graphic object had a x and y offset (in pixels) for the Marker symbol...

Thanks,

Clay 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Placement of Marker Graphic 
Author Brian Kowalski 
Date Dec 10, 2009 
Message Ditto. The current behavior is very annoying.


 
  Brian
USCG Enterprise GIS Team