summaryrefslogtreecommitdiff
path: root/map3.js
diff options
context:
space:
mode:
Diffstat (limited to 'map3.js')
-rw-r--r--map3.js14
1 files changed, 5 insertions, 9 deletions
diff --git a/map3.js b/map3.js
index ebc3f21..33b1d95 100644
--- a/map3.js
+++ b/map3.js
@@ -4,7 +4,7 @@ var geocoder = null;
var reloadcon = null;
var countboxText = null;
var overlays = new Array();
-overlays["new"] = null;
+overlays["newmarker"] = null;
overlays["ruler"] = new Array();
overlays["locations"] = new Array();
overlays["links"] = new Array();
@@ -74,13 +74,6 @@ function onAddOverlay(overlay) {
switch(overlay.overlaytype) {
case "location": overlays["locations"].push(overlay); break;
case "link": overlays["links"].push(overlay); break;
- case "new": {
- if(overlays["newmarker"]) {
- map.removeOverlay(overlays["newmarker"]);
- }
- overlays["newmarker"] = overlay;
- break;
- }
case "ruler": {
if(overlays["ruler"][overlay.overlaysubtype]) {
map.removeOverlay(overlays["ruler"][overlay.overlaysubtype]);
@@ -539,13 +532,16 @@ function addNewNodeText(point) {
}
function setNewMarker(point) {
-// TODO: if a new new marker is set: remove the old one
// TODO: make this dragable??
var marker = new google.maps.Marker({position: point, icon: makeIcon('newnode')});
var infowindow = new google.maps.InfoWindow({ content: addNewNodeText(point) });
google.maps.event.addListener(infowindow,"closeclick",function () { marker.setMap(null); });
marker.setMap(map);
infowindow.open(map,marker);
+ if(overlays["newmarker"]) {
+ overlays["newmarker"].setMap(null);
+ }
+ overlays['newmarker'] = marker;
}
function fflogin(username, password) {