none
Auto zoom on current location RRS feed

  • Question

  • Hello everyone. Our site dirtseek.com uses bing maps V7. When visiting our view maps page it auto zooms to your current location or geographical area but when using a phone and going to the view maps page it zooms in on a completely different state and location (when you are not connected to wifi).

    I am hoping someone can help me solve this issue and find out why it is doing that and how I can make it auto zoom to your location on a phone without being connected to wifi. Any answers or help would be greatly appreciated.


    • Edited by Ghodge96 Monday, November 7, 2016 7:32 PM
    Monday, November 7, 2016 7:03 PM

Answers

  • I suspect that your application is getting the users location using an IP address. Bing Maps doesn't provide IP address geocoding, so your application must be using a different service or data source to power this. Normally IP address geocoding will be accurate enough to get you in the right city when on a wifi network. The likely cause of your issue is that IP address geocoding on mobile devices is very inaccurate as the IP addresses are based on the cell phone network endpoint connection to the internet which can be several states away from where you are. Doing a simple test, ask Bing what your IP address is, copy it and paste it into one of the many sites that let you look up an IP address. Doing this with my phone at the moment shows that my IP address is for Portland, Oregon, I'm in Bellevue, Washington, about 180 miles away.

    If you want a more accurate position, you will need to use the users GPS device which you can access using the HMTL5 geolocation API. This will prompt the user to share their location though. What might be a better alternative is to first find out where the IP address location data is currently coming from. From there, see if there is any additional insights into the IP address. If you can determine that it is a mobile IP address, maybe show a map of the USA instead, or use the geolocation API and prompt the user to share their location.

    Another option is to migrate your app to Bing Maps V8. By default the Bing Maps V8 control centers the map over the users location. It uses IP addresses on the backend to power this as well, but the Bing Maps team has added a lot of additional logic which improves the geocoding of IP addresses from mobile devices. Loading the Bing Maps V8 control on my phone it shows me a map centered over Redmond, WA which is 7 miles away. Also note, Bing Maps V7 will reach end of life at the end of June, you will need to migrate to Bing Maps V8 in the next 6-8 months, so this is likely the best way to resolve your issue. Bing Maps V8 is 90% backwards compatible with V7, so migration shouldn't be overly difficult. You can find a migration guide here: http://social.technet.microsoft.com/wiki/contents/articles/34563.bing-maps-v7-to-v8-migration-guide.aspx


    [Blog] [twitter] [LinkedIn]



    • Proposed as answer by Ricky_Brundritt Monday, November 7, 2016 8:23 PM
    • Edited by Ricky_Brundritt Monday, November 7, 2016 8:33 PM
    • Marked as answer by Ghodge96 Tuesday, November 8, 2016 2:10 PM
    Monday, November 7, 2016 8:23 PM

All replies

  • I suspect that your application is getting the users location using an IP address. Bing Maps doesn't provide IP address geocoding, so your application must be using a different service or data source to power this. Normally IP address geocoding will be accurate enough to get you in the right city when on a wifi network. The likely cause of your issue is that IP address geocoding on mobile devices is very inaccurate as the IP addresses are based on the cell phone network endpoint connection to the internet which can be several states away from where you are. Doing a simple test, ask Bing what your IP address is, copy it and paste it into one of the many sites that let you look up an IP address. Doing this with my phone at the moment shows that my IP address is for Portland, Oregon, I'm in Bellevue, Washington, about 180 miles away.

    If you want a more accurate position, you will need to use the users GPS device which you can access using the HMTL5 geolocation API. This will prompt the user to share their location though. What might be a better alternative is to first find out where the IP address location data is currently coming from. From there, see if there is any additional insights into the IP address. If you can determine that it is a mobile IP address, maybe show a map of the USA instead, or use the geolocation API and prompt the user to share their location.

    Another option is to migrate your app to Bing Maps V8. By default the Bing Maps V8 control centers the map over the users location. It uses IP addresses on the backend to power this as well, but the Bing Maps team has added a lot of additional logic which improves the geocoding of IP addresses from mobile devices. Loading the Bing Maps V8 control on my phone it shows me a map centered over Redmond, WA which is 7 miles away. Also note, Bing Maps V7 will reach end of life at the end of June, you will need to migrate to Bing Maps V8 in the next 6-8 months, so this is likely the best way to resolve your issue. Bing Maps V8 is 90% backwards compatible with V7, so migration shouldn't be overly difficult. You can find a migration guide here: http://social.technet.microsoft.com/wiki/contents/articles/34563.bing-maps-v7-to-v8-migration-guide.aspx


    [Blog] [twitter] [LinkedIn]



    • Proposed as answer by Ricky_Brundritt Monday, November 7, 2016 8:23 PM
    • Edited by Ricky_Brundritt Monday, November 7, 2016 8:33 PM
    • Marked as answer by Ghodge96 Tuesday, November 8, 2016 2:10 PM
    Monday, November 7, 2016 8:23 PM
  • Thank you very much. We're going to transition over to V8 and see if that does that trick.
    Tuesday, November 8, 2016 2:10 PM