ymikhel


How do I change pushpin's anchor
For example, if my pushpin's custom icon looks like upside-down triange,
I would like to locate it on the map so it's bottom edge will fit the coordinates.
I have tried ImageOffset property of VECustomIconSpecification class, but didn't see any effect.
What am I missing




Re: Pushpin anchor?

Craig731


In your VECustomIconSpecification object, try setting

Code Block

CISobject.TextContent = ' ';



This should allow the offset to be applied.

Not sure if this is still required in v6, will check on that later.

Craig





Re: Pushpin anchor?

ymikhel

I have tried to set TextContent property as you suggested, but it didn't help.
I still see the icon anchored according to the image center, and not the middle
of the bottom edge, as I need.






Re: Pushpin anchor?

Craig731

This is what I have working on my side. On my first attempt i wasn't setting the Offset as a VEPixel which did not throw any errors, but didn't work either. See if any larger pixel settings change the images location visibly at all.


Code Block

var CI90 = new VECustomIconSpecification();
CI90.ImageOffset = new VEPixel(6,5);
CI90.Image = 'images/greencross.gif';
CI90.TextContent = ' ';


expShape = new VEShape(VEShapeType.Pushpin, expPoint);
expShape.SetCustomIcon(CI90);

expLayer.AddShape(expShape);





Re: Pushpin anchor?

ymikhel

Well, I think I found what is the problem - Firefox.
It works on IE (6/7), but not on Firefox.