Select to view content in your preferred language

Identify and graphic PushPin

1286
6
12-07-2010 04:38 AM
JayKappy
Frequent Contributor
In my app (taken from an esri example) I am doing an identify, on user click in the map its droping an image.  In my case an image of a Push Pin.

BUT, The image is not appearing where I click on the map.  I have attached a word doc showing where I am clicking and where the image is appearing....
As I zoom out the image appears to be keepign the same distance on the screen...In this I mean if i zoom in and the image is placed its say 50 miles....when I zoom way out and the image is placed its a thousand miles off

Any Ideas why the image is not appearing right where the user clicks the map?

THanks

        Dim graphicsLayer As GraphicsLayer = TryCast(MyMap.Layers("MyLayer"), GraphicsLayer)
        graphicsLayer.ClearGraphics()
        Dim graphic As New ESRI.ArcGIS.Client.Graphic() With {.Geometry = clickPoint, .Symbol = PushPinPictureSymbol}
        graphicsLayer.Graphics.Add(graphic)
0 Kudos
6 Replies
DominiqueBroux
Esri Frequent Contributor
At first glance I would say that it's a margin or offset issue in your symbol.
How is defined your PushPinMarkerSymbol?
0 Kudos
JayKappy
Frequent Contributor
Dang...I cant believe I missed that....BUT....

I set the offsets to 0 and the Push Pin now displays near the point of click.  My normal cursur is an arrow...I look at the arrow and think that the tip of the arrow is where I am pointing......but when I click it seems to be recording the XY more towards the middle of the icon....is this correct?  Maybe what I need to do is change the icon to a crosshair?

What I would like to happen is the user sees the arrow and points the tip on the object and then the pin part of the push pin locate where the user clicked...

OR do I have this wrong and the app is actually recording teh XY at the point of the mouse Icon Arrow?  And that I simply need to adjust the graphic to simulate that location....As Long as I know the tip of the arrow is where the XY is being recorded I have no problem....

Thoughts?

THanks
0 Kudos
DominiqueBroux
Esri Frequent Contributor
You have to set the OffsetX and OffsetY properties of the symbol with the distance in pixels between the top left of the image and the pin of your symbol.
Example coming from the interactive samples:
<esri:PictureMarkerSymbol x:Key="PinPictureMarkerSymbol" OffsetX="11" OffsetY="39" Source="/Assets/images/i_pushpin.png" />
0 Kudos
JayKappy
Frequent Contributor
I think I got that part...I guess my last question is...
Using the mouse icon Arrow....does this capture the XY location at the tip of the arrow?  I am a bit confused where XY is beign recorded based on the defualt Microsoft looking Arrow icon.

If it as the tip of the arrow then I can easly move the offsets of the Push Pin image.

Thank you for your help....very appreciated.
0 Kudos
JenniferNery
Esri Regular Contributor
If you are talking about Arrow Mouse Cursor, the position it reports is from the tip of the arrow.
0 Kudos
JayKappy
Frequent Contributor
Fantastic...thats what I needed to hear...I am adjusting the Offsets to make the Push Pin Image lay in the correct location....

Know this was a trivial issue but I do thank you for your time and patience.....

THanks dbroux  and Jenniferdnery
0 Kudos