sanity-io / google-maps-input

Sanity plugin providing input handlers for geo-related input types using Google Maps
MIT License
9 stars 4 forks source link

Define default location #64

Closed WebShapedBiz closed 6 months ago

WebShapedBiz commented 6 months ago

Is your feature request related to a problem? Please describe. When adding new coordinates, the maps input always have the default position in Oslo, Norway.

Describe the solution you'd like While I understand why Oslo :-) it would be nice to have an option to set a different default location. I'm from Croatia and every time I add a location I have to scroll way down before even beginning to find my location. It's not a huge problem, but it isn't a very pleasant experience.

Cheers.

psntr commented 6 months ago

I was looking for that option, and it's actually already available, it's just not documented. "GoogleMapsInputConfig" from the plugin

googleMapsInput(
{ 
apiKey: "YOUR_API_KEY",
defaultLocale: "en", // You can also change the map locale
defaultZoom: 13, // Adapt your zoom lvl
defaultLocation: { lat: 35.6415853080272, lng: 139.718151254117} // Change it to Croatia
}
)
WebShapedBiz commented 6 months ago

Thank you very much @psntr for your time and effort. This will help a great deal.