none
SVG pushpin position issue RRS feed

  • Question

  • Hi,

    We are plotting pushpin uisng SVG image. Pushpins are plotted correctly but some time same set of pushpins plotted on wrong position as shown in below screenshot but when we zoom in then we see the correct position but from top view we see wrong position and it happen randomly.

    Can you please let us know what is the cause of this issue and how to resolve it.

    Thanks!

     

    Balasaheb

    Thursday, June 15, 2017 2:08 PM

Answers

  • Ok, there is no issue, you are seeing an optical illusion. The sample in the SDK at all zoom levels has the SVG pushpins centered over their respective coordinates (anchored at center of pushpin). As you zoom the scale of the map changes, but not the pushpin as a static pixel sized element. As such the edges of the pushpin expand further out as you zoom out and covers more area. If the anchor point is incorrect with your pushpin, the pushpin can appear to drift away from the point where you want it to be binded to which appears to be the case with your original screenshots and is what I said originally was your issue. See this documentation that goes into details on this: https://msdn.microsoft.com/en-us/library/mt712695.aspx

    For your pushpin in your first screenshot, try using the following anchor pushpin option.

    anchor: new Microsoft.Maps.Point(17, 45)


    [Blog] [twitter] [LinkedIn]

    Wednesday, July 12, 2017 5:18 PM

All replies

  • Hi,

    Anyone have update on above issue.

    Thanks!


    Balasaheb

    Thursday, June 22, 2017 10:26 AM
  • Haven't seen anyone else report this issue. Does this occur only when zooming? If so then the issue is which the specified anchor property for the pushpin.

    [Blog] [twitter] [LinkedIn]

    Thursday, June 22, 2017 3:26 PM
  • Hi Ricky,

    We used anchor property but we still face same issue. We saw same issue on BingmapSDK when we plot the SVG pushpin it shows in sea as shown in below screenshot.


    But when we zoom in then it shows at correct position as shown in below screenshot.

    Can you please let us know how to resolve this issue.

    Thanks! 


    Balasaheb

    Tuesday, July 4, 2017 3:01 PM
  • Hi,

    Any update for the same. This issue is very critical for us.

    Thanks!


    Balasaheb

    Friday, July 7, 2017 1:36 PM
  • What browser are you using. As I said, we have no one else reporting this issue. Is your webpage zoomed? Does it fix the issue if you change the webpage zoom to 100%? 

    [Blog] [twitter] [LinkedIn]

    Tuesday, July 11, 2017 5:55 PM
  • Hi Ricky,

    We are using the Google Chrome. As we shown in above screenshot, we are able to see this in Bing map SDK also.

    Initially pushpin shows on different position but when we zoom in then it start to shown at exact position. 

    Here is more detail.

    We have search button. Once we clicks on that button we read data and plot it on Map. Then some time it shows pushpin on different position and we clicks once again on search button then it shown in correct position. So it is difficult for us to identify exact reason for it and this issues ocuured randomly not all time.

    Thanks! 


    Balasaheb

    Wednesday, July 12, 2017 5:20 AM
  • Ok, there is no issue, you are seeing an optical illusion. The sample in the SDK at all zoom levels has the SVG pushpins centered over their respective coordinates (anchored at center of pushpin). As you zoom the scale of the map changes, but not the pushpin as a static pixel sized element. As such the edges of the pushpin expand further out as you zoom out and covers more area. If the anchor point is incorrect with your pushpin, the pushpin can appear to drift away from the point where you want it to be binded to which appears to be the case with your original screenshots and is what I said originally was your issue. See this documentation that goes into details on this: https://msdn.microsoft.com/en-us/library/mt712695.aspx

    For your pushpin in your first screenshot, try using the following anchor pushpin option.

    anchor: new Microsoft.Maps.Point(17, 45)


    [Blog] [twitter] [LinkedIn]

    Wednesday, July 12, 2017 5:18 PM
  • Hi Ricky,

    Thanks for your reply. We have used the anchor property now pushpin shown at proper position.

    Thanks!


    Balasaheb

    Friday, July 14, 2017 2:09 PM