Operate without OpenLayers here as well

Signed-off-by: Madhura Jayaratne <madhura.cj@gmail.com>
This commit is contained in:
Madhura Jayaratne 2015-11-06 15:05:53 +11:00
parent ded3f6382d
commit 31b2e776e6
2 changed files with 7 additions and 2 deletions

View File

@ -119,6 +119,9 @@ function loadJSAndGISEditor(value, field, type, input_name, token) {
script.onload = function () {
loadGISEditor(value, field, type, input_name, token);
};
script.onerror = function() {
loadGISEditor(value, field, type, input_name, token);
}
script.src = 'js/openlayers/OpenLayers.js';
head.appendChild(script);

View File

@ -424,7 +424,8 @@ class GISVisualization
$this->init();
$scale_data = $this->_scaleDataSet($this->_data);
$output
= 'var options = {'
= 'if (typeof OpenLayers !== "undefined") {'
. 'var options = {'
. 'projection: new OpenLayers.Projection("EPSG:900913"),'
. 'displayProjection: new OpenLayers.Projection("EPSG:4326"),'
. 'units: "m",'
@ -450,7 +451,8 @@ class GISVisualization
. 'map.zoomTo(2);'
. '}'
. 'map.addControl(new OpenLayers.Control.LayerSwitcher());'
. 'map.addControl(new OpenLayers.Control.MousePosition());';
. 'map.addControl(new OpenLayers.Control.MousePosition());'
. '}';
return $output;
}