Initial zoom setting seems not work and blank the leaflet map in node view. My settings map: OSM Mapnik, initial zoom: 14, minimum and maximum zoom: use map defined setting. Below is the map I get.
blank map

I checked the network monitor tab in Firebug, it turned out that the browser tried to retrieve the zoom level 18 tiles instead of 14 which I set as initial zoom level. Below is a snapshot from Firebug:
firebug network tab

And I changed the max zoom level to a fixed level like 17, the browser tried to retrieve zoom level 17 tiles. Whether or not the tiles are retrieved successfully by the browser, I always got the almost blank map. And the zoom control won't work.

However, if I configure a pop-up and click the marker to bring up the pop-up. The map is shown well and complete with correct initial zoom level.

Wonder if anyone encounters this bug and knows how to deal with it.

PS. This is just for the node. Just checked this in a view, there was no such a problem.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

passengerabcd’s picture

Issue summary: View changes
passengerabcd’s picture

Issue summary: View changes
passengerabcd’s picture

Issue summary: View changes
passengerabcd’s picture

Did more testings and found out that initial zoom setting doesn't work for 14 or higher zoom level. Tested on default OSM tiles and Bing map. Strange.

passengerabcd’s picture

Issue summary: View changes
fultonchain’s picture

I can replicate this on the OSM and Google hybrid maps (haven't tried Bing). Zoom levels >14 prevent the map from rendering on load.

peterm95018’s picture

I'm +1 with this issue as well. Zoom levels less than 14 allow the map and zoom controls to render.

stefan.korn’s picture

I can confirm same issue here, zoom levels >= 14 do not render (or only partially).

stefan.korn’s picture

I have downgraded the leaflet library from version 0.7.3 to 0.6.4 and now the maps do render for initial zoom level >= 14 as well.

PrineShazar’s picture

Thanks stefan.korn, would be good to possibly log this with Leaflet. I'll do that when i get some time. #9 worked for me

AlfTheCat’s picture

Having this issue too. Thank god I found this thread, would have never figured it out.

marcvangend’s picture

Same problem here. I can confirm that going back to Leaflet 0.6.4 solves the problem.

michaelmallett’s picture

Have the same issue inside a panel.

RdeBoer’s picture

Possibly related to #2366987: Leaflet + Leaflet Markercluster and zoom levels whose patch was applied.
Not sure.

wak’s picture

Same problem here, even within a view.

RdeBoer’s picture

@marcvangend, @michaelmallett, @wak

So have you all reverted to Leaflet JS 0.6.4 and the problem has gone away?

And this is happening in a View display when there is only 1 marker to show, at zoom levels of 14 or higher?

Rik

marcvangend’s picture

@rdeboer yes, I reverted to Leaflet JS 0.6.4.

If I recall correctly (not 100% sure, it was 4 months ago :-)) I was using the leaflet field formatter, showing a single point stored in a geofield.

sja1’s picture

FileSize
15.8 KB

I just upgraded my leaflet library, and had the same problem with a google map being displayed as a panel pane. I noticed in the configuration popup for the map that the google map now has a zoom range of 0..21, when before the upgrade it was 0..18. (see screen capture)

Inside the zoom settings for the map, I had the initial zoom level field set to "use map defined setting". I switched this to 18 (which by the way is the highest number allowed currently by the module), and my maps started showing correctly again.

Could perhaps the problem be caused by the change in the zoom ranges defined by the leaflet library?

indigoxela’s picture

Hi sja1,
welcome to our mystery tour ;)

I only realized this problem with OSM Mapnik.
Values between 1 and 13 rendered just fine, zoom level 18 also rendered fine.

The problem seemed to occur only with 14, 15, 16 and 17.

Clicking on the marker of such a half-rendered map "repaired" everything. I tried different versions of Leaflet JS but that didn't fix it for me.

I just saw that a new version (beta) of Leaflet js is available: Leaflet 1.0 beta 1, released on July 14, 2015.
And with this version all initial zoom levels work perfectly.

Caution: Library version detection of leaflet module won't work with this beta.
Open leaflet.js with a text editor and somewhere in the comment add:
version="1.0.0"

Has anybody else tried 1.0 beta 1 yet?

RdeBoer’s picture

@indigoxela,

Thanks for your report. No haven't tried Leaflet JS 1.0 Beta yet.
I read in the release notes that there are API changes, which scared me a little, but looks like you've found few problems. In fact, you've found a FIX !
Rik

gifad’s picture

Issue seems to be fixed in Leaflet 0.7.5 as well;
Using it for a week, and everything works as designed ;)

RdeBoer’s picture

Title: Initial zoom setting does not work and blanks the leaflet map in node view » Initial zoom setting does not work and blanks the leaflet map in node view: use Leaflet JS 0.7.5 or 1.0.0
Assigned: Unassigned » RdeBoer
Status: Active » Fixed

Thanks for sharing @gifad !
Consider this fixed until proven otherwise.
Rik

indigoxela’s picture

Issue seems to be fixed in Leaflet 0.7.5 as well;

I can confirm that. Initial zoom levels above 13 work fine with 0.7.5 (updated on Sep 2, 2015).

marcvangend’s picture

Thanks for testing and reporting back!

shevgeny’s picture

Status: Fixed » Needs work

Cool! But now is not working: "Auto-box to fit all markers"

shevgeny’s picture

Rather, it works, but not as much as before, does not always work. Especially if you open several cards on one page by ajax (AutoDialog module)
demonstration — https://youtu.be/Imav8VfdmC8