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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jeffschuler’s picture

Title: Zoom to Layer in OL does not work » Zoom 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...

jeffschuler’s picture

Status: Active » Needs review
FileSize
883 bytes

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..

jeffschuler’s picture

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

Pol’s picture

Status: Needs review » Reviewed & tested by the community

Working for me too.

Pol’s picture

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