Loading includes/openlayers.default_openlayers_components.inc +16 −7 Original line number Diff line number Diff line Loading @@ -37,12 +37,21 @@ function openlayers_default_openlayers_components() { $ol_component->factory_service = 'openlayers.Component:InlineJS'; $ol_component->options = array( 'javascript' => 'data.map.on(\'click\', function(evt){ if (ol.hasOwnProperty(\'animation\')) { // Deprecated in v3.20.0 - map.beforeRender() and ol.animation functions var pan = ol.animation.pan({ duration: 2000, source: (data.map.getView().getCenter()) }); data.map.beforeRender(pan); data.map.getView().setCenter(evt.coordinate); } else { // Introduced in v3.20.0 - view.animate() instead of map.beforeRender() and ol.animation functions data.map.getView().animate({ center: evt.coordinate, duration: 2000 }); } });', ); $export['openlayers_component_map_edit_form_setcenter'] = $ol_component; Loading modules/openlayers_cesium/src/Plugin/Control/OL3CesiumControl/js/OL3CesiumControl1.js +9 −1 Original line number Diff line number Diff line Loading @@ -29,7 +29,15 @@ ol.control.OL3CesiumControl = function(opt_options, map) { this.options = options; this.button = button; }; if (ol.hasOwnProperty('inherits')) { // Deprecated in v6.0.0 - ol.inherits function. ol.inherits(ol.control.OL3CesiumControl, ol.control.Control); } else { // Introduced in v6.0.0 - replace with ECMAScript classes. ol.control.OL3CesiumControl.prototype = Object.create(ol.control.Control.prototype); ol.control.OL3CesiumControl.prototype.constructor = ol.control.OL3CesiumControl; } /** * @param {event} event Browser event. Loading modules/openlayers_geofield/src/Plugin/Control/Geofield/js/geofieldControl.js +9 −1 Original line number Diff line number Diff line Loading @@ -239,7 +239,15 @@ ol.control.Geofield = function(opt_options) { target: options.target }); }; if (ol.hasOwnProperty('inherits')) { // Deprecated in v6.0.0 - ol.inherits function. ol.inherits(ol.control.Geofield, ol.control.Control); } else { // Introduced in v6.0.0 - replace with ECMAScript classes. ol.control.Geofield.prototype = Object.create(ol.control.Control.prototype); ol.control.Geofield.prototype.constructor = ol.control.Geofield; } ol.control.Geofield.prototype.handleDrawClick_ = function(event) { var options = this.options; Loading modules/openlayers_library/src/Plugin/Component/Geolocation/js/geolocation.js +23 −13 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ Drupal.openlayers.pluginManager.register({ jQuery('#' + data.opt.headingID).val(geolocation.getHeading() + ' [rad]'); jQuery('#' + data.opt.speedID).val(geolocation.getSpeed() + ' [m/s]'); if (ol.hasOwnProperty('animation')) { // Deprecated in v3.20.0 - map.beforeRender() and ol.animation functions var pan = ol.animation.pan({ duration: 2000, source: map.getView().getCenter() Loading @@ -32,6 +34,14 @@ Drupal.openlayers.pluginManager.register({ map.beforeRender(pan, zoom); map.getView().setCenter(geolocation.getPosition()); map.getView().setZoom(7); } else { // Introduced in v3.20.0 - view.animate() instead of map.beforeRender() and ol.animation functions // TODO - need to complete this section map.getView().animate({ zoom: zoom, duration: data.opt.animations.zoom }); } }); geolocation.on('error', function(error) { Loading modules/openlayers_library/src/Plugin/Component/IconSprites/js/iconsprites.js +10 −5 Original line number Diff line number Diff line Loading @@ -98,11 +98,16 @@ Drupal.openlayers.pluginManager.register({ 'Hold on a second, while I catch those butterflies for you ...'; window.setTimeout(function() { var features = []; map.forEachFeatureAtPixel(evt.pixel, function(feature, layer) { features.push(features); return false; if ('getFeaturesAtPixel' in map) { // Introduced in v4.3.0 - new map.getFeaturesAtPixel() method. var features = map.getFeaturesAtPixel(evt.pixel); } else { // Replaced in v4.3.0 - forEachFeatureAtPixel() method replaced. features = []; map.forEachFeatureAtPixel(evt.pixel, function(feature) { features.push(feature); }); } if (features.length === 1) { info.innerHTML = 'Got one butterfly'; Loading Loading
includes/openlayers.default_openlayers_components.inc +16 −7 Original line number Diff line number Diff line Loading @@ -37,12 +37,21 @@ function openlayers_default_openlayers_components() { $ol_component->factory_service = 'openlayers.Component:InlineJS'; $ol_component->options = array( 'javascript' => 'data.map.on(\'click\', function(evt){ if (ol.hasOwnProperty(\'animation\')) { // Deprecated in v3.20.0 - map.beforeRender() and ol.animation functions var pan = ol.animation.pan({ duration: 2000, source: (data.map.getView().getCenter()) }); data.map.beforeRender(pan); data.map.getView().setCenter(evt.coordinate); } else { // Introduced in v3.20.0 - view.animate() instead of map.beforeRender() and ol.animation functions data.map.getView().animate({ center: evt.coordinate, duration: 2000 }); } });', ); $export['openlayers_component_map_edit_form_setcenter'] = $ol_component; Loading
modules/openlayers_cesium/src/Plugin/Control/OL3CesiumControl/js/OL3CesiumControl1.js +9 −1 Original line number Diff line number Diff line Loading @@ -29,7 +29,15 @@ ol.control.OL3CesiumControl = function(opt_options, map) { this.options = options; this.button = button; }; if (ol.hasOwnProperty('inherits')) { // Deprecated in v6.0.0 - ol.inherits function. ol.inherits(ol.control.OL3CesiumControl, ol.control.Control); } else { // Introduced in v6.0.0 - replace with ECMAScript classes. ol.control.OL3CesiumControl.prototype = Object.create(ol.control.Control.prototype); ol.control.OL3CesiumControl.prototype.constructor = ol.control.OL3CesiumControl; } /** * @param {event} event Browser event. Loading
modules/openlayers_geofield/src/Plugin/Control/Geofield/js/geofieldControl.js +9 −1 Original line number Diff line number Diff line Loading @@ -239,7 +239,15 @@ ol.control.Geofield = function(opt_options) { target: options.target }); }; if (ol.hasOwnProperty('inherits')) { // Deprecated in v6.0.0 - ol.inherits function. ol.inherits(ol.control.Geofield, ol.control.Control); } else { // Introduced in v6.0.0 - replace with ECMAScript classes. ol.control.Geofield.prototype = Object.create(ol.control.Control.prototype); ol.control.Geofield.prototype.constructor = ol.control.Geofield; } ol.control.Geofield.prototype.handleDrawClick_ = function(event) { var options = this.options; Loading
modules/openlayers_library/src/Plugin/Component/Geolocation/js/geolocation.js +23 −13 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ Drupal.openlayers.pluginManager.register({ jQuery('#' + data.opt.headingID).val(geolocation.getHeading() + ' [rad]'); jQuery('#' + data.opt.speedID).val(geolocation.getSpeed() + ' [m/s]'); if (ol.hasOwnProperty('animation')) { // Deprecated in v3.20.0 - map.beforeRender() and ol.animation functions var pan = ol.animation.pan({ duration: 2000, source: map.getView().getCenter() Loading @@ -32,6 +34,14 @@ Drupal.openlayers.pluginManager.register({ map.beforeRender(pan, zoom); map.getView().setCenter(geolocation.getPosition()); map.getView().setZoom(7); } else { // Introduced in v3.20.0 - view.animate() instead of map.beforeRender() and ol.animation functions // TODO - need to complete this section map.getView().animate({ zoom: zoom, duration: data.opt.animations.zoom }); } }); geolocation.on('error', function(error) { Loading
modules/openlayers_library/src/Plugin/Component/IconSprites/js/iconsprites.js +10 −5 Original line number Diff line number Diff line Loading @@ -98,11 +98,16 @@ Drupal.openlayers.pluginManager.register({ 'Hold on a second, while I catch those butterflies for you ...'; window.setTimeout(function() { var features = []; map.forEachFeatureAtPixel(evt.pixel, function(feature, layer) { features.push(features); return false; if ('getFeaturesAtPixel' in map) { // Introduced in v4.3.0 - new map.getFeaturesAtPixel() method. var features = map.getFeaturesAtPixel(evt.pixel); } else { // Replaced in v4.3.0 - forEachFeatureAtPixel() method replaced. features = []; map.forEachFeatureAtPixel(evt.pixel, function(feature) { features.push(feature); }); } if (features.length === 1) { info.innerHTML = 'Got one butterfly'; Loading