Leaflet / OpenStreetMaps with incorrect location

Home Forums MapPress Support Leaflet / OpenStreetMaps with incorrect location

This topic contains 3 replies, has 2 voices, and was last updated by  Chris 4 days, 19 hours ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #18300

    amandag
    Participant

    I am having an issue with map pins being placed incorrectly. Same town, but varying distances away from the actual location. And, ironically, if I place the exact same address into the OpenStreetMaps website, that is showing in the correct spot. So it doesn’t seem to be OpenStreetMaps, but something down the chain in Leaflet, MapPress or one of the other technologies.

    For instance:

    383 Woodbury Ave, Portsmouth, NH 03801

    My Map (dynamically generated using PHP):
    https://www.portsmouthnh.com/listing/americas-best-inns-portsmouth/

    OpenStreetMap:
    https://www.openstreetmap.org/search?query=383%20Woodbury%20Ave%2C%20Portsmouth%2C%20NH%2003801#map=19/43.07511/-70.77855

    Other times the map is in the middle of the ocean. Sometimes this fixes itself on a refresh, sometimes not.

    #18305

    Chris
    Keymaster

    Hi,

    MapPress doesn’t do any geocoding itself – it uses either Algolia Places or Google geocoders, based on which ‘engine’ you select in the settings.

    Algolia is only accurate to the street level – not to individual street numbers.  I think that’s why the marker is in the wrong place for 383 Woodbury Ave.

    For the next version of MapPress I’ll add the MapBox and OSM geocoders, which seem to be more accurate than Algolia.  I’ll also include a MapPress setting to allow you select which geocoder to use.

    If you use the contact form to email me, I’ll send you a preview version to test as soon as it’s ready – later this week.

    Until then, you could also switch to Google instead of Leaflet in the MapPress settings.  Google has the best geocoder, but it requires an API key and has usage limits.

     

    #18308

    amandag
    Participant

    Thank you so much for the helpful response. The Google Maps API charges are daunting as we have a high traffic site. I didn’t know that Agolia lacked the same specificity. Do you think it would help if I pass the business name in before the street address? I’ll probably test it just to see.

    Is OSM also a free geocoder? I would love to test that. I’ll send you a message.

    #18310

    Chris
    Keymaster

    It’s worth a try adding the business name.  OSM is also free (their geocoder is called ‘Nominatim’).  I think Algolia was built on an OSM data extract several years ago, maybe it hasn’t been updated?

    MapBox also worked for me when I tried the sample address.  There are other geocoders that are paid but have generous free usage limits.  I haven’t tried them myself, but here’s a couple if you want to have a look:

    https://geocod.io/try/

    https://opencagedata.com

     

     

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.