I checked your map and thanks for the link, otherwise I wouldn't have
figured it out.
There are usually one of two problems people have with encoded
polygons/lines. The first comes from a lack of understanding about
when and how to use them, the second is a JavaScript problem. Your
problem lies in the first case.
The whole point of using this encoding scheme is to limit what points
show at a particular zoom. Specifying all one character for your
encodedLevels string essentially makes the encoding less than useless
- it actually will cause poorer performance as the API has to
translate the encoded string back into useful information in order to
process the object. In your case, just sending coordinate strings
would be a better option.
I just changed your "EEEE..." encodedLevel string to "PPPP..." and it
worked fine. Still a waste of time for using an expensive and time
consuming thing but at least it works. I also suggest adding the
following two lines of code to your map to make sure you're looking at
the right thing:
var bounds = encodedPolygon.getBounds();
map.setCenter(bounds.getCenter(), map.getBoundsZoomLevel(bounds));
This will make sure your map is centered and zoomed properly, in the
chance that you didn't actually have the right encoding of your
points.
Next, I would suggest reading the following very interesting and
informative piece on using encoding with the maps:
http://facstaff.unca.edu/mcmcclur/GoogleMaps/EncodePolyline/
Mark essentially wrote the definitive article on the topic, reading it
with understanding will help you understand the reasoning behind the
encoded structure and purpose.
-John Coryat
http://maps.huge.info
http://www.usnaviguide.com
http://www.zipmaps.net
And now Android apps:
"Radar Now!"
"What Zip Code?"
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" 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
-~----------~----~----~----~------~----~------~--~---