GoogleMaps property editor
# help-with-umbraco
o
What package do people use these days for displaying Google Maps and placing pins on a map via the backoffice?
a
Yep, same as I use 🙂
b
If there's a concern about the pricing and daily quotas, it is also an option to use the Open Street Map package in backoffice and use the coordinates to render Google Maps in frontend. https://marketplace.umbraco.com/package/bergmania.openstreetmap On a few projects we just render a Open Street Map in frontend as they only needed a basic map with a marker. But for more complex features I would go with Google Maps. On a project I near to use geo location to list closest/nearest stores/items first. I saw a few approaches where some use the Directions API, which need to be enabled and I think it has an additional cost. However I was able to solve this without using the Directions API by using
google.maps.geometry.spherical.computeDistanceBetween
and sort the results by calculated distance.
a
@Bjarne Fyrstenborg if you're okay with doing the distance calculations in C# instead of JS, my Skybrud.Essentials package can help you with that: https://packages.skybrud.dk/skybrud.essentials/docs/maps/points/#distance
b
@Anders Bjerner thanks, it may useful in another project 😎 Does it wrap the underlying spatial search in Lucene? https://gist.github.com/bjarnef/6b427123903c90e034027bb8a3a5d43a Hopefully in a not too far future Examine will get better support for spatial search OOTB https://github.com/Shazwazza/Examine/pull/328 and combined with the merges facets implementaion I think it would benefits many Umbraco projects (including Umbraco Commerce)
a
My package doesn't target Umbraco or Examine/Lucene. But I'd imagine Lucene has some similar logic somewhere internally to calculate the distance. But yes, if you're doing an Examine search to find the nearest point, your snippet is probably the way to go (only skimmed through it)