Resonator on map

Change:
Add "RESONATOR_DISPLAY_ZOOM_LEVEL" to control minimum zoom level resonator will display
Add layerGroup "resonatorsLayers" to draw resonators on it.
Add "window.resonators" to store references to resonators on map

Resonator will have guid of portal with ".11" or ".12" replaced with ".r0"~".r7"
Add function "window.renderResontor" to draw resonators (use sorgo's code [sorgo](https://github.com/sorgo))
"window.renderPortal" will call "window.renderResontor" before add portal to portalsLayers
Change "window.removeByGuid" to handle resonators
Change "window.cleanUp" to handle resonators cleanup
This commit is contained in:
Xelio
2013-02-10 13:25:39 +08:00
parent 6fdfac2923
commit c34d7ee3a2
4 changed files with 109 additions and 3 deletions

View File

@ -81,6 +81,15 @@ window.setupMap = function() {
map.addLayer(linksLayer, true);
addLayers['Links'] = linksLayer;
resonatorsLayers = [];
for(var i = 1; i <= 8; i++) {
resonatorsLayers[i] = L.layerGroup([]);
map.addLayer(resonatorsLayers[i]);
var t = 'Level ' + i + ' Portal resonators';
addLayers[t] = resonatorsLayers[i];
}
map.addControl(new L.Control.Layers({
'OSM Cloudmade Midnight': views[0],
'OSM Cloudmade Minimal': views[1],