Closed (fixed)
Project:
IP Geolocation Views & Maps
Version:
7.x-1.25
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Reporter:
Created:
6 Apr 2014 at 04:52 UTC
Updated:
14 May 2015 at 14:37 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
pyxio commentedHi,
Is there no way to achieve this? For example the default map height at 300px fills up the entire screen of a mobile phone. If I try to use percentage as a height the map disappears. I am unable to override default map height in css to use media queries because the height is added inline with js. I appreciate any advice on this. Thanks.
Comment #2
pyxio commentedI solved this problem by commenting out line 21 of ip_geoloc.module:
//define('IP_GEOLOC_MAP_DIV_DEFAULT_STYLE', 'height:300px');
and then I was able to use media queries in my css to control map height across different devices. Hope this helps somebody else. Cheers
Comment #3
pyxio commentedJust wanted to add that by commenting out that line produces the following notice....
Notice: Use of undefined constant IP_GEOLOC_MAP_DIV_DEFAULT_STYLE - assumed 'IP_GEOLOC_MAP_DIV_DEFAULT_STYLE' in ip_geoloc_plugin_style_map->render() (line 119 of /var/www/mysite/sites/all/modules/ip_geoloc/views/ip_geoloc_plugin_style_map.inc).
doesn't appear to be harmful at all.... a fix to suppress that would be nice though.
Comment #4
rdeboerNice work, drupalstrap.
Came across this accidentally, as the issue was closed by the original poster. Closed issue don't show up by default.
Reopening so that I'm reminded to look into this a bit more.
Rik
Comment #5
mr. chips commentedExactly the same thing here. Thanks drupalstrap! Note that remming out line 21 then requires you to set a height or the map won't show. I used:
for all of my media queries, just changing the height accordingly.
Comment #6
rdeboerYou can achieve drupal_strap's trick more elegantly in 7.x-1.25 not by changing code, but simply entering a space for the Map style (CSS attributes).
As Mr.Chips notes above, you then must set the height of the map through CSS in any .css file included with your theme. Otherwise the map will not show at all.
For 7.x-1.26 (7.x-1.x-dev for now) I checked in a mod that allows you to enter <none> to achieve the same effect.
See the top option in the screenshot below.
Finally, whether you specify a height or not through the IPGV&M configuration, something like this will always override it:
Rik
Comment #8
xaa commentedhi Rik, thanks for the trick. Unfortunately force the height with !important is not ok for the fullscreen mode.
Comment #9
xaa commentedadded a class .leaflet-fullscreen-on:
Comment #10
rdeboerThanks xaa. You are right.
Yes, at the time the CSS in #6 was suggested there was no fullscreen mode yet!
Comment #11
xaa commentedI notice the view ID changes everytime the view format map settings are edited.
Here is my new css to target the maps :