Closed (duplicate)
Project:
Leaflet
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
22 Aug 2012 at 21:56 UTC
Updated:
17 Aug 2015 at 05:38 UTC
Jump to comment: Most recent
I'm not sure if it is the intended behavior, but I noticed when you have a view with a leaflet map display that doesn't contain any results the map still shows up with a grey background.
Should it instead display the Empty Result property from the view? or not display at all?
Comments
Comment #1
mgiffordI'm getting an empty display in 7.x-2.x-dev but not sure why. I'm not sure that's the ideal response to no active results. Better than a grey background mind you.
Comment #2
smussbach commentedI am getting an grey map with controls when displaying no results. I wold be grateful, if it would display empty result from views. Am I missing something?
Latest dev leaflet
Latest dev leaflet_markercluster
Comment #3
dasjoyour map definition might need to provide a default center + zoom level for such cases
here's an example: http://drupalcode.org/project/geocluster.git/blob/refs/tags/7.x-1.0-alph...
Comment #4
smussbach commentedThank you very much dasjo for your help. It gave me a valuable insight how the module works.
Anyhow I seem to be missing something, as I can use my custom module with the defaults set but I receive a grey map anyways. Unfortunately I do not have the possibility (say budget) to figure it out and get it working, I had to just hide the map in case of no results. I might try it later on.
Comment #5
cojomojo commentedDid anyone ever figure the cause of this issue? I am experiencing the same thing.
Comment #6
back from 7 commentedI think I figured out the issue. If you add width property to the map it solves the tile grey issue...
This is what fixed it for me:
div#leaflet-map {
width: 100%;
}
Comment #7
back from 7 commentedEdit: #6 didn't fix the issue...
Comment #8
andlpd commentedThe problem seems to be at map generation in javascript.
If the "features" array is empty, the map tiles are not generated. That means no CSS solution will be able to fix this.
Comment #9
kundu commentedSame problem here. Any news about it? Strangely, when I click on inspect element, on Chrome i can see the map.
Comment #10
adamps commentedI found that the patch in #1944096: Show empty views when no results. https://www.drupal.org/node/1944096#comment-9180677 solves this problem.
Comment #11
mgiffordWorth expanding the title for #1944096: Show empty views when no results. and declaring this one a duplicate?
Comment #12
kaido.toomingas commentedAdd default map center and there will be no empty div. I guess it would be nice to add this option to leaflet module. This will take effect whenever you would like to add default center to map.
Quickfix for me was:
Comment #13
mgifford@kaido24 - can you write up a patch for that?
Comment #14
jlongbottom commented#12 worked for me
would be nice if this was a setting in the View configuration options
Comment #15
rdeboerMight be fixed with the patch of #1944096: Show empty views when no results. that was applied today?
Rik