My polygons have even more points (from 1,000 to 300,000). I have a Windows application using a WebBrowser Control (I.E behind scene) to show the map. That means I don't even have a choice of the Browser.
Just like people posted here. It is way too slow. Even a simple zoom, it redraw the polygon again (very slowly of course). I am wondering is there other way to put the polygons on the map. How the streets on the map works? Yes, map tiles. How can I do that? On Jun 16, 7:45 pm, jlivni <[email protected]> wrote: > One way to work around the issue of sending extra data over the wire > (and oddly, at first glance to save a bit of time on creating the > individual lat/lng points though I haven't actually time tested this) > is to just create the GPolygon.fromEncoded like before, but instead of > adding it as an overlay, make a simple little function to then create > a newpolygonfrom that one by pushing each vertex into a points list, > eg: > > poly_from_encoded_poly_vertices : function(poly){ > var pts = []; > for (var i=0; i < poly.getVertexCount(); i++){ > pts.push(poly.getVertex(i)); > } > return new GPolygon(pts, "#f33f00", 5, 1); > }, > > Though obviously simplying yourpolygonfirst is probably a good idea > as well -- 1500 vertices will definitely beslowin IE. > > Cheers, > > -Josh > > On May 12, 2:14 am, "Alex (cp9)" <[email protected]> wrote: > > > > > Hi all, > > > i've a big Speed Problem with redrawing / setFillStyles on > > GPolygons.fromEncoded. > > > I'am adding GPolygons via addOverlay(polygon) to theGoogleMap. > > The Polygons were created by using GPolygon.fromEncoded(); to speed up > >polygon/polyline creation by creating them on the server. > > > I registered a mouseover event listener on thepolygon(s), to change > > the color if you enter thepolygonwith the mousepointer. > > > .... > > GEvent.addListener(polygon, "mouseover", function(){ > > this.setFillStyle({color:'#FF0000']);}); > > > ... > > > On the mouseout event i set the fillstyle to the origin style. So if > > the mousepointer enter thepolygon, it will change his color. > > > Changing the color works, but is veryslowfor big polygons. > > The polyline contains about 1500 points. They are encoded by the > > server. > > > Calling setFillstyle on thispolygon, lets thepolygondisappear and > > than it is shown with the new fill color. But from disappearing until > > redraw there is a lag from about 1 second. - which is very very much. > > If you move the mouse from onepolygonto another than both will > > disappear than one will appear with its origin fillcolor (mouseout) > > and than the otherpolygonappears with his new hover Color > > (onmouseover). This looks very very bad. > > > This was very very quick without any recognizable lag when you use > > GPolygon without fromEncoded. But than thePolygonneeds to load very > > long on first time. Because the data to send for aPolygonwith 1500 > > Points is about 10 times bigger if it is not encoded. And on the > > client side you have to create GPoints for all the 1500 Points to > > create the GPolyline. This needs long time. > > > I hope someone can help me to solve this problem. I already searched > > for a solution for a few days, but did not find anything. > > > Thank you very much > > > Alex (cp9) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
