Hi, the first time I want to add an kml as overlay to a map, IE raises an error (well - all others, too, but they are not shown in the browsers UI by default! You have to use FireBug or Safari Dev-Tools...) main.js of Google code: a.branch is not a function [Break on this error] lg=function(a,b){a&&a.branch(b)}, Every other overlay afterwards works fine. (it is no matter of the order, I add the KMLs) Does anybody else have this problem, too? my example: http://demo.stage.miadi.net/view.php?316-316 (see checkboxes below) it happens on the first addOverlay, regardless, if I use the patched in return-value or not... (I have modified my addOverlay function to return the GGeoXml object for hide() and show() ) Any idea, how to fix this? regards Henrik
Hi Henrik, The addOverlay method takes two parameters, the second being a boolean indicating whether or not to auto center the map after the overlay loads. However, in this case I think the issue may be down to a bug in Mapstraction or a breaking change that has been made to the v2 Google API. Try adding the second parameter and let us know if it fixes the issue - I''ve logged the issue in Google Code as I think it needs a bit more investigation anyway. A few other things I spotted in your code: - It''s best to put the Google Maps API script tag above the Mapstraction one. - You should wrap your map initialization code in a window.load or similar event handler to make sure all the scripts are loaded before you begin execution. - It''s a bad idea to name your main Mapstraction JavaScript variable the same as the ID of your map DIV - this may cause oddness. - You should have a var keyword before the first i in your for loop in setRemoveMarker to avoid collisions i.e. for(var i=0;... Derek On 24 May 2010 11:54, Henrik Genssen <henrik.genssen at miadi.net> wrote:> Hi, > > the first time I want to add an kml as overlay to a map, IE raises an error > (well - all others, too, but they are not shown in the browsers UI by > default! > You have to use FireBug or Safari Dev-Tools...) > > main.js of Google code: > a.branch is not a function > [Break on this error] lg=function(a,b){a&&a.branch(b)}, > > Every other overlay afterwards works fine. (it is no matter of the order, I > add the KMLs) > > Does anybody else have this problem, too? > my example: > http://demo.stage.miadi.net/view.php?316-316 > (see checkboxes below) > > it happens on the first addOverlay, regardless, if I use the patched in > return-value or not... > (I have modified my addOverlay function to return the GGeoXml object for > hide() and show() ) > > Any idea, how to fix this? > > regards > > Henrik > _______________________________________________ > Mapstraction mailing list > Mapstraction at lists.mapstraction.com > http://lists.mapstraction.com/listinfo.cgi/mapstraction-mapstraction.com >-- Derek Fowler m. +44 (0) 7966 512 369 e. dezfowler at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mapstraction.com/pipermail/mapstraction-mapstraction.com/attachments/20100524/8f08bb4c/attachment.htm>
Hi, thanks for your quick reply, adding the bool second option made no change...>The addOverlay method takes two parameters, the second being a boolean >indicating whether or not to auto center the map after the overlay loads. >However, in this case I think the issue may be down to a bug in Mapstraction >or a breaking change that has been made to the v2 Google API. Try adding the >second parameter and let us know if it fixes the issue - I''ve logged the >issue in Google Code as I think it needs a bit more investigation anyway.>A few other things I spotted in your code:Thanks for pointing those out!> - You should wrap your map initialization code in a window.load or > similar event handler to make sure all the scripts are loaded before you > begin execution.So far I had no problem with this - except for Safari, as their engine follows an other load order... Thank again for help Henrik>On 24 May 2010 11:54, Henrik Genssen <henrik.genssen at miadi.net> wrote: > >> Hi, >> >> the first time I want to add an kml as overlay to a map, IE raises an error >> (well - all others, too, but they are not shown in the browsers UI by >> default! >> You have to use FireBug or Safari Dev-Tools...) >> >> main.js of Google code: >> a.branch is not a function >> [Break on this error] lg=function(a,b){a&&a.branch(b)}, >> >> Every other overlay afterwards works fine. (it is no matter of the order, I >> add the KMLs) >> >> Does anybody else have this problem, too? >> my example: >> http://demo.stage.miadi.net/view.php?316-316 >> (see checkboxes below) >> >> it happens on the first addOverlay, regardless, if I use the patched in >> return-value or not... >> (I have modified my addOverlay function to return the GGeoXml object for >> hide() and show() ) >> >> Any idea, how to fix this? >> >> regards >> >> Henrik >> _______________________________________________ >> Mapstraction mailing list >> Mapstraction at lists.mapstraction.com >> http://lists.mapstraction.com/listinfo.cgi/mapstraction-mapstraction.com >> > > > >-- >Derek Fowler >m. +44 (0) 7966 512 369 >e. dezfowler at gmail.com >
Hi, it seems to be a change in the Google API, as the same problem occurs in mapstraction 1.0, too. -- regards Henrik>reply to message: >date: 24.05.2010 14:26:53 >from: "Derek Fowler" <dezfowler at gmail.com> >to: mapstraction at lists.mapstraction.com >subject: Re: [Mapstraction] problems with addOverlay in Googel > >Hi Henrik, > >The addOverlay method takes two parameters, the second being a boolean >indicating whether or not to auto center the map after the overlay loads. >However, in this case I think the issue may be down to a bug in Mapstraction >or a breaking change that has been made to the v2 Google API. Try adding the >second parameter and let us know if it fixes the issue - I''ve logged the >issue in Google Code as I think it needs a bit more investigation anyway.
I have made a pure google example which works well: http://demo.stage.miadi.net/test.html so my kml is valid and no problem. Did someone get around this problem? (using mapstraction add addOverlay with google v2 throws a javascript error in both mapstraction versions 1 and 2) Henrik>reply to message: >date: 25.05.2010 08:26:41 >from: "Henrik Genssen" <henrik.genssen at miadi.net> >to: mapstraction at lists.mapstraction.com >subject: Re: [Mapstraction] problems with addOverlay in Googel > >Hi, > >it seems to be a change in the Google API, as the same problem occurs in >mapstraction 1.0, too. > >-- >regards >Henrik > >>reply to message: >>date: 24.05.2010 14:26:53 >>from: "Derek Fowler" <dezfowler at gmail.com> >>to: mapstraction at lists.mapstraction.com >>subject: Re: [Mapstraction] problems with addOverlay in Googel >> >>Hi Henrik, >> >>The addOverlay method takes two parameters, the second being a boolean >>indicating whether or not to auto center the map after the overlay loads. >>However, in this case I think the issue may be down to a bug in Mapstraction >>or a breaking change that has been made to the v2 Google API. Try adding the >>second parameter and let us know if it fixes the issue - I''ve logged the >>issue in Google Code as I think it needs a bit more investigation anyway. >_______________________________________________ >Mapstraction mailing list >Mapstraction at lists.mapstraction.com >http://lists.mapstraction.com/listinfo.cgi/mapstraction-mapstraction.com >
Pablo López Escobés
2010-May-30 21:20 UTC
[Mapstraction] problems with addOverlay in Googel
It works for me. You can see it here: http://mvn.idelab.uva.es/idelabmapstraction/interactive_examples/demoKML.html I don?t remember if I change the Google provider code to run this demo, but you can see it at: http://dev.idelab.uva.es/idelabmapstraction/browser/trunk/idelabmapstraction -- Saludos, Pablo L?pez Escob?s 2010/5/30 Henrik Genssen <henrik.genssen at miadi.net>> I have made a pure google example which works well: > http://demo.stage.miadi.net/test.html > > so my kml is valid and no problem. > Did someone get around this problem? > > (using mapstraction add addOverlay with google v2 throws a javascript error > in both > mapstraction versions 1 and 2) > > Henrik > > >reply to message: > >date: 25.05.2010 08:26:41 > >from: "Henrik Genssen" <henrik.genssen at miadi.net> > >to: mapstraction at lists.mapstraction.com > >subject: Re: [Mapstraction] problems with addOverlay in Googel > > > >Hi, > > > >it seems to be a change in the Google API, as the same problem occurs in > >mapstraction 1.0, too. > > > >-- > >regards > >Henrik > > > >>reply to message: > >>date: 24.05.2010 14:26:53 > >>from: "Derek Fowler" <dezfowler at gmail.com> > >>to: mapstraction at lists.mapstraction.com > >>subject: Re: [Mapstraction] problems with addOverlay in Googel > >> > >>Hi Henrik, > >> > >>The addOverlay method takes two parameters, the second being a boolean > >>indicating whether or not to auto center the map after the overlay loads. > >>However, in this case I think the issue may be down to a bug in > Mapstraction > >>or a breaking change that has been made to the v2 Google API. Try adding > the > >>second parameter and let us know if it fixes the issue - I''ve logged the > >>issue in Google Code as I think it needs a bit more investigation anyway. > >_______________________________________________ > >Mapstraction mailing list > >Mapstraction at lists.mapstraction.com > >http://lists.mapstraction.com/listinfo.cgi/mapstraction-mapstraction.com > > > _______________________________________________ > Mapstraction mailing list > Mapstraction at lists.mapstraction.com > http://lists.mapstraction.com/listinfo.cgi/mapstraction-mapstraction.com >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mapstraction.com/pipermail/mapstraction-mapstraction.com/attachments/20100530/bb79cdcd/attachment.htm>
Hi, does not load on IE 6 at all! Henrik>reply to message: >date: 30.05.2010 23:20:28 >from: "Pablo L?pez Escob?s" <plopesc at gmail.com> >to: mapstraction at lists.mapstraction.com >subject: Re: [Mapstraction] problems with addOverlay in Googel > >It works for me. You can see it here: >http://mvn.idelab.uva.es/idelabmapstraction/interactive_examples/demoKML.html > >I don?t remember if I change the Google provider code to run this demo, but >you can see it at: >http://dev.idelab.uva.es/idelabmapstraction/browser/trunk/idelabmapstraction > >-- >Saludos, > Pablo L?pez Escob?s > > >2010/5/30 Henrik Genssen <henrik.genssen at miadi.net> > >> I have made a pure google example which works well: >> http://demo.stage.miadi.net/test.html >> >> so my kml is valid and no problem. >> Did someone get around this problem? >> >> (using mapstraction add addOverlay with google v2 throws a javascript error >> in both >> mapstraction versions 1 and 2) >> >> Henrik >> >> >reply to message: >> >date: 25.05.2010 08:26:41 >> >from: "Henrik Genssen" <henrik.genssen at miadi.net> >> >to: mapstraction at lists.mapstraction.com >> >subject: Re: [Mapstraction] problems with addOverlay in Googel >> > >> >Hi, >> > >> >it seems to be a change in the Google API, as the same problem occurs in >> >mapstraction 1.0, too. >> > >> >-- >> >regards >> >Henrik >> > >> >>reply to message: >> >>date: 24.05.2010 14:26:53 >> >>from: "Derek Fowler" <dezfowler at gmail.com> >> >>to: mapstraction at lists.mapstraction.com >> >>subject: Re: [Mapstraction] problems with addOverlay in Googel >> >> >> >>Hi Henrik, >> >> >> >>The addOverlay method takes two parameters, the second being a boolean >> >>indicating whether or not to auto center the map after the overlay loads. >> >>However, in this case I think the issue may be down to a bug in >> Mapstraction >> >>or a breaking change that has been made to the v2 Google API. Try adding >> the >> >>second parameter and let us know if it fixes the issue - I''ve logged the >> >>issue in Google Code as I think it needs a bit more investigation anyway. >> >_______________________________________________ >> >Mapstraction mailing list >> >Mapstraction at lists.mapstraction.com >> >http://lists.mapstraction.com/listinfo.cgi/mapstraction-mapstraction.com >> > >> _______________________________________________ >> Mapstraction mailing list >> Mapstraction at lists.mapstraction.com >> http://lists.mapstraction.com/listinfo.cgi/mapstraction-mapstraction.com >> >
OK, if I changed a part in addOverlay: map.addOverlay(geoXML, function(){ if (autoCenterAndZoom) { geoXML.gotoDefaultViewport(map); } }); to: map.addOverlay(geoXML); as in the Google expample here: http://demo.stage.miadi.net/test.html and my errors are gone... regards Henrik>reply to message: >date: 30.05.2010 23:02:39 >from: "Henrik Genssen" <henrik.genssen at miadi.net> >to: mapstraction at lists.mapstraction.com >subject: RE: Re: [Mapstraction] problems with addOverlay in Googel > >I have made a pure google example which works well: >http://demo.stage.miadi.net/test.html > >so my kml is valid and no problem. >Did someone get around this problem? > >(using mapstraction add addOverlay with google v2 throws a javascript error in both >mapstraction versions 1 and 2) > >Henrik > >>reply to message: >>date: 25.05.2010 08:26:41 >>from: "Henrik Genssen" <henrik.genssen at miadi.net> >>to: mapstraction at lists.mapstraction.com >>subject: Re: [Mapstraction] problems with addOverlay in Googel >> >>Hi, >> >>it seems to be a change in the Google API, as the same problem occurs in >>mapstraction 1.0, too. >> >>-- >>regards >>Henrik >> >>>reply to message: >>>date: 24.05.2010 14:26:53 >>>from: "Derek Fowler" <dezfowler at gmail.com> >>>to: mapstraction at lists.mapstraction.com >>>subject: Re: [Mapstraction] problems with addOverlay in Googel >>> >>>Hi Henrik, >>> >>>The addOverlay method takes two parameters, the second being a boolean >>>indicating whether or not to auto center the map after the overlay loads. >>>However, in this case I think the issue may be down to a bug in Mapstraction >>>or a breaking change that has been made to the v2 Google API. Try adding the >>>second parameter and let us know if it fixes the issue - I''ve logged the >>>issue in Google Code as I think it needs a bit more investigation anyway. >>_______________________________________________ >>Mapstraction mailing list >>Mapstraction at lists.mapstraction.com >>http://lists.mapstraction.com/listinfo.cgi/mapstraction-mapstraction.com >>