After updating to latest dev version my map doesn't autozoom to the extent, that all my markers could be seen. Instead it zooms to maximum.
Before updating today everything worked fine. I do not know which kind of debugdata would be helpful for you, please advise, if you need any.

thank you

Comments

peterm95018’s picture

I'm seeing the same behavior after I updated this morning.

Peter

peterm95018’s picture

I played around with this a bit today.

At line 132 of leaflet_markercluster.drupal.js, this.map.settings.zoom has a value of 18 that I don't see getting set. I created a new view and got the same results of max zoom.

By commenting out line 132, lMap.setZoom(this.map.settings.zoom); I get the behavior I had been getting.

Peter

DerTobi75’s picture

Commenting out line 132 also works for me!

nbchip’s picture

Or u can remove "zoom" setting from your - mymap_leaflet_map_info() settings array

smussbach’s picture

Status: Active » Closed (fixed)

Works for me, thank you.

As I like to have solutions on closed reports, here's my definition with assistance of https://drupal.org/node/1858386

<?php

/**
 * Implements hook_leaflet_map_info() to return a default map.
 *
 * @return array
 */
function mymap_leaflet_map_info() {
  return array(
    'mymap map' =>
    array(
      'label' => 'OSM Mapnik mymap',
      'description' => t('Leaflet map with custom zoom settings.'),
      'settings' => array(
        'dragging' => TRUE,
        'touchZoom' => TRUE,
        'scrollWheelZoom' => TRUE,
        'doubleClickZoom' => TRUE,
        'zoomControl' => TRUE,
        'attributionControl' => TRUE,
        'trackResize' => TRUE,
        'fadeAnimation' => TRUE,
        'zoomAnimation' => TRUE,
        'closePopupOnClick' => TRUE,
        'layerControl' => FALSE,
        'maxZoom' => 18,
        //'zoom' => 14,
      ),
      'layers' => array(
        'earth' => array(
          'urlTemplate' => 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
          'options' => array(
            'attribution' => 'mymap map'
          )
        ),
      ),
    ),
  );
}
int_ua’s picture

It's on line 136 in 7.x-1.0-beta1

int_ua’s picture

smussbach, why did you mark it as closed? It wasn't fixed AFAIU.

int_ua’s picture

Priority: Normal » Major
Status: Closed (fixed) » Active
smussbach’s picture

well, actually you're right. My custom module according to nbchip did work but is more or less a workaround.

rdeboer’s picture

Status: Active » Closed (fixed)

If this is still an issue it's due to zoom being specified in either Leaflet or other module that implements hook_leaflet_map_info().