fixed css references for Spawn Button
This commit is contained in:
@@ -2,7 +2,8 @@
|
|||||||
var map; // god of the overviewer... bow before the google api.
|
var map; // god of the overviewer... bow before the google api.
|
||||||
var markerCollection = {}; // holds groups of markers
|
var markerCollection = {}; // holds groups of markers
|
||||||
var markersInit = false; // only have to load the markers once, this just makes sure we only do it once
|
var markersInit = false; // only have to load the markers once, this just makes sure we only do it once
|
||||||
var regionsInit = false; // same thing for the regions
|
var regionCollection = {}; // holds groups of regions
|
||||||
|
var regionsInit = false; // only have to load the regions once, this just makes sure we only do it once
|
||||||
|
|
||||||
var prevInfoWindow = null;
|
var prevInfoWindow = null;
|
||||||
|
|
||||||
@@ -82,21 +83,22 @@ function HomeControl(controlDiv, map) {
|
|||||||
controlDiv.style.padding = '5px';
|
controlDiv.style.padding = '5px';
|
||||||
|
|
||||||
// Set CSS for the control border
|
// Set CSS for the control border
|
||||||
var controlUI = document.createElement('DIV');
|
var control = document.createElement('DIV');
|
||||||
control.id='customControl';
|
control.id='top';
|
||||||
//controlUI.className='controlUI';
|
control.title = 'Click to set the map to Spawn';
|
||||||
controlUI.title = 'Click to set the map to Spawn';
|
controlDiv.appendChild(control);
|
||||||
controlDiv.appendChild(controlUI);
|
|
||||||
|
|
||||||
// Set CSS for the control interior
|
// Set CSS for the control interior
|
||||||
var controlText = document.createElement('DIV');
|
var controlText = document.createElement('DIV');
|
||||||
//controlText.className='controlText';
|
|
||||||
controlText.innerHTML = 'Spawn';
|
controlText.innerHTML = 'Spawn';
|
||||||
controlUI.appendChild(controlText);
|
controlText.id='button';
|
||||||
|
control.appendChild(controlText);
|
||||||
|
|
||||||
// Setup the click event listeners: simply set the map to map center as definned below
|
// Setup the click event listeners: simply set the map to map center as definned below
|
||||||
google.maps.event.addDomListener(controlUI, 'click', function() {
|
google.maps.event.addDomListener(control, 'click', function() {
|
||||||
map.panTo(defaultCenter);
|
map.panTo(fromWorldToLatLng(config.center[0],
|
||||||
|
config.center[1],
|
||||||
|
config.center[2]));
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -125,6 +127,7 @@ function drawMapControls() {
|
|||||||
// Spawn button
|
// Spawn button
|
||||||
var homeControlDiv = document.createElement('DIV');
|
var homeControlDiv = document.createElement('DIV');
|
||||||
var homeControl = new HomeControl(homeControlDiv, map);
|
var homeControl = new HomeControl(homeControlDiv, map);
|
||||||
|
homeControlDiv.id = "customControl";
|
||||||
homeControlDiv.index = 1;
|
homeControlDiv.index = 1;
|
||||||
map.controls[google.maps.ControlPosition.TOP_RIGHT].push(homeControlDiv);
|
map.controls[google.maps.ControlPosition.TOP_RIGHT].push(homeControlDiv);
|
||||||
|
|
||||||
@@ -173,11 +176,23 @@ function drawMapControls() {
|
|||||||
// parse the data as definned in the regions.js
|
// parse the data as definned in the regions.js
|
||||||
function initRegions() {
|
function initRegions() {
|
||||||
if (regionsInit) { return; }
|
if (regionsInit) { return; }
|
||||||
|
|
||||||
regionsInit = true;
|
regionsInit = true;
|
||||||
|
|
||||||
|
/* remove comment on this if we decide to add regionGroups in the config.js
|
||||||
|
this would let us selectivley show groups of regions based on the name of the region, or flags set.
|
||||||
|
could be good...
|
||||||
|
|
||||||
|
for (i in regionGroups) {
|
||||||
|
regionCollection[regionGroups[i].label] = [];
|
||||||
|
}
|
||||||
|
remove next line if this is kept.
|
||||||
|
*/
|
||||||
|
regionCollection['All Regions'] = [];
|
||||||
|
|
||||||
for (i in regionData) {
|
for (i in regionData) {
|
||||||
var region = regionData[i];
|
var region = regionData[i];
|
||||||
|
|
||||||
|
// pull all the points out of the regions file.
|
||||||
var converted = new google.maps.MVCArray();
|
var converted = new google.maps.MVCArray();
|
||||||
for (j in region.path) {
|
for (j in region.path) {
|
||||||
var point = region.path[j];
|
var point = region.path[j];
|
||||||
@@ -185,7 +200,7 @@ function initRegions() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (region.closed) {
|
if (region.closed) {
|
||||||
new google.maps.Polygon({clickable: false,
|
var region = new google.maps.Polygon({clickable: false,
|
||||||
geodesic: false,
|
geodesic: false,
|
||||||
map: map,
|
map: map,
|
||||||
strokeColor: region.color,
|
strokeColor: region.color,
|
||||||
@@ -197,7 +212,7 @@ function initRegions() {
|
|||||||
paths: converted
|
paths: converted
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
new google.maps.Polyline({clickable: false,
|
var region = new google.maps.Polyline({clickable: false,
|
||||||
geodesic: false,
|
geodesic: false,
|
||||||
map: map,
|
map: map,
|
||||||
strokeColor: region.color,
|
strokeColor: region.color,
|
||||||
@@ -207,6 +222,7 @@ function initRegions() {
|
|||||||
path: converted
|
path: converted
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
regionCollection['All Regions'].push(region); //if we add groups to config.js this will need to be changed.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user