On Dec 11, 5:24 am, Erwin Quinto <
erwin.qui...@gmail.com> wrote:
> Hi,
>
> Good day everyone, on our project we are trying to render a polygon
> for each of the 80 provinces in the map. We followed the procedure on
> how to create polygons based from the version 3 api documentation.
http://code.google.com/apis/maps/documentation/v3/overlays.html#Polygons
>
> But we ran into a performance issue. Browser loads very slow when
> displaying our map.
http://philmap.000space.com/gmap-api/provinces-polygons/province-poly...
>
> Do any of you have suggestions on how to we can overcome this?
I have built a demo using PolyCluster.
http://www.polyarc.us/alotofpolys
It loads slowly because the uncompressed poly definition file is 1.1
million bytes. Performance improves once it is loaded. I plan to
remove it in one week because it is consuming too much file space.
Grab a copy now if you are interested.
I have to disagree with the Google guys about Douglas-Peucker point
reduction. It was designed for polylines not for polygons. On
already clean polys, it consumes more resources than it saves. It
also introduces errors along the common boundaries between adjacent
polys. Unless it is applied on the same set of points in the same
direction, it will produce different results. If it is applied too
aggressively, it will produce gaps and/or overlaps along the common
boundaries.
Elimination of duplicate pixels produces almost identical results
without the computational complexity. It is symmetric which means the
same points drop out in either direction. It misses a few points
along the interpolation line connecting the two immediate neighbors.
The situation is rare enough to not really matter.
CANVAS & SVG are both compiled from C++. JavaScript is interpreted.
I prefer to let the graphics engine do the point reduction. It has a
distinct speed advantage over JavaScript.