From b99bbb862b51835c6d330366bbe1159c22f82e0c Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Sat, 13 Feb 2010 10:24:13 -0500 Subject: [PATCH] Delete the mapMarker when clearing the Location text field --- kronolith/js/kronolith.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/kronolith/js/kronolith.js b/kronolith/js/kronolith.js index 191988a1c..c94a94ec4 100644 --- a/kronolith/js/kronolith.js +++ b/kronolith/js/kronolith.js @@ -2511,6 +2511,7 @@ KronolithCore = { $('kronolithEventMapLink').show(); } else if (Kronolith.conf.maps.driver) { $('kronolithEventMapLink').hide(); + this.removeMapMarker(); } return; } @@ -3781,6 +3782,19 @@ KronolithCore = { } }, + /** + * Remove the event marker from the map. Called after clearing the location + * field. + */ + removeMapMarker: function() + { + if (this.mapMarker) { + this.map.removeMarker(this.mapMarker); + $('kronolithEventLocationLon').value = null; + $('kronolithEventLocationLat').value = null; + } + }, + ensureMap: function() { if (!this.mapInitialized) { -- 2.11.0