amarny,
PictureMarkerSymbol has a xoffset and yoffset attribute just set them.
Tried it without success before posting . Any idea on how much x and y offsets should be with push-pin of 35x35.
// PictureMarker - embedded image [Embed('asset/i_pushpin.png')] var picEmbeddedClass:Class; var pictureMarker:PictureMarkerSymbol = new PictureMarkerSymbol(picEmbeddedClass,30,30,-15,15); var myGraphicPic:Graphic = new Graphic(event.mapPoint); myGraphicPic.symbol = pictureMarker;
Try the below code snippet.// PictureMarker - embedded image [Embed('asset/i_pushpin.png')] var picEmbeddedClass:Class; var pictureMarker:PictureMarkerSymbol = new PictureMarkerSymbol(picEmbeddedClass,30,30,-15,15); var myGraphicPic:Graphic = new Graphic(event.mapPoint); myGraphicPic.symbol = pictureMarker;
I am using i_pushpin.png image. I am resizing image to 30x30 and adding offset of -15, 15.
Constructor new PictureMarkerSymbol(picEmbeddedClass,30,30,-15,15); is not available in Flex 3.
What version of the ArcGIS Flex api are you using? You can find this out in the name of api swc or right click on your application and select menu 'About ArcGIS API for Flex...'
Currently the project is using agslib-1.1-2009-01-21.swc
I also noticed that I have agslib-1.2-2009-05-15.swc too but is not being used.
Thanks,
Amar