I kind of hacked this together based on a prototype, so it's gone through a few different versions. I had tried to simplify things and ended up changing path from an MVCArray to just an array. It looks like that's probably my downfall, forcing me to update the polygon in order to see the changes that were made in the path.
I did that, though, because I've had some trouble getting MVCArray working correctly. I keep getting errors like this: "Invalid value for constructor parameter 0: [object Object] http://maps.gstatic.com/intl/en_us/mapfiles/api-3/22a/main.js Line 52". I'm guessing it's just syntax, but I'm not familiar enough with the MVCArray to figure it out in this context. Back to fiddling with it I suppose... Thanks for the response! On Nov 22, 7:34 pm, Ben Appleton <[email protected]> wrote: > On Sat, Nov 21, 2009 at 5:49 AM, arclyte <[email protected]> wrote: > > I'm guessing that this is a bug in my code somewhere, but I haven't > > been able to figure out where just yet. > > > Here is the sample for my current code: > >http://arclyte.netdojo.com/geo/polyDraw.php > > > If you click on the map you'll start placing markers, or you can click > > on the color box next to a polygon to load markers for that polygon > > and edit it. > > > My polygon is defined as an array of polygons, so the new (green) > > polygon is in poly[2]. If you click and add points to the polygon you > > can see that the points actually are contained within the object but > > the polygon display is not being updated. > > > I've found that if I call poly[n].setMaps(map) on the polygon I'm > > editing it will redraw and show the new/edited points. But that means > > redrawing the polygon each time... I'm afraid that won't scale very > > well if we get very large polygons. It also gives a nice flicker > > every time you draw a point which I'd rather avoid. > > I see you've tried MVCArray's .insertAt(), which notifies the polygon of a > change in its coordinates. But that code is currently commented out. Did > that not work? > > For reference, I use MVCArray's .insertAt() in this polygon editing > demo:http://gmaps-samples-v3.googlecode.com/svn/trunk/poly/poly_edit.html > > -- > > > > > You received this message because you are subscribed to the Google Groups > > "Google Maps JavaScript API v3" group. > > To post to this group, send email to > > [email protected]. > > To unsubscribe from this group, send email to > > [email protected]<google-maps-js-api-v3%[email protected]> > > . > > For more options, visit this group at > >http://groups.google.com/group/google-maps-js-api-v3?hl=. -- You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" 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-js-api-v3?hl=.
