play14team / strapi-plugin-map-field

Strapi plugin that provides a Mapbox custom field
MIT License
6 stars 3 forks source link

Map Marking on Double Click #5

Closed rifkidocs closed 10 months ago

rifkidocs commented 1 year ago

Is there a way to achieve accurate map marking when performing a double click, ensuring that the marker accurately corresponds to the clicked area rather than the closest geolocated point?

claudiobgit commented 1 year ago

Is there a way to achieve accurate map marking when performing a double click, ensuring that the marker accurately corresponds to the clicked area rather than the closest geolocated point?

This feature woul be really useful as it would permit both the 'closest to' and the 'precise' geolocations. I've checked through all the available plugins and couldn't find anything yet to achieve this.

cpontet commented 10 months ago

Hi, sorry for the late response. I don't think I can do anything about the accuracy of the double click. I think it really depends on the precision of the geolocalization of OpenStreetMap.

claudiobgit commented 10 months ago

[...] I think it really depends on the precision of the geolocalization of OpenStreetMap.

Maybe I didn't explain it correctly but I think the question from @rifkidocs was not about the accuracy of OSM geolocalization (that is pretty awesome btw) but more on the possibility of the marker to also point a lat/lon coordinate and not only snap to the closest POI. This feature would permit users to also record whatever lon,lat point on map, whether there is a geolocated point or not; in case not the address data would not be stored as only lon,lat would. A toggle button to enable or disable snapping would be killer. Hope this made it more clear.

enzobrunii commented 1 month ago

You can check out this fork where the coordinates are overwritten to place the marker at the location you clicked: Fork.

To update your package.json, replace the strapi-plugin-map-field entry with:

"strapi-plugin-map-field": "https://github.com/enzobrunii/strapi-plugin-map-field.git
claudiobgit commented 1 month ago

That's exactly what I was looking for @enzobrunii ! Will check it out asap. Thanks

claudiobgit commented 1 month ago

It works perfectly.