Some minor signpost UI improvements
* Opening a sign infowindow will close the previously opened window. * The use of "Other" and "All" signpost categories are now more reasonable.
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
var prevInfoWindow = null;
|
||||||
|
|
||||||
function prepareSignMarker(marker, item) {
|
function prepareSignMarker(marker, item) {
|
||||||
|
|
||||||
@@ -5,7 +6,10 @@ function prepareSignMarker(marker, item) {
|
|||||||
var infowindow = new google.maps.InfoWindow({content: c
|
var infowindow = new google.maps.InfoWindow({content: c
|
||||||
});
|
});
|
||||||
google.maps.event.addListener(marker, 'click', function() {
|
google.maps.event.addListener(marker, 'click', function() {
|
||||||
|
if (prevInfoWindow)
|
||||||
|
prevInfoWindow.close()
|
||||||
infowindow.open(map,marker);
|
infowindow.open(map,marker);
|
||||||
|
prevInfoWindow = infowindow
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -25,6 +29,7 @@ function drawMapControls() {
|
|||||||
map.controls[google.maps.ControlPosition.TOP_RIGHT].push(compassDiv);
|
map.controls[google.maps.ControlPosition.TOP_RIGHT].push(compassDiv);
|
||||||
|
|
||||||
|
|
||||||
|
if (markerData.length > 0) {
|
||||||
// signpost display control
|
// signpost display control
|
||||||
//
|
//
|
||||||
|
|
||||||
@@ -57,8 +62,10 @@ function drawMapControls() {
|
|||||||
map.controls[google.maps.ControlPosition.TOP_RIGHT].push(signControl);
|
map.controls[google.maps.ControlPosition.TOP_RIGHT].push(signControl);
|
||||||
|
|
||||||
|
|
||||||
|
var hasSignGroup = false;
|
||||||
for (label in signGroups) {
|
for (label in signGroups) {
|
||||||
|
hasSignGroup = true;
|
||||||
|
var d = document.createElement("div");
|
||||||
var n = document.createElement("input");
|
var n = document.createElement("input");
|
||||||
n.type="checkbox";
|
n.type="checkbox";
|
||||||
|
|
||||||
@@ -68,10 +75,11 @@ function drawMapControls() {
|
|||||||
jQuery.each(markerCollection[t.data("label")], function(i,elem) {elem.setVisible(e.target.checked);});
|
jQuery.each(markerCollection[t.data("label")], function(i,elem) {elem.setVisible(e.target.checked);});
|
||||||
});
|
});
|
||||||
|
|
||||||
dropdownDiv.appendChild(n);
|
dropdownDiv.appendChild(d);
|
||||||
|
d.appendChild(n)
|
||||||
var textNode = document.createElement("text");
|
var textNode = document.createElement("text");
|
||||||
textNode.innerHTML = label + "<br/>";
|
textNode.innerHTML = label + "<br/>";
|
||||||
dropdownDiv.appendChild(textNode);
|
d.appendChild(textNode);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,8 +95,15 @@ function drawMapControls() {
|
|||||||
|
|
||||||
dropdownDiv.appendChild(n);
|
dropdownDiv.appendChild(n);
|
||||||
var textNode = document.createElement("text");
|
var textNode = document.createElement("text");
|
||||||
|
if (hasSignGroup) {
|
||||||
textNode.innerHTML = "Others<br/>";
|
textNode.innerHTML = "Others<br/>";
|
||||||
|
} else{
|
||||||
|
textNode.innerHTML = "All<br/>";
|
||||||
|
}
|
||||||
dropdownDiv.appendChild(textNode);
|
dropdownDiv.appendChild(textNode);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function initRegions() {
|
function initRegions() {
|
||||||
|
|||||||
Reference in New Issue
Block a user