This patch adds support for the d5 backport of the javascript compressor, allows overriding of the Google Maps API version id with a site variable, and adds a feature to load many markers without freezing up the browser interface with markerloader_chunks.js

Comments

Bevan’s picture

Title: load markers in chunks, js-compressor compatibility, override API version » load markers in chunks, js-compressor compatibility
StatusFileSize
new1.8 KB
new7.56 KB

Bdragon committed the override API version feature in http://drupal.org/cvs?commit=106525

This patch adds back & instead of & for xhtml strict validation and rerolls the patch for the other two features.

Bevan’s picture

I still need to code and patch gmap_settings_ui.inc to provide an interface for these settings, but a preliminary review would be great! :)

tom_o_t’s picture

Sorry - can't get either of the gmap.module patches to work:

Getting an error:

patch: **** malformed patch at line 59: @@ -128,6 +145,11 @@ function gmap_gmap($op, $map=null) {

Same line causes the error when using:
236029.patch on http://drupal.org/cvs?commit=106525
chunks_apiv_js.patch on http://drupal.org/cvs?commit=105462

Has anyone else managed to get it to work? I could very well just be doing my patching wrong.

tom_o_t’s picture

I hand-patched the gmap module, skipping all the drupal_add_js() changes, and everything works, except for the & change - that causes the API to revert to the most recent API, rather than the stable API. Changing it back to just & fixes this again.

Cheers for providing this patch & JS!

You can see the results in development at http://greenmap.org/dev/ogm/

Now instead of loading hundreds of nodes on the map at once with massive amounts of client-side javascript processing, the sites are added to the map one at a time every second (configurable).

bdragon’s picture

What's with all the turning off of caching in the drupal_add_js calls?

Bevan’s picture

Status: Needs review » Needs work

@tom I am hand editing one line out of the patch file which is another feature relating to location module. That may be the cause of your grief. I'll reroll with the & fix and test the patch before I upload.

@bdragon they allow for d5 js compressor support. The d5 js compressor is a bit of a hack, but is fairly popular. None of the gmap js seems to be compatible. I haven't investigated that myself in detail so I'm not sure why. However behavior shouldn't change for unhacked / regular d5 installs with those changes as they are the default parameters of drupal_add_js(), except the last parameter which is ignored in drupal 5, but was left as a placeholder for the d6 js compressor.

If you are unhappy with this change, I'll investigate wtf the precise issue is with gmap's js and the d5 js compressor.

We're using this one btw: http://drupal.org/node/149402#comment-565834

Bevan’s picture

Status: Needs work » Needs review
StatusFileSize
new7.12 KB
new7.56 KB

The numbers in the diff chunk headers also need tweaking if lines are add/removed from diff files. I've tested this applies to head correctly.

I also fixed the & in check_url() issue.

Don't forget js/markerloader_chunks.js from comment #1.

@Bdragon let me know how to proceed with the d5 js-compressor compatibility feature.

Bevan/

Bevan’s picture

Title: load markers in chunks, js-compressor compatibility » load markers in chunks, js-compressor compatibility,
StatusFileSize
new14.6 KB
new1.77 KB

This patch includes additions to the admin settings UI to adjust the chunk markerloader settings and the Google Maps API Version string.

It also has some UI tweaks for consistency of field titles.

I also changed the default map zoom and center settings to be World-centric with America centered, as per most world maps (instead of Mediterranean centric -- which makes no sense).

I reworked a part of the markermanager code to be a little clearer to read and more efficient, and added some documentation.

This patch is feature complete and IMO, pending more review and testing, is RTBC. Please let me know if you agree Bdragon, as I have a queue of other tasks and patches waiting on this being committed.

Thanks,
Bevan/

Bevan’s picture

Title: load markers in chunks, js-compressor compatibility, » load markers in chunks, js-compressor compatibility
Bevan’s picture

Version: 6.x-1.x-dev » 5.x-1.x-dev
Bevan’s picture

StatusFileSize
new670 bytes

I found the bad javascript that broke JS-compressor compatibility

bdragon’s picture

@Bevan in #11:
Independently found this one with jslint, is in CVS since 4/30, sorry about the wait.

Bevan’s picture

Title: load markers in chunks, js-compressor compatibility » load markers in chunks

js-compressor compatibility is fixed in CVS head. load marker chunks is covered in http://drupal.org/node/238872 however leaving this open in case we need to split 238872

bdragon’s picture

Bevan, I wonder how much effect http://drupal.org/cvs?commit=123684 has on mass loading speed.

Bevan’s picture

That was an issue when I was developing the chunkMarkerLoader, see the lines added to js/gmap_marker.js in http://drupal.org/files/issues/238872_4.patch from http://drupal.org/node/238872#comment-895638.

I hadn't realized that that would be adding to the time taken to add each marker, and will test loading 100 400 and 800 markers without chunkMarkerLoader. I suspect it's still necessary, although we could up the chunk_threshold.

bdragon’s picture

Also try http://drupal.org/node/272556#comment-911063 -- it should net additional speed improvements.

podarok’s picture

Status: Needs review » Closed (won't fix)

release unsupported
feel free to open issue against latest 7.x dev