Full screen mode and switcher behavior
| Project: | GMap Module |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
This patch
* culminates preceding patches: http://drupal.org/node/238471 http://drupal.org/node/238850 http://drupal.org/node/238432 http://drupal.org/node/236029
* Adds some minor enhancements such as code style adherences, whitespace and comments.
* Uses the correct default parameters for drupal_add_js() for js-compressor compatibility.
And most importantly, adds a behavior (off by default) for the fullscreen switcher as seen on the Hub map: http://hub.witness.org/map#full-screen
There are a few more features seen on the hub map that will be integrated once this (and the requisite patches) are committed:
* logo and legend for maps
* improvements to map/node and map/user and addition of map
* support for views for nodes in map/node
| Attachment | Size |
|---|---|
| fullscreen_switcher.patch | 29.02 KB |
| full_screen.css_.txt | 1.02 KB |
| full_screen.js_.txt | 6.09 KB |

#1
This patch includes changes from the other patches, such as fixed js/poly.js to support the d5 backport of the d6 javascript compressor, consistent file endings of javascript files, improved documentation and code style, a notice for browsers with js disabled.
Newest versions of all new files are also attached.
#2
I just updated the forked version of gmap module for the hub. Use this patch file instead of the above attached on on head as of uploading this file
#3
Bevan:
Please review the need to exclude files from the compressor again. I believe I have fixed most/all the bugs preventing compression from working.
#4
Rerolled for head, includes a few bugfixes on new code in other patches, include a rewrite fo the fix for double clicks on location picker so taht single and double clicks are dealt with alike.
Also introduces a node locations block, and different titles for all gmap_location blocks to better recall which block is what.
I refactored hook_block to be more maintainable too.
#5
Rerolled for head, with a few new features/changes:
function theme_gmap_script()to change how and where the<script/>tag for the GMap API is printed. This is useful if the theme has moved<?php print $scripts; ?>out of<head/>and into<body/>inpage.tpl.php-- which is a page-load-time enhancement technique.function zen_gmap_map_script()to render map data inDrupal.settingsdirectly, instead of by extendingDrupal.settingsinline.<p/>elements infunction theme_gmap_location_node_page().function gmap_location_block()(an implementation ofhook_block()) to use string keys for block delta's, instead of integer keys. This improves the readability of the code.function gmap_location_block()to use switch-case constructs instead of long if-else-if constructs in the configure, save and view operations.nodes_map, a map of all nodes on the site.$form['initialization']['gmap_load_zoom_plugin']['#description']and improved the usefulness of the help text.Example theme functions to override
theme_gmap_map_script()andtheme_gmap_script()for said purposes in zen or a zen subtheme:<?php
/**
* Override theme_gmap_script() for storing gmap's external <script> element that
* normally goes in <head> but instead needs to go in <body>.
*/
function zen_gmap_script($version = NULL, $key = NULL) {
static $script;
if ($version and $key) {
// Store the script and return empty string if called with parameters.
$script = theme_gmap_script($version, $key);
return '';
}
else {
// Otherwise return the stored script.
return $script;
}
}
/**
* Override theme_gmap_map_script() to render maps in Drupal.settings instead of inline.
*/
function zen_gmap_map_script($id, $map) {
drupal_add_js(array('gmap' => array($id => $map)), 'setting');
return '';
}
?>
#6
I rerolled for head with some new enhancements and bug fixes, on critical;
define('GMAP_WMS', variable_get('gmap_wms', 0));results in REALLY slow loads of admin/settings/gmap because variables aren't ready at that point in execution. Argh!define()is for constants only. And NOT anything returned by a function, event()orvariable_*(), because the static variables these functions depend on are not properly initialized when modules are included. A constant is a primitive literal, such as'I am a string',42,3.142andTRUE.maptype) is not being stored, merged or recalled consistently. The effect is that changes are 'forgotten'. They are stored in{variables}table, but#default_valueis not set, andgmap_defaults()wasn't consistent. I fixed that issue in this new patch, but did not fix the fact thatgmap.jsdoesn't do anything with the value. In other words, google's default, 'Map' orG_NORMAL_MAPis always loaded, regardless of the setting ofmaptype/ "Default map type".gmap_defaults()to allow for easier debugging.This patch is now growing faster than it's shrinking, or in other words; Our fork of gmap module is getting further from gmap module faster than it is merging. It would be good to get more of this patch committed quicker, and feedback as to what's NOT committable and why.
#7
This one fixes the maptype bug properly and fully, and also implements support for gmap_locations ahah callbacks for marker info-windows in gmap_views.
#8
Hi Bevan,
I've applied the patch above to a fresh install of the latest 5.x-1.x-dev release but get the following errors about missing marker .png files when going to the admin screen:
* warning: getimagesize(sites/all/modules/gmap/markers/small/black.png) [function.getimagesize]: failed to open stream: No such file or directory in /drupal/site/sites/all/modules/gmap/gmap_markerinfo.inc on line 91.* warning: getimagesize(sites/all/modules/gmap/markers/small/bpink.png) [function.getimagesize]: failed to open stream: No such file or directory in /drupal/site/sites/all/modules/gmap/gmap_markerinfo.inc on line 91.
* warning: getimagesize(sites/all/modules/gmap/markers/small/bred.png) [function.getimagesize]: failed to open stream: No such file or directory in /drupal/site/sites/all/modules/gmap/gmap_markerinfo.inc on line 91.
* warning: getimagesize(sites/all/modules/gmap/markers/small/brown.png) [function.getimagesize]: failed to open stream: No such file or directory in /drupal/site/sites/all/modules/gmap/gmap_markerinfo.inc on line 91.
* warning: getimagesize(sites/all/modules/gmap/markers/small/dblue.png) [function.getimagesize]: failed to open stream: No such file or directory in /drupal/site/sites/all/modules/gmap/gmap_markerinfo.inc on line 91.
* warning: getimagesize(sites/all/modules/gmap/markers/small/dgreen.png) [function.getimagesize]: failed to open stream: No such file or directory in /drupal/site/sites/all/modules/gmap/gmap_markerinfo.inc on line 91.
* warning: getimagesize(sites/all/modules/gmap/markers/small/fgreen.png) [function.getimagesize]: failed to open stream: No such file or directory in /drupal/site/sites/all/modules/gmap/gmap_markerinfo.inc on line 91.
* warning: getimagesize(sites/all/modules/gmap/markers/small/gray.png) [function.getimagesize]: failed to open stream: No such file or directory in /drupal/site/sites/all/modules/gmap/gmap_markerinfo.inc on line 91.
* warning: getimagesize(sites/all/modules/gmap/markers/small/green.png) [function.getimagesize]: failed to open stream: No such file or directory in /drupal/site/sites/all/modules/gmap/gmap_markerinfo.inc on line 91.
* warning: getimagesize(sites/all/modules/gmap/markers/small/lblue.png) [function.getimagesize]: failed to open stream: No such file or directory in /drupal/site/sites/all/modules/gmap/gmap_markerinfo.inc on line 91.
* warning: getimagesize(sites/all/modules/gmap/markers/small/lgray.png) [function.getimagesize]: failed to open stream: No such file or directory in /drupal/site/sites/all/modules/gmap/gmap_markerinfo.inc on line 91.
* warning: getimagesize(sites/all/modules/gmap/markers/small/orange.png) [function.getimagesize]: failed to open stream: No such file or directory in /drupal/site/sites/all/modules/gmap/gmap_markerinfo.inc on line 91.
* warning: getimagesize(sites/all/modules/gmap/markers/small/pblue.png) [function.getimagesize]: failed to open stream: No such file or directory in /drupal/site/sites/all/modules/gmap/gmap_markerinfo.inc on line 91.
* warning: getimagesize(sites/all/modules/gmap/markers/small/pgreen.png) [function.getimagesize]: failed to open stream: No such file or directory in /drupal/site/sites/all/modules/gmap/gmap_markerinfo.inc on line 91.
* warning: getimagesize(sites/all/modules/gmap/markers/small/pyellow.png) [function.getimagesize]: failed to open stream: No such file or directory in /drupal/site/sites/all/modules/gmap/gmap_markerinfo.inc on line 91.
* warning: getimagesize(sites/all/modules/gmap/markers/small/pink.png) [function.getimagesize]: failed to open stream: No such file or directory in /drupal/site/sites/all/modules/gmap/gmap_markerinfo.inc on line 91.
* warning: getimagesize(sites/all/modules/gmap/markers/small/purple.png) [function.getimagesize]: failed to open stream: No such file or directory in /drupal/site/sites/all/modules/gmap/gmap_markerinfo.inc on line 91.
* warning: getimagesize(sites/all/modules/gmap/markers/small/white.png) [function.getimagesize]: failed to open stream: No such file or directory in /drupal/site/sites/all/modules/gmap/gmap_markerinfo.inc on line 91.
* warning: getimagesize(sites/all/modules/gmap/markers/small/yellow.png) [function.getimagesize]: failed to open stream: No such file or directory in /drupal/site/sites/all/modules/gmap/gmap_markerinfo.inc on line 91.
#9
You'll need to download the zip and add the respective files. This was included in an earlier comment, but I just realized is out of date, so use the attached one here.
#10
Hi Bevan,
Thanks for the speedy response. Those newfiles did the trick, I now have a working FullScreen button on my node map, user map and also a views map. The errors I reported before about missing files have gone away.
I still have a problem with displaying a map on a node but I suspect thats nothing to do with this patch.(FIXED)Regards,
Jason
#11
Sorry, I haven't been following this as closely as I should. :(
It's on my todo list now.
#12
@jasontanner, glad it's useful for someone else too! Let me know (on this thread) if you have any issues.
#13
I coulda sworn I had nuked that define already...
Oh well, it's gone now. Thanks.
#14
The default map type interface bug is now fixed as well.
#15
Cool! I don't think I'll have a chance to reroll for 3 or 4 weeks, but a review of other changes in this patch would be great!
#16
I'm in the process of re-rolling this for D6. I have it basically working but am undecided yet whether I should also try to include the gmap_location changes.
e.g the node locations map, node location map and author location map changes mentioned above.
Attached is what I have so far, but its not in patch format - its a tar.gz of my gmap module folder.
#17
#18
Jason, This (my) patch includes many other changes to gmap module, so rerolling the whole patch for the drupal 6 branch is more work than necesary. Also, please submit unified diff patches; See http://drupal.org/patch/create
#19
Hi,
I'm not sure what you mean by "rerolling the whole patch for the D6 branch being more work than necessary" - I think I only did what was needed to get your changes to work in D6.
I'll be happy to submit a proper patch, I'll try to get that done in the next day or so.
#20
Ok, here is the patch file - against the HEAD version of gmap. I think HEAD is the D6 Port .. couldn't see a D6 branch or version.
I ended up having to use Eclipse (after following the instructions on drupal.org) to create the patch. For some reason, the cvs command hangs on my linux box.
#21
Meanwhile, I rerolled this for DRUPAL-5. Brandon, I replied to one of your comments in the code.
What's the standard for getting html snippets and text strings client-side for use by DOM-manipulating javascript? map's #settings doesn't always make sense because test strings apply to all maps on a page, and duplicating it is redundant and asking for problems when we set it twice. Also, I'm not sure how I'd find a map setting clientside?
I tested markerloader_static.js with ~1200 markers and it loaded within a several seconds (barely acceptable) on a MacBook Pro, 4Gb Ram, OS X Leopard, FF3. I didn't benchmark this against the version that centered the map after each addmarker event, but I know from memory that performance has improved about 10-fold with this change, making the chunkMarkerLoader near-redundant, and mostly useful for the animation factor. I've adjusted the default chunk markerloader settings accordingly in this patch. I also reverted the markers that already existed, hence the new zip file with new files too.
#22
Subscribing, will this patch be committed?
Greetings,
Martijn
#23
Summit, I don't expect so. I'm currently waiting for funding/time to be able to contribute these features to d.o as a 3rd party 'bonus features' module instead.
#24
subscribing