region label is now optional
This commit is contained in:
@@ -37,13 +37,13 @@ var signGroups = [
|
|||||||
* group. See below for some examples.
|
* group. See below for some examples.
|
||||||
* regions have been designed to work with the
|
* regions have been designed to work with the
|
||||||
* WorldGuard Overviewer Region importer at https://github.com/pironic/WG2OvR But your host must support php in order
|
* WorldGuard Overviewer Region importer at https://github.com/pironic/WG2OvR But your host must support php in order
|
||||||
* to run WG2OvR. You can also continue to use any other region format, but your regions
|
* to run WG2OvR. You can also continue to use any other region format.
|
||||||
* must now have a label definned in the regions.js.
|
|
||||||
*
|
*
|
||||||
* Required:
|
* Required:
|
||||||
* label : string. Displayed in the drop down menu control.
|
* label : string. Displayed in the drop down menu control.
|
||||||
* clickable : boolean. Will determine if we should generate an experimental info window
|
* clickable : boolean. Will determine if we should generate an experimental info window
|
||||||
* that shows details about the clicked region.
|
* that shows details about the clicked region.
|
||||||
|
* NOTE: if a region (as definned in region.js) does not have a label, this will default to false.
|
||||||
* match : function. Applied to each region (from region.js). It returns true if the region
|
* match : function. Applied to each region (from region.js). It returns true if the region
|
||||||
* Should be part of the group.
|
* Should be part of the group.
|
||||||
*
|
*
|
||||||
@@ -51,7 +51,7 @@ var signGroups = [
|
|||||||
* checked : boolean. Set to true to have the group visible by default
|
* checked : boolean. Set to true to have the group visible by default
|
||||||
*/
|
*/
|
||||||
var regionGroups = [
|
var regionGroups = [
|
||||||
//{label: "WorldGuard", clickable: false, checked: false, match: function(s) {return true}},
|
//{label: "All", clickable: false, checked: false, match: function(s) {return true}},
|
||||||
];
|
];
|
||||||
|
|
||||||
/* mapTypeData -- a list of alternate map renderings available. At least one rendering must be
|
/* mapTypeData -- a list of alternate map renderings available. At least one rendering must be
|
||||||
|
|||||||
@@ -20,22 +20,6 @@ function prepareSignMarker(marker, item) {
|
|||||||
infowindow.open(map,marker);
|
infowindow.open(map,marker);
|
||||||
prevInfoWindow = infowindow
|
prevInfoWindow = infowindow
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// add a popup info window to the region and then the region to the map.
|
|
||||||
// region is the clickable image on the map with all data.
|
|
||||||
// item is just the same item in the regions.js
|
|
||||||
function prepareRegionShape(shape, region) {
|
|
||||||
var c = "<div class=\"infoWindow\"><p>" + region.label + "</p></div>";
|
|
||||||
var infowindow = new google.maps.InfoWindow({content: c });
|
|
||||||
google.maps.event.addListener(shape, 'click', function() {
|
|
||||||
if (prevInfoWindow)
|
|
||||||
prevInfoWindow.close()
|
|
||||||
infowindow.open(map,shape);
|
|
||||||
prevInfoWindow = infowindow
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// reusable function for making drop down menus.
|
// reusable function for making drop down menus.
|
||||||
@@ -232,6 +216,13 @@ function initRegions() {
|
|||||||
var clickable = regionGroup.clickable
|
var clickable = regionGroup.clickable
|
||||||
var label = regionGroup.label;
|
var label = regionGroup.label;
|
||||||
|
|
||||||
|
if(region.label) {
|
||||||
|
var name = region.label
|
||||||
|
} else {
|
||||||
|
var name = 'rawr';
|
||||||
|
clickable = false; // if it doesn't have a name, we dont have to show it.
|
||||||
|
}
|
||||||
|
|
||||||
if (region.closed) {
|
if (region.closed) {
|
||||||
var shape = new google.maps.Polygon({
|
var shape = new google.maps.Polygon({
|
||||||
name: region.label,
|
name: region.label,
|
||||||
@@ -338,10 +329,7 @@ function initMarkers() {
|
|||||||
if (item.type == 'sign') {
|
if (item.type == 'sign') {
|
||||||
prepareSignMarker(marker, item);
|
prepareSignMarker(marker, item);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!matched) {
|
if (!matched) {
|
||||||
@@ -365,8 +353,6 @@ function initMarkers() {
|
|||||||
prepareSignMarker(marker, item);
|
prepareSignMarker(marker, item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user