- Issue created by @JeroenT
- @jeroent opened merge request.
- Status changed to Needs review
over 1 year ago 11:13am 5 June 2023 - 🇮🇹Italy itamair
Thanks @JeroenT ...
Actually the present way to remove a marker from the widget is to erase the Lat & Lon inputs fields,
but I understand it is not super clear as UI/UX and it could potentially be not possible if the user choose to hide the Lat & Lon inputs elements from the widget.Hence I will QA and Review this MR from you, asap ...: not really sure if setting both Lat and Lon to 0 (as you do in js) will result in a removal of the input marker. will check it out.
- Status changed to Fixed
over 1 year ago 7:55pm 6 June 2023 - 🇮🇹Italy itamair
Thanks @JeroenT ...
You Feature Request has been reviewed and approved and your MR refined to extend it in case of Google Maps map library (wasn't working on it otherwise), and to completely clean the Lat/Lon element, instead of setting them to 0,0.
Going to deploy a new Geofield Map release with this ... - 🇫🇷France mably
It looks like the
position
variable is not used in thesetMarkerPosition
call, as it probably should:// Remove marker from the map. remove_marker: function (mapid) { let self = this; let position; if (self.map_data[mapid].click_to_remove_marker) { if (!window.confirm(Drupal.t('Remove marker from map ?'))) { return; } } switch (self.map_data[mapid].map_library) { case 'leaflet': position = {lat: 0, lon: 0}; break; case 'gmap': position = new google.maps.LatLng(0, 0); break; } self.setMarkerPosition(mapid, {lat: 0, lon: 0}); $('#' + self.map_data[mapid].latid).val(null); $('#' + self.map_data[mapid].lngid).val(null); },
- 🇮🇹Italy itamair
thanks a lot @mably ... nice catches, all fixed. Going to deploy new release with these ...
Automatically closed - issue fixed for 2 weeks with no activity.