none
Pin Latitude Longitud off RRS feed

  • Question

  • With api v7 there is a problem with the pushpin position and the zoom level.

    My Zoom level is the entire country (USA), I placed pins over Dallas but they show in Oklahoma. If I zoom in to the city level, they show correct. Pushpins in Puerto Rico render in the ocean unless you zoom in.

    I have the same long/lat pushpin collection using the previous API v6 and the pins land exactly where they suppose to.

    Is there a problem with pin position and Zoom? I am not sure, but believe this problem wasn't there a few months ago.

     

    • Moved by Ricky_Brundritt Saturday, March 10, 2012 11:42 AM (From:Bing Maps: Map Control and Web services Development)
    Thursday, October 27, 2011 2:12 PM

Answers

  • I syspect the issue is that you need to offset your pushpins as they are likely anchored to the top left corner of the pushpin image rather than to the pushpin point. Check out the anchor property of the pushpin options class.
    http://rbrundritt.wordpress.com
    • Marked as answer by Uri Kluk Tuesday, November 1, 2011 5:23 PM
    Thursday, October 27, 2011 10:40 PM

All replies

  • I syspect the issue is that you need to offset your pushpins as they are likely anchored to the top left corner of the pushpin image rather than to the pushpin point. Check out the anchor property of the pushpin options class.
    http://rbrundritt.wordpress.com
    • Marked as answer by Uri Kluk Tuesday, November 1, 2011 5:23 PM
    Thursday, October 27, 2011 10:40 PM
  • Could you repro it on http://www.bingmapsportal.com/ISDK/AjaxV7#Pushpins4?

    The pin is placed over Seattle & stays over it while zooming in/out. Is this browser specific?


    MSFT
    Hemant Goyal
    Sunday, October 30, 2011 12:52 AM
  • Thx, setting the size of the pin and then anchor did the trick. Note that the anchor needs to be in the center, or still offset:

     

    // Add a pin to the map
                        var pin = new Microsoft.Maps.Pushpin(latlong,
                        {
                            icon: $.format('Images/sphere_{0}_24.png', led_color),
                            height:24, 
                            width:24,                        
                            anchor:new Microsoft.Maps.Point(12,12)
                        });
    

    Tuesday, November 1, 2011 5:26 PM