0

added options to overviewerConfig.js for search box, coords box, overlay menu

This commit is contained in:
Aaron Griffith
2011-07-14 23:07:32 -04:00
parent cbd48fa2eb
commit f7015396ab
2 changed files with 23 additions and 7 deletions

View File

@@ -58,7 +58,6 @@ var overviewer = {
overviewer.util.initializeMarkers(); overviewer.util.initializeMarkers();
overviewer.util.initializeRegions(); overviewer.util.initializeRegions();
overviewer.util.createMapControls(); overviewer.util.createMapControls();
overviewer.util.createSearchBox();
}, },
/** /**
* This adds some methods to these classes because Javascript is stupid * This adds some methods to these classes because Javascript is stupid
@@ -620,7 +619,10 @@ var overviewer = {
var coordsDiv = document.createElement('DIV'); var coordsDiv = document.createElement('DIV');
coordsDiv.id = 'coordsDiv'; coordsDiv.id = 'coordsDiv';
coordsDiv.innerHTML = ''; coordsDiv.innerHTML = '';
if (overviewerConfig.map.controls.coordsBox) {
overviewer.map.controls[google.maps.ControlPosition.BOTTOM_LEFT].push(coordsDiv); overviewer.map.controls[google.maps.ControlPosition.BOTTOM_LEFT].push(coordsDiv);
}
// Update coords on mousemove // Update coords on mousemove
google.maps.event.addListener(overviewer.map, 'mousemove', function (event) { google.maps.event.addListener(overviewer.map, 'mousemove', function (event) {
var worldcoords = overviewer.util.fromLatLngToWorld(event.latLng.lat(), event.latLng.lng()); var worldcoords = overviewer.util.fromLatLngToWorld(event.latLng.lat(), event.latLng.lng());
@@ -687,7 +689,7 @@ var overviewer = {
overviewer.util.createDropDown('Regions', items); overviewer.util.createDropDown('Regions', items);
} }
if (overviewer.collections.overlays.length > 0) { if (overviewerConfig.map.controls.overlays && overviewer.collections.overlays.length > 0) {
// overlay maps control // overlay maps control
var items = []; var items = [];
for (i in overviewer.collections.overlays) { for (i in overviewer.collections.overlays) {
@@ -715,6 +717,9 @@ var overviewer = {
} }
overviewer.util.createDropDown('Overlays', items); overviewer.util.createDropDown('Overlays', items);
} }
// call out to create search box, as it's pretty complicated
overviewer.util.createSearchBox();
}, },
/** /**
* Reusable method for creating drop-down menus * Reusable method for creating drop-down menus
@@ -836,7 +841,9 @@ var overviewer = {
} }
}); });
if (overviewerConfig.map.controls.searchBox) {
overviewer.map.controls[google.maps.ControlPosition.TOP_RIGHT].push(searchControl); overviewer.map.controls[google.maps.ControlPosition.TOP_RIGHT].push(searchControl);
}
}, },
/** /**
* Create the pop-up infobox for when you click on a region, this can't * Create the pop-up infobox for when you click on a region, this can't

View File

@@ -50,9 +50,18 @@ var overviewerConfig = {
*/ */
'mapType': true, 'mapType': true,
/** /**
* The small box at the bottom that displays the link to the current map view. * The coordsBox control is the box showing the XYZ coordinates
* under the cursor.
*/ */
'link': true 'coordsBox': true,
/**
* The overlays control is the drop-down box for selecting overlays.
*/
'overlays': true,
/**
* The searchBox control is the search box for markers.
*/
'searchBox': true
}, },
/** /**
* The zoom level when the page is loaded without a specific zoom setting * The zoom level when the page is loaded without a specific zoom setting