I've been trying to wrap my head around this problem for some time now and
my conclusion is that google maps encoding feature has some major flaw in it
which is causing encoded polygons to not appear as they are supposed to.

This problem doesnt appear all the time, but I have noticed this problem
with different polygons i've encoded and them displaying incorrectly in
google maps v2 and v3. Below i've pasted the coordinates of a polygon which
doesnt render correctly, taken from a kml file.

<coordinates> 55.47075119150561,25.4237004693182
55.47019308665667,25.4226751566078 55.4702618765239,25.42253390861194
55.47152253316965,25.42195893822562 55.47216752167154,25.4229336283042
55.47075119150561,25.4237004693182 </coordinates>

Here is the encoded polygon code that i've generated through my php script
following google's guidelines for encoding polygons.

cqdzCecqqIjEnB\MpB{FaEaCyCzG

So to my surprise the polygon is not rendered correctly in google maps and
the problem begins from the 3rd point in the polygon. So i thought maybe my
encoded polygon's code was incorrect, so i went to googles 'Interactive
Polyline Encoder Utility' at <
http://code.google.com/apis/maps/documentation/utilities/polylineutility.html>
and pasted the code and clicked the 'decode polyline' button and it
showed
up perfectly. So i cleared the points and began pasting one point after
another into the utility to see if my php script had outputted an incorrect
encoded polygon string and sure enough, the utility gives me a javascript
error saying 'Invalid latitude entered. Must be in range of -90 to 90' when
i attempt to add the third point.

I tried <
http://facstaff.unca.edu/mcmcclur/GoogleMaps/EncodePolyline/encodeForm.html>
to have it do the encoding and it didnt get past encoding the first
point.

On another note, was looking for documentation on how to get the initial
values that is to be used when creating the encoded levels string as its not
defined at <
http://code.google.com/apis/maps/documentation/utilities/polylinealgorithm.html>.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps API V2" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-api?hl=en.

Reply via email to