开发者

Bing Maps vs Google Maps -> markers are in different places

I've made 2 maps, one with Bing Maps and one with Google Maps. They both pull from the same data file to put a bunch of pins on the map. However the pins on the Bing map look like they are offset too far north开发者_如何转开发 and so not in the right place.

see

http://upstairsweb.com/examples/bingmap.html

vs

http://upstairsweb.com/examples/googlemap.html


The problem is with the icon you're using - the PNG file at http://upstairsweb.com/examples/SmallRedMapPin.png itself is 16px x 18px is size, but the visible part of the pushpin is only drawn in the top left hand corner of the image. Bing Maps by default anchors a pushpin icon at the bottom centre of the map image, but because of the lop-sided transparent area that will make the icon appear to be too far up and to the left. I don't know how Google Maps anchors an icon when you haven't specified an explicit anchor point - perhaps it just hard codes an anchor that, by chance, happens to line up with your points.

Either way, I'd suggest you first trim your image to get rid of the extraneous transparent area around the outside and/or explicitly set the anchor point in the PushpinOptions at which the icon should be placed relative to the point it describes: http://msdn.microsoft.com/en-us/library/gg427629.aspx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜