Views GeoJSON 7.x-1.x-dev
OpenLayers 7.x-2.x-dev

Perhaps this more belongs in OL but since this module is the new kid on the block, it might need some attention here too. During my tests of this module I swapped out the traditional OL data layer way of getting GEO-data from geofield. This module works great :) but "zoom to Layer" in OL does not seems to work. The map falls back to 'Initial Map View' in OL.

Files: 
CommentFileSizeAuthor
#2 openlayers-zoomtolayer_geojson-1497166-2.patch883 bytesjeffschuler
PASSED: [[SimpleTest]]: [MySQL] 238 pass(es).
[ View ]

Comments

Title:Zoom to Layer in OL does not workZoom to Layer does not work with Views GeoJSON
Project:Views GeoJSON» OpenLayers
Version:7.x-1.x-dev» 7.x-2.x-dev

Thanks for catching this!

At a glance it looks like openlayers_behavior_zoomtolayer.js needs a new handler for GeoJSON layers.

Moving it over to the OL queue...

Status:Active» Needs review
StatusFileSize
new883 bytes
PASSED: [[SimpleTest]]: [MySQL] 238 pass(es).
[ View ]

We should be able to just do this:

-      if (layers[i].layer_handler == 'kml') {
+      if (layers[i].layer_handler == 'kml' || layers[i].layer_handler == 'geojson') {

but zoomtolayer's not working for KML either. See #1627032: Zoom to layer doesn't work anymore when layer type is KML..

This is working for me, after applying my patch in #1627032-2: Zoom to layer doesn't work anymore when layer type is KML..

Status:Needs review» Reviewed & tested by the community

Working for me too.

Status:Reviewed & tested by the community» Closed (fixed)