YES YES TES
Marcelo, thanks a lot.
I've tried your manip and you're right ! I had a "poly setfillstyle:
Europe"
log although the poly Europe was removed. It was NOT normal.
But I looked into my polygon definitions and I could not found any
boundary problem.
Therefore, I went back to the code and added logs for the events
"mouseover, "mouseout" and "click". And I found out that, when I
clicked on
the Europe poly I did not get the MOUSEOUT event corresponding to the
MOUSEOVER event (which I had since I was clicking on the object). The
MOUSEOUT event occured after the loading of the next polys. And
there,
as you said, I was making a setfillstyle on a removed object causing
the problem.
In simpler words, the problem was due to the fact that I had a pending
MOUSEOVER event with no corresponding MOUSEOUT event (or at least not
soon enough).
I've FIXED the problem by adding a clearInstanceListeners() when I
click on a poly.
Here is the code for tht CLICK listener:
GEvent.addListener(area.poly, "click", function(latlng) {
GEvent.clearInstanceListeners(area.poly);
//GLog.write('poly CLICKED setfillstyle: '+area.name);
switch (mapShown) {
case 0:
mapShown=1;
break;
case 1:
mapShown=1;
break;
}
mapShow();
});
If you're interested, you can check the correction at the same url.
Anyway, I am still interested into recoding my polylines using your
Perl script. For its DP reduction, which maybe, will reduce the
loading time and power. Can I abuse just a little
bit more of your time and ask you how should I go about doing this.
I've just installed PERL on my machine. Now I guess I need to
build input files containing points. Can you tell me more about input
and output format and syntax usage.
THANK YOU again,
marc
On 16 sep, 13:21, marcelo <[EMAIL PROTECTED]> wrote:
> Marc,
>
> I think I found the problem. Try this:
>
> 1. Load the map
> 2. Click on Europe !!!and quickly move your mouse out of the map!!!
> The last entry on the log should be "poly setfillstyle: France". If it
> isn't, then reload and move the mouse quicker after clicking Europe.
> 3. Clear the log. (don't close it)
> 4. Slowly bring your mouse into the edge of the map, for example in
> Africa, or anywhere far from Europe.
> See what happens? :-)
>
> There is a new entry on the log that says "poly setfillstyle: Europe",
> This means that the polygon for Europe actually covers the entire map,
> and although you removed it, as you setFillStyle it seems to be added
> again.
> That's why when you click "Retour" it is still there.
>
> Check the encoding of that polygon! Perhaps try loading an unencoded
> version just to see if you get the same behaviour. If you don't then
> the encoding is wrong.
> You also need to check your data structure, in particular the "Areas"
> array. Note that "associative arrays", or "hashes", are not really
> part of javascript, so that array should really be an object, or it
> should have numbers as indexes.
>
> About the encoded polygons, you might want to check a Perl module that
> I wrote together with John Coryat,
> here:http://www.usnaviguide.com/google-encode.htm
> It creates the encoded polygons and applies a D-P reduction algorithm,
> so that the whole thing might become a bit lighter.
>
> As for custom tiles, you could have the mouseover events by doind
> point-in-polygon analysis, although persoanlly, I do not like
> mouseover events that are visual. They always take me by surprise and
> I find them annoying, but that's just me. :-)
>
> --
> Marcelo -http://maps.forum.nu
> --
>
> On Sep 16, 10:56 am, marc <[EMAIL PROTECTED]> wrote:
>
> > Hi Marcelo.
>
> > First, thanx a lot for looking into my problem.
>
> > Concerning the weight of my polys, you are scarring me. I am new on
> > Google Maps API, but I've been looking into it for a few days now,
> > and I don't think I can have what I need another way. I 've
> > looked at the custom tiles, but if I understood correctly, I would not
> > be able to have the rollover/rollout behavior on the exact boundaries
> > of
> > countries/continents. I hope I will be able able to fasten a little
> > bit
> > the application, maybe by reducing the number of points in my
> > encoded polylines. Tell me I am not dreaming please ...
>
> > Anyway, for debugging purposes I have tried to lighten the online
> > application by loading only 1 poly on the world level (Europe) and
> > 2 polys at Europe level (Albania and France). I also have added all
> > the GLog.write()s you suggested (and some others). And, I went
> > back to the original method to delete overlays, that is, I now use
> > individual removeOverlay() instead of a global clearOverlays(), so
> > that
> > I can trace each overaly removal individually.
>
> > The cleanup function now looks like
> > function cleanMap() {
> > //alert('wait');
> > for (var z in Areas) {
> > map.removeOverlay(Areas[z].poly);
> > GLog.write('REMOVED overlay: '+Areas[z].name);
> > delete(Areas[z]);
> > }
> > //map.clearOverlays();
> > Areas = [];
> > if (ovrl !== undefined) {
> > map.removeOverlay(ovrl);
> > GLog.write('REMOVED overlay EInsert');
> > }}
>
> > I have tried also with "Areas = null;" instead of "Areas = [];". Same
> > thing.
>
> > RESULT:
> > The Glog trace looks fine to me. Each event is traced in the correct
> > order.
> > If you still have some time and patience for me, you can try to load
> > the "lighten" application still athttp://www.marc.archent.fr/public/tests/
>
> > I am lost and start to worry.
>
> > Thank you again to those who are trying to understand this one.
>
> > marc
>
> > On 15 sep, 13:07, marcelo <[EMAIL PROTECTED]> wrote:
>
> > > Marc,
>
> > > My problem is that I don't really understand what I am seeing on the
> > > screen with your application.
> > > The map is just too heavy, and Mozilla, (which is the browser where I
> > > have the Venkman debugger installed), will just not load it.
>
> > > In Firefox, the map loads, but the CPU goes to 100% for several
> > > seconds, and I don't dare to try with IE. :-)
> > > I'm sorry that I cannot offer a solution for your specific problem,
> > > but I'd suggest thatyou re-think the design of the application.
> > > The fact that you're using encoded polylines does not mean that you
> > > can load an unlimited number of them. Custom tiles might be the way to
> > > go.
>
> > > That being said, you might want to try some of the following:
> > > - Add a GLog.write() after every addOverlay(), and another after every
> > > removeOverlay(). Did you remove as many polygons as you added?
> > > - Did you try setting the variables that hold the polygons to null
> > > after removeOverlay()?
>
> > > --
> > > Marcelo -http://maps.forum.nu
> > > --
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---