xref: /plugin/openlayersmap/script.js (revision d9ed90b9a8334ecb0adbece0b413573db57336ce)
1/*
2 * Copyright (c) 2008-2014 Mark C. Prins <mprins@users.sf.net>
3 *
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16
17/**
18 * @fileoverview Javascript voor OpenLayers plugin.
19 *
20 * @requires {lib/OpenLayers.js} or a full openlayers build
21 * @author Mark C. Prins <mprins@users.sf.net>
22 *
23 */
24
25/**
26 * Openlayers selectcontrol.
27 *
28 * @type {OpenLayers.Control.SelectFeature}
29 * @private
30 */
31var selectControl;
32
33/**
34 * handle feature select event.
35 *
36 * @param {OpenLayers.Feature.Vector}
37 *            selFeature the selected feature
38 */
39function onFeatureSelect(selFeature) {
40	// 'this' is selectFeature control
41	var pPos = selFeature.geometry.getBounds().getCenterLonLat();
42	// != OpenLayers.Geometry.Point
43	if (selFeature.geometry.CLASS_NAME === "OpenLayers.Geometry.LineString") {
44		try {
45			// for lines make the popup show at the cursor position
46			// TODO this will fail for keyboard select
47			pPos = selFeature.layer.map.getLonLatFromViewPortPx(this.handlers.feature.evt.xy);
48		} catch (anErr) {
49			OpenLayers.Console.warn("unable to get event position; reverting to boundingbox center.");
50			pPos = selFeature.geometry.getBounds().getCenterLonLat();
51		}
52	}
53
54	var pContent = '<div class="spacer">&nbsp;</div>';
55	if (selFeature.data.rowId !== undefined) {
56		pContent += '<span class="rowId">' + selFeature.data.rowId + ': </span>';
57	}
58	if (selFeature.data.name !== undefined) {
59		pContent += '<span class="txt">' + selFeature.data.name + '</span>';
60	}
61	if (selFeature.data.ele !== undefined) {
62		pContent += '<div class="ele">elevation: ' + selFeature.data.ele + '</div>';
63	}
64	if (selFeature.data.type !== undefined) {
65		pContent += '<div>' + selFeature.data.type + '</div>';
66	}
67	if (selFeature.data.time !== undefined) {
68		pContent += '<div class="time">time: ' + selFeature.data.time + '</div>';
69	}
70	if (selFeature.data.description !== undefined) {
71		pContent += '<div class="desc">' + selFeature.data.description + '</div>';
72	}
73
74	if (pContent.length > 0) {
75		// only show when there is something to show...
76		var popup = new OpenLayersMap.Popup.FramedCloud("olPopup", pPos, null, pContent, null, true, function() {
77			selectControl.unselect(selFeature);
78			jQuery('#' + selectControl.layer.map.div.id).focus();
79		});
80		selFeature.popup = popup;
81		selFeature.layer.map.addPopup(popup);
82		jQuery('#olPopup').attr("tabindex", -1).focus();
83	}
84}
85
86/**
87 * handle feature unselect event. remove & destroy the popup.
88 *
89 * @param {OpenLayers.Feature.Vector}
90 *            selFeature the un-selected feature
91 */
92function onFeatureUnselect(selFeature) {
93	if (selFeature.popup !== null) {
94		selFeature.layer.map.removePopup(selFeature.popup);
95		selFeature.popup.destroy();
96		selFeature.popup = null;
97	}
98}
99/**
100 * Test for css support in the browser by sniffing for a css class we added
101 * using javascript added by the action plugin; this is an edge case because
102 * browsers that support javascript generally support css as well.
103 *
104 * @returns {Boolean} true when the browser supports css (and implicitly
105 *          javascript)
106 */
107function olTestCSSsupport() {
108	return (jQuery('.olCSSsupported').length > 0);
109}
110
111/**
112 * Creates a DocumentFragment to insert into the dom.
113 *
114 * @param mapid
115 *            id for the map div
116 * @param width
117 *            width for the map div
118 * @param height
119 *            height for the map div
120 * @returns a {DocumentFragment} element that can be injected into the dom
121 */
122function olCreateMaptag(mapid, width, height) {
123	var mEl = '<div id="' + mapid + '-olContainer" class="olContainer olWebOnly">' + '<div id="' + mapid
124			+ '" tabindex="-1" style="width:' + width + ';height:' + height + ';" class="olMap">'
125			+ '<a class="olAccesskey" href="#' + mapid + '" onclick="document.getElementById(&quot;' + mapid
126			+ '&quot;).focus(); return false;" title="' + OpenLayers.i18n("activate_map") + '">'
127			+ OpenLayers.i18n("activate_map") + '</a>' + '</div>' + '<div id="' + mapid + '-olStatusBar" style="width:'
128			+ width + ';"class="olStatusBarContainer">' + '<div id="' + mapid
129			+ '-statusbar-scale" class="olStatusBar olStatusBarScale">scale</div>' + '<div id="' + mapid
130			+ '-statusbar-mouseposition" class="olStatusBar olStatusBarMouseposition"></div>' + '<div id="' + mapid
131			+ '-statusbar-projection" class="olStatusBar olStatusBarProjection">proj</div>' + '<div id="' + mapid
132			+ '-statusbar-text" class="olStatusBar olStatusBarText">txt</div>' + '</div></div>',
133	// fragment
134	frag = document.createDocumentFragment(),
135	// temp node
136	temp = document.createElement('div');
137	temp.innerHTML = mEl;
138	while (temp.firstChild) {
139		frag.appendChild(temp.firstChild);
140	}
141	return frag;
142}
143
144/**
145 * Create the map based on the params given.
146 *
147 * @param {Object}
148 *            mapOpts MapOptions hash {id:'olmap', width:500px, height:500px,
149 *            lat:6710200, lon:506500, zoom:13, statusbar:1, controls:1,
150 *            poihoverstyle:1, baselyr:'', kmlfile:'', gpxfile:'', geojsonfile,
151 *            summary:''}
152 * @param {Array}
153 *            OLmapPOI array with POI's [ {lat:6710300,lon:506000,txt:'instap
154 *            punt',angle:180,opacity:.9,img:'', rowId:n},... ]);
155 *
156 * @return {OpenLayers.Map} the created map
157 */
158function createMap(mapOpts, OLmapPOI) {
159	if (!olEnable) {
160		return;
161	}
162	if (!olTestCSSsupport()) {
163		olEnable = false;
164		return;
165	}
166	OpenLayers.ImgPath = DOKU_BASE + 'lib/plugins/openlayersmap/lib/img/';
167	OpenLayers.IMAGE_RELOAD_ATTEMPTS = 3;
168	// OpenLayers.Layer.Vector.prototype.renderers = ["SVG", "VML"];
169
170	// find map element location
171	var cleartag = document.getElementById(mapOpts.id + '-clearer');
172	if (cleartag === null) {
173		return;
174	}
175	// create map element and add to document
176	var fragment = olCreateMaptag(mapOpts.id, mapOpts.width, mapOpts.height);
177	cleartag.parentNode.insertBefore(fragment, cleartag);
178
179	/** dynamic map extent. */
180	var extent = new OpenLayers.Bounds(),
181
182	/** map. */
183	m = new OpenLayers.Map({
184		div : mapOpts.id,
185		projection : 'EPSG:900913',
186		displayProjection : new OpenLayers.Projection("EPSG:4326"),
187		numZoomLevels : 22,
188		controls : [],
189		theme : null
190	});
191
192	if (osmEnable) {
193		/* add OSM map layers */
194		m.addLayer(new OpenLayers.Layer.OSM());
195
196		m.addLayer(new OpenLayersMap.Layer.OCM());
197		/* open cycle map */
198		m.addLayer(new OpenLayersMap.Layer.OCM("transport", [
199				"http://a.tile2.opencyclemap.org/transport/${z}/${x}/${y}.png",
200				"http://b.tile2.opencyclemap.org/transport/${z}/${x}/${y}.png",
201				"http://c.tile2.opencyclemap.org/transport/${z}/${x}/${y}.png" ], {
202			visibility : mapOpts.baselyr === "transport"
203		}));
204		m.addLayer(new OpenLayersMap.Layer.OCM("landscape", [
205				"http://a.tile3.opencyclemap.org/landscape/${z}/${x}/${y}.png",
206				"http://b.tile3.opencyclemap.org/landscape/${z}/${x}/${y}.png",
207				"http://c.tile3.opencyclemap.org/landscape/${z}/${x}/${y}.png" ], {
208			visibility : mapOpts.baselyr === "landscape"
209		}));
210
211		m.addLayer(new OpenLayersMap.Layer.CloudMade());
212		m.addLayer(new OpenLayersMap.Layer.CloudMade("cloudmade fresh", [
213				"http://a.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/997/256/${z}/${x}/${y}.png",
214				"http://b.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/997/256/${z}/${x}/${y}.png",
215				"http://c.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/997/256/${z}/${x}/${y}.png" ], {
216			visibility : mapOpts.baselyr === "cloudmade fresh"
217		}));
218
219		m.addLayer(new OpenLayers.Layer.OSM(
220				"hike and bike map", "http://toolserver.org/tiles/hikebike/${z}/${x}/${y}.png", {
221					visibility : mapOpts.baselyr === "hike and bike map",
222					tileOptions : {
223						crossOriginKeyword : null
224					}
225				}));
226	}
227	/*
228	 * add MapQuest map layers, see:
229	 * http://developer.mapquest.com/web/products/open/map
230	 */
231	if (mqEnable) {
232		m.addLayer(new OpenLayersMap.Layer.MapQuest());
233		m.addLayer(new OpenLayersMap.Layer.MapQuest("mapquest sat", [
234				"http://otile1.mqcdn.com/tiles/1.0.0/sat/${z}/${x}/${y}.jpg",
235				"http://otile2.mqcdn.com/tiles/1.0.0/sat/${z}/${x}/${y}.jpg",
236				"http://otile3.mqcdn.com/tiles/1.0.0/sat/${z}/${x}/${y}.jpg",
237				"http://otile4.mqcdn.com/tiles/1.0.0/sat/${z}/${x}/${y}.jpg" ], {
238			// note that global coverage is provided at zoom levels 0-11. Zoom
239			// Levels 12+ are provided only in the United States (lower 48).
240			numZoomLevels : 12,
241			visibility : mapOpts.baselyr === "mapquest sat"
242		}));
243
244	}
245
246	if (gEnable) {
247		/* load google maps */
248		try {
249			m.addLayer(new OpenLayers.Layer.Google("google relief", {
250				type : google.maps.MapTypeId.TERRAIN,
251				numZoomLevels : 16,
252				animationEnabled : true,
253				visibility : mapOpts.baselyr === "google relief"
254			}));
255			m.addLayer(new OpenLayers.Layer.Google("google sat", {
256				type : google.maps.MapTypeId.SATELLITE,
257				animationEnabled : true,
258				visibility : mapOpts.baselyr === "google sat"
259			}));
260			m.addLayer(new OpenLayers.Layer.Google("google hybrid", {
261				type : google.maps.MapTypeId.HYBRID,
262				animationEnabled : true,
263				visibility : mapOpts.baselyr === "google hybrid"
264			}));
265			m.addLayer(new OpenLayers.Layer.Google("google road", {
266				animationEnabled : true,
267				visibility : mapOpts.baselyr === "google road"
268			}));
269		} catch (ol_err1) {
270			Openlayers.Console.userError('Error loading Google maps' + ol_err1);
271		}
272	}
273
274	if (bEnable && bApiKey !== '') {
275		try {
276			/* add Bing tiles */
277			m.addLayer(new OpenLayers.Layer.Bing({
278				key : bApiKey,
279				type : "Road",
280				name : "bing road",
281				visibility : mapOpts.baselyr === "bing road",
282				wrapDateLine : true,
283				attributionTemplate : '<a target="_blank" href="http://www.bing.com/maps/">'
284						+ 'Bing™</a><img src="http://www.bing.com/favicon.ico" alt="Bing logo"/> ${copyrights}'
285						+ '<a target="_blank" href="http://www.microsoft.com/maps/product/terms.html">Terms of Use</a>'
286			}));
287			m.addLayer(new OpenLayers.Layer.Bing({
288				key : bApiKey,
289				type : "Aerial",
290				name : "bing sat",
291				visibility : mapOpts.baselyr === "bing sat",
292				wrapDateLine : true,
293				attributionTemplate : '<a target="_blank" href="http://www.bing.com/maps/">'
294						+ 'Bing™</a><img src="http://www.bing.com/favicon.ico" alt="Bing logo"/> ${copyrights}'
295						+ '<a target="_blank" href="http://www.microsoft.com/maps/product/terms.html">Terms of Use</a>'
296			}));
297			m.addLayer(new OpenLayers.Layer.Bing({
298				key : bApiKey,
299				type : "AerialWithLabels",
300				name : "bing hybrid",
301				visibility : mapOpts.baselyr === "bing hybrid",
302				wrapDateLine : true,
303				attributionTemplate : '<a target="_blank" href="http://www.bing.com/maps/">'
304						+ 'Bing™</a><img src="http://www.bing.com/favicon.ico" alt="Bing logo"/> ${copyrights}'
305						+ '<a target="_blank" href="http://www.microsoft.com/maps/product/terms.html">Terms of Use</a>'
306			}));
307		} catch (ol_errBing) {
308			Openlayers.Console.userError('Error loading Bing maps: ' + ol_errBing);
309		}
310	}
311
312	m.setCenter(new OpenLayers.LonLat(mapOpts.lon, mapOpts.lat).transform(m.displayProjection, m.projection),
313			mapOpts.zoom);
314	extent.extend(m.getExtent());
315
316	// change/set alternative baselyr
317	try {
318		m.setBaseLayer(((m.getLayersByName(mapOpts.baselyr))[0]));
319	} catch (ol_err4) {
320		m.setBaseLayer(m.layers[0]);
321	}
322
323	m.addControls([ new OpenLayers.Control.ScaleLine({
324		geodesic : true
325	}), new OpenLayers.Control.KeyboardDefaults({
326		observeElement : mapOpts.id
327	}), new OpenLayers.Control.Navigation() ]);
328
329	if (mapOpts.statusbar === 1) {
330		// statusbar control: mouse pos.
331		m.addControl(new OpenLayers.Control.MousePosition({
332			'div' : OpenLayers.Util.getElement(mapOpts.id + '-statusbar-mouseposition')
333		}));
334		// statusbar control: scale
335		m.addControl(new OpenLayers.Control.Scale(mapOpts.id + '-statusbar-scale'));
336		// statusbar control: attribution
337		m.addControl(new OpenLayers.Control.Attribution({
338			'div' : OpenLayers.Util.getElement(mapOpts.id + '-statusbar-text')
339		}));
340		// statusbar control: projection
341		OpenLayers.Util.getElement(mapOpts.id + '-statusbar-projection').innerHTML = m.displayProjection;
342	} else {
343		OpenLayers.Util.getElement(mapOpts.id + '-olStatusBar').display = 'none';
344	}
345
346	if (OLmapPOI.length > 0) {
347		var markers = new OpenLayers.Layer.Vector("POI", {
348			styleMap : new OpenLayers.StyleMap({
349				"default" : {
350					cursor : "help",
351					externalGraphic : "${img}",
352					graphicHeight : 16,
353					graphicWidth : 16,
354					// graphicXOffset : 0,
355					// graphicYOffset : -8,
356					graphicOpacity : "${opacity}",
357					rotation : "${angle}",
358					backgroundGraphic : DOKU_BASE + "lib/plugins/openlayersmap/icons/marker_shadow.png",
359					// backgroundXOffset : 0,
360					// backgroundYOffset : -4,
361					backgroundRotation : "${angle}",
362					pointRadius : 10,
363					labelXOffset : 8,
364					labelYOffset : 8,
365					labelAlign : "lb",
366					label : "${label}",
367					// fontColor : "",
368					fontFamily : "monospace",
369					fontSize : "12px",
370					fontWeight : "bold"
371				},
372				"select" : {
373					cursor : "help",
374					externalGraphic : DOKU_BASE + "lib/plugins/openlayersmap/icons/marker-red.png",
375					graphicHeight : 16,
376					graphicWidth : 16,
377					// graphicXOffset : 0,
378					// graphicYOffset : -8,
379					graphicOpacity : 1.0,
380					rotation : "${angle}"
381				}
382			}),
383			isBaseLayer : false,
384			rendererOptions : {
385				yOrdering : true
386			}
387		});
388		m.addLayer(markers);
389		var features = [];
390		for (var j = 0; j < OLmapPOI.length; j++) {
391			var feat = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(OLmapPOI[j].lon, OLmapPOI[j].lat)
392					.transform(m.displayProjection, m.projection), {
393				angle : OLmapPOI[j].angle,
394				opacity : OLmapPOI[j].opacity,
395				img : DOKU_BASE + "lib/plugins/openlayersmap/icons/" + OLmapPOI[j].img,
396				label : OLmapPOI[j].rowId
397			});
398			feat.data = {
399				name : OLmapPOI[j].txt,
400				rowId : OLmapPOI[j].rowId
401			};
402			features.push(feat);
403		}
404		markers.addFeatures(features);
405		extent.extend(markers.getDataExtent());
406		m.zoomToExtent(extent);
407	}
408
409	/* GPX layer */
410	if (mapOpts.gpxfile.length > 0) {
411		var layerGPX = new OpenLayers.Layer.Vector("GPS route", {
412			protocol : new OpenLayers.Protocol.HTTP({
413				url : DOKU_BASE + "lib/exe/fetch.php?media=" + mapOpts.gpxfile,
414				format : new OpenLayers.Format.GPX({
415					extractWaypoints : true,
416					extractTracks : true,
417					extractStyles : true,
418					extractAttributes : true,
419					handleHeight : true,
420					maxDepth : 3
421				})
422			}),
423			style : {
424				strokeColor : "#0000FF",
425				strokeWidth : 3,
426				strokeOpacity : 0.7,
427				pointRadius : 4,
428				fillColor : "#0099FF",
429				fillOpacity : 0.7
430			// , label:"${name}"
431			},
432			projection : new OpenLayers.Projection("EPSG:4326"),
433			strategies : [ new OpenLayers.Strategy.Fixed() ]
434		});
435		m.addLayer(layerGPX);
436		layerGPX.events.register('loadend', m, function() {
437			extent.extend(layerGPX.getDataExtent());
438			m.zoomToExtent(extent);
439		});
440	}
441
442	/* GeoJSON layer */
443	if (mapOpts.geojsonfile.length > 0) {
444		var layerGJS = new OpenLayers.Layer.Vector("json data", {
445			protocol : new OpenLayers.Protocol.HTTP({
446				url : DOKU_BASE + "lib/exe/fetch.php?media=" + mapOpts.geojsonfile,
447				format : new OpenLayers.Format.GeoJSON({
448					ignoreExtraDims : true
449				})
450			}),
451			style : {
452				strokeColor : "#FF00FF",
453				strokeWidth : 3,
454				strokeOpacity : 0.7,
455				pointRadius : 4,
456				fillColor : "#FF99FF",
457				fillOpacity : 0.7
458			// , label:"${name}"
459			},
460			projection : new OpenLayers.Projection("EPSG:4326"),
461			strategies : [ new OpenLayers.Strategy.Fixed() ]
462		});
463		m.addLayer(layerGJS);
464		layerGJS.events.register('loadend', m, function() {
465			extent.extend(layerGJS.getDataExtent());
466			m.zoomToExtent(extent);
467		});
468	}
469
470	/* KML layer */
471	if (mapOpts.kmlfile.length > 0) {
472		var layerKML = new OpenLayers.Layer.Vector("KML file", {
473			protocol : new OpenLayers.Protocol.HTTP({
474				url : DOKU_BASE + "lib/exe/fetch.php?media=" + mapOpts.kmlfile,
475				format : new OpenLayers.Format.KML({
476					extractStyles : true,
477					extractAttributes : true,
478					maxDepth : 3
479				})
480			}),
481			style : {
482				label : "${name}"
483			},
484			projection : new OpenLayers.Projection("EPSG:4326"),
485			strategies : [ new OpenLayers.Strategy.Fixed() ]
486		});
487		m.addLayer(layerKML);
488		layerKML.events.register('loadend', m, function() {
489			extent.extend(layerKML.getDataExtent());
490			m.zoomToExtent(extent);
491		});
492	}
493
494	// selectcontrol for layers
495	if ((m.getLayersByClass('OpenLayers.Layer.GML').length > 0)
496			|| m.getLayersByClass('OpenLayers.Layer.Vector').length > 0) {
497		selectControl = new OpenLayers.Control.SelectFeature((m.getLayersByClass('OpenLayers.Layer.Vector')).concat(m
498				.getLayersByClass('OpenLayers.Layer.GML')), {
499			hover : mapOpts.poihoverstyle,
500			onSelect : onFeatureSelect,
501			onUnselect : onFeatureUnselect
502		});
503		m.addControl(selectControl);
504		selectControl.activate();
505
506		// keyboard select control
507		var iControl = new OpenLayersMap.Control.KeyboardClick({
508			observeElement : mapOpts.id,
509			selectControl : selectControl
510		});
511		m.addControl(iControl);
512	}
513
514	if (mapOpts.controls === 1) {
515		/* add base controls to map */
516		m.addControls([ new OpenLayersMap.Control.LayerSwitcher(), new OpenLayers.Control.Graticule({
517			visible : false
518		}), new OpenLayersMap.Control.OverviewMap({
519			mapOptions : {
520				theme : null
521			}
522		}), new OpenLayersMap.Control.Zoom() ]);
523
524		// add hillshade, since this is off by default only add when we have a
525		// layerswitcher
526		m.addLayer(new OpenLayers.Layer.OSM("Hillshade", "http://toolserver.org/~cmarqu/hill/${z}/${x}/${y}.png", {
527			isBaseLayer : false,
528			transparent : true,
529			visibility : false,
530			displayOutsideMaxExtent : true,
531			attribution : '',
532			tileOptions : {
533				crossOriginKeyword : null
534			}
535		}));
536	}
537
538	return m;
539}
540
541/** init. */
542function olInit() {
543	if (olEnable) {
544		var _i = 0;
545		// create the maps in the page
546		for (_i = 0; _i < olMapData.length; _i++) {
547			olMaps[olMapData[_i].mapOpts.id] = createMap(olMapData[_i].mapOpts, olMapData[_i].poi);
548		}
549		// hide the table(s) with POI by giving it a print-only style
550		var tbls = jQuery('.olPOItableSpan');
551		for (_i = 0; _i < tbls.length; _i++) {
552			tbls[_i].className += ' olPrintOnly';
553		}
554		// hide the static map image(s) by giving it a print only style
555		var statImgs = jQuery('.olStaticMap');
556		for (_i = 0; _i < statImgs.length; _i++) {
557			statImgs[_i].className += ' olPrintOnly';
558		}
559		// add help button with toggle.
560		jQuery('.olMap').before(
561				'<div class="olMapHelpButtonDiv">'
562						+ '<button onclick="jQuery(\'.olMapHelp\').toggle(500);" class="olMapHelpButton olHasTooltip">'
563						+ '<span>' + OpenLayers.i18n("toggle_help") + '</span>?</button>' + '</div>');
564	}
565}
566
567/**
568 * ol api flag.
569 *
570 * @type {Boolean}
571 */
572var olEnable = false,
573/**
574 * An array with data for each map in the page.
575 *
576 * @type {Array}
577 */
578olMapData = [],
579/**
580 * Holds a reference to all of the maps on this page with the map's id as key.
581 * Can be used as an extension point.
582 *
583 * @type {Object}
584 */
585olMaps = new Object(),
586/**
587 * MapQuest tiles flag.
588 *
589 * @type {Boolean}
590 */
591mqEnable = false,
592/**
593 * google map api flag.
594 *
595 * @type {Boolean}
596 */
597gEnable = false,
598/**
599 * Bing tiles flag.
600 *
601 * @type {Boolean}
602 */
603bEnable = false,
604/**
605 * Bing API key.
606 *
607 * @type {String}
608 */
609bApiKey = '',
610/**
611 * OSM tiles flag.
612 *
613 * @type {Boolean}
614 */
615osmEnable = true,
616/**
617 * CSS support flag.
618 *
619 * @type {Boolean}
620 */
621olCSSEnable = true;
622
623/* register olInit to run with onload event. */
624jQuery(olInit);
625