I was looking at the GMap array examples in API.txt and noticed there are two errors. Both issues have to do with the second example, titled, "a more elaborate example". First, the shapes array is missing a parenthesis. It is shown like this in API.txt:
'shapes' => array(
array(
'type' => "polygon",
'style' => array("000000", 3, 25, "ffff00", 45),
'points' => array(
array(43.667871610117494,-70.675048828125),
array(43.43696596521823,-70.0927734375),
array(43.9058083561574,-69.202880859375),
array(44.512176171071054,-69.796142578125),
array(43.667871610117494,-70.675048828125),
),
array(
'type' => "circle",
'style' => array("000000", 3, 25, "ffff00", 45),
'radius' => 0.7622248729082767,
'center' => array(39.3739522204, -81.5681648254),
),
),
And instead, it should be like this:
'shapes' => array(
array(
'type' => "polygon",
'style' => array("000000", 3, 25, "ffff00", 45),
'points' => array(
array(43.667871610117494,-70.675048828125),
array(43.43696596521823,-70.0927734375),
array(43.9058083561574,-69.202880859375),
array(44.512176171071054,-69.796142578125),
array(43.667871610117494,-70.675048828125),
), // *** NEED TO ADD A PARENTHESIS HERE FOR THIS TO WORK ***
),
array(
'type' => "circle",
'style' => array("000000", 3, 25, "ffff00", 45),
'radius' => 0.7622248729082767,
'center' => array(39.3739522204, -81.5681648254),
),
),
The second issue with the "more elaborate example" will cause a JavaScript error to pop up that states, "Request for invalid marker set Light Blue", and the marker will not be displayed on the map. This is because the array is missing an offset value. Not having an offset value will cause this error to appear. So, the affected section of the array in the documentation looks like this:
'markers' => array(
array(
'text' => 'First Marker',
'longitude' => 39.3739522204,
'latitude' => -81.5681648254,
'markername' => "Light Blue",
),
array(
'text' => 'Second Marker',
'longitude' => 44.205835001,
'latitude' => -70.3674316406,
'markername' => "Orange",
),
And instead, it needs to look like this:
'markers' => array(
array(
'text' => 'First Marker',
'longitude' => 39.3739522204,
'latitude' => -81.5681648254,
'markername' => "Light Blue",
'offset' => 1, // *** NEED TO ADD THIS LINE TO AVOID JAVASCRIPT ERROR ***
),
array(
'text' => 'Second Marker',
'longitude' => 44.205835001,
'latitude' => -70.3674316406,
'markername' => "Orange",
'offset' => 1, // *** NEED TO ADD THIS LINE TO AVOID JAVASCRIPT ERROR ***
),
Please update the original documentation with these changes when possible. Thanks.
Comments
Comment #1
bdragon commentedActually, the js problem is that "light blue" is not a valid markername, it's actually "lblue".
Fixes committed to the advanced help doc, and API.txt removed from the drupal 5 branch (I forgot to do this when I moved the contents to the advanced help, apparently.)
http://drupal.org/cvs?commit=183078
http://drupal.org/cvs?commit=183080
Comment #2
sgdev commentedJust so you're aware, I tried it with "green" and "orange" and other options besides light blue, and got the same error message.