Essential functionality may require additional google maps libraries:

1. encoding : polyline/polygon encoding and decoding is now handled inside the geometry library. This functionality is used inside the gmaps_shapes.js code.

https://developers.google.com/maps/documentation/javascript/libraries

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jaxxed’s picture

Priority: Major » Normal
FileSize
855 bytes

Here is a patch to the gmap module that allows inclusion of google.maps libraries.

1. Insert libraries into googleapi call, which can come from 1 of 2 places:
variable_get('gmap_api_libraries',array())
gmap_module_invoke('libraries', $m)
2. inserted 'geometry' as a default library.
This relates to another patch of mine that updates te shapes library. If you want to use google api with encoded shapes such as lines or polygons that are encoded and ecoded at the JS level, then you'll need this library. There is an alternative option to use a custom encoding and decoding function set.

I don't know what priority this should be.

jaxxed’s picture

Status: Active » Needs review
jaxxed’s picture

Assigned: jaxxed » Unassigned
podarok’s picture

Status: Needs review » Fixed

#1 commited pushed to 7.x-2.x
thanks!!!

podarok’s picture

tagged new beta release http://drupal.org/node/1987146

podarok’s picture

tagged new beta release http://drupal.org/node/1987146

jaxxed’s picture

Pods: will you backport that to the 6.x line?

podarok’s picture

re #7 if anyone create patch against 6.x-2.x-dev

jaxxed’s picture

do I just need to put the same patch, but applied to the d6 stuff? I can do that.

podarok’s picture

re #9
yup, with proper statuses )))

jaxxed’s picture

Hey Pods, Is there a preferred method for warnings generated (at the javascript layer) for if a google.maps library is being called, but hasn't been loaded.

Unfortunately there is no lazy/late loading of the libraries, and each implementation will have to first check to see if the library namespace exists before using it. What reporting method would you prefer to use (right now the shapes library will silently fail if the library isn't loaded.)

jaxxed’s picture

Version: 7.x-2.x-dev » 6.x-2.x-dev
Status: Fixed » Needs review
FileSize
822 bytes

backported to 6.x-2.x

podarok’s picture

Status: Needs review » Needs work
+++ b/gmap.moduleundefined
@@ -166,6 +166,8 @@ function gmap_gmap($op, &$map) {
+      return array( 'geometry' );

return array( 'geometry' );
No need for whitespaces
http://drupal.org/coding-standards#array

+++ b/gmap.moduleundefined
@@ -324,6 +326,7 @@ drupal_add_js($gmap_path . '/js/poly.js');
+    'libraries' => implode(array_merge((array)variable_get('gmap_api_libraries',array()),gmap_module_invoke('libraries', $m)),','),

No need for (array) conversion
), g
not ),g
everywhere

jaxxed’s picture

Version: 6.x-2.x-dev » 7.x-2.x-dev
FileSize
943 bytes

formatting fixed (this is 7.x. 6.x patch is ready when you ask for it.)

jaxxed’s picture

Status: Needs work » Needs review
podarok’s picture

Status: Needs review » Fixed

#14 commited pushed to 7.x-2.x-dev
thanks!!!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.