We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8689
    • 2 Posts
    Hi there,

    I’ve just started using MODx, and I’m loving it!

    However, I’m having some trouble with the GoogleMap snippet, so I wondered if anyone’s experienced anything like this before, and/or has any suggestions.

    I’ve got the maps displaying fine in my site, but the trouble I’m having is that the maps it displays aren’t showing the correct locations. They’re giving *almost* the right location, but the street location is slightly wrong.

    For example, for the specific map I’m currently trying to create, the address is "69 Meads Road, Eastbourne, East Sussex, BN20 7QL" (UK), and the map ends up pointing at Meads *Street* - around the corner. Close, but not close enough!

    The same happened for another address I tried out as a test.

    This isn’t an error with Google Maps in general, I’ve entered the same address into maps.google.com directly, and it gives the correct map.

    I noticed that I can’t find much reference to this snipet since 2006, so I was wondering if it’s still current or if people are generally using another snippet instead now? I’ve seen the GoogleMapMarker snippet, but I really want to be able to create maps from addresses, rather than from co-ordinates, for ease of user-editability.

    Thanks for any suggestions!

    Gavin
      • 8689
      • 2 Posts
      Update:

      I think the problem was caused by the issue discussed here: http://www.tomanthony.co.uk/blog/geocoding-uk-postcodes-with-google-map-api/

      (Google Maps API geocoding is known to be unreliable in the UK.)

      But I managed to get the solution suggested in the site above working by modifying the GoogleMap snippet. I added an extra parameter to the snippet call "ajaxkey", and an extra parameter to the map parameter list "ukpostcode". If both of these are set it calls the Google Maps local search function instead of the normal function.

      I don’t know if it’s worth me posting the fixed snippet somewhere? (If so, it’s definitely worth someone who knows this snippet having a look at what i’ve done - it’s the first time i’ve modified anything like this!)