Bing Maps: Adjusting AJAX Pushpin Anchors

In the original VEPushpin Class (now deprecated) the Bing Maps AJAX API allowed for relative specification of which part of a pin image was anchored to the lat/lon (bottomleft, topright, bottomcenter, etc). “The replacement APIs (VEShape) actually give you more freedom, but take a bit of understanding to get it right. And, default pushpins will […]

In the original VEPushpin Class (now deprecated) the Bing Maps AJAX API allowed for relative specification of which part of a pin image was anchored to the lat/lon (bottomleft, topright, bottomcenter, etc). “The replacement APIs (VEShape) actually give you more freedom, but take a bit of understanding to get it right. And, default pushpins will only allow you to anchor to a lat/lon (no fun). If you want to anchor a specific part of your pushpin image to a lat/lon there’re a couple ways to go about it. First, here’s how you would load a custom pushpin. I’m using a giant image, so the move is quite obvious. Notice the image is tied to the lat/lon using the image pixel 0,0 (upper, left). One small tech nugget: the default pushpin in the API is set to anchor to pixels –12.5, –12.5 so that a pushpin that’s 25 x 25 pixels would be pinned to the lat/lon in the center of the image,” said Chris.

Full Article: Adjusting AJAX Pushpin Anchors