Vito Tafuni
2010-May-25 08:15 UTC
[Mapstraction] addeventlistener on click don''t give me position
I don''t know where i''m wrong! <a href="javascript: map.addEventListener(''click'',function(p){alert(p);})">click</a><br/> the click event is correctly captured but the alert says "undefined,undefined" -- ----------- Tafuni Vito vito at vitotafuni.com --------------------------------------------- "Verba volant, scripta manent... data corrupted" -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mapstraction.com/pipermail/mapstraction-mapstraction.com/attachments/20100525/7b919061/attachment.htm>
Pablo López Escobés
2010-May-25 08:23 UTC
[Mapstraction] addeventlistener on click don''t give me position
Hi! You should use the v2 events handler. Try this: map.click.addHandler(function(type,map,arg){alert(arg.location)}) -- Saludos, Pablo L?pez Escob?s 2010/5/25 Vito Tafuni <vito at vitotafuni.com>> I don''t know where i''m wrong! > > <a href="javascript: > map.addEventListener(''click'',function(p){alert(p);})">click</a><br/> > > the click event is correctly captured but the alert says > "undefined,undefined" > > > > -- > ----------- > Tafuni Vito > vito at vitotafuni.com > --------------------------------------------- > "Verba volant, scripta manent... data corrupted" > > _______________________________________________ > 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/20100525/05f9d290/attachment.htm>
Vito Tafuni
2010-May-25 08:31 UTC
[Mapstraction] addeventlistener on click don''t give me position
ok it seems i''m not so wrong... the problem is with microgoft map google (i''m using v3) map works fine with addEventListener but your code doesn''t work! in M the click event is triggered with position "undefined,undefined" in G the function is never called! -- ----------- Tafuni Vito vito at vitotafuni.com --------------------------------------------- "Verba volant, scripta manent... data corrupted" 2010/5/25 Pablo L?pez Escob?s <plopesc at gmail.com>> Hi! > > You should use the v2 events handler. Try this: > > map.click.addHandler(function(type,map,arg){alert(arg.location)}) > > > -- > Saludos, > Pablo L?pez Escob?s > > > 2010/5/25 Vito Tafuni <vito at vitotafuni.com> > >> I don''t know where i''m wrong! >> >> <a href="javascript: >> map.addEventListener(''click'',function(p){alert(p);})">click</a><br/> >> >> the click event is correctly captured but the alert says >> "undefined,undefined" >> >> >> >> -- >> ----------- >> Tafuni Vito >> vito at vitotafuni.com >> --------------------------------------------- >> "Verba volant, scripta manent... data corrupted" >> >> _______________________________________________ >> 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/20100525/111c70e1/attachment.htm>
Vito Tafuni
2010-May-25 08:50 UTC
[Mapstraction] addeventlistener on click don''t give me position
the problem with addHandler seems related to the fact that the function uses an internal array handlers this.addHandler = function(fn, ctx){ handlers.push({context: ctx, handler: fn}); }; google.maps.event.addListener(map, ''click'', function(location){ me.clickHandler(location.latLng.lat(),location.latLng.lng(),location,me); }); Mapstraction.prototype.clickHandler = function(lat, lon, me) { this.callEventListeners(''click'', { location: new LatLonPoint(lat, lon) }); }; Mapstraction.prototype.callEventListeners = function(sEventType, oEventArgs) { oEventArgs.source = this; for(var i = 0; i < this.eventListeners.length; i++) { var evLi = this.eventListeners[i]; ... }; while the callEventListeners function loops on eventListeners array I''m not so good with Mapstraction code (i''ve started using from yesterday) so i hope some developer can help us! -- ----------- Tafuni Vito vito at vitotafuni.com --------------------------------------------- "Verba volant, scripta manent... data corrupted" 2010/5/25 Vito Tafuni <vito at vitotafuni.com>> ok it seems i''m not so wrong... the problem is with microgoft map > google (i''m using v3) map works fine with addEventListener > > but your code doesn''t work! > in M the click event is triggered with position "undefined,undefined" in G > the function is never called! > > > > -- > ----------- > Tafuni Vito > vito at vitotafuni.com > --------------------------------------------- > "Verba volant, scripta manent... data corrupted" > > > 2010/5/25 Pablo L?pez Escob?s <plopesc at gmail.com> > > Hi! >> >> You should use the v2 events handler. Try this: >> >> map.click.addHandler(function(type,map,arg){alert(arg.location)}) >> >> >> -- >> Saludos, >> Pablo L?pez Escob?s >> >> >> 2010/5/25 Vito Tafuni <vito at vitotafuni.com> >> >>> I don''t know where i''m wrong! >>> >>> <a href="javascript: >>> map.addEventListener(''click'',function(p){alert(p);})">click</a><br/> >>> >>> the click event is correctly captured but the alert says >>> "undefined,undefined" >>> >>> >>> >>> -- >>> ----------- >>> Tafuni Vito >>> vito at vitotafuni.com >>> --------------------------------------------- >>> "Verba volant, scripta manent... data corrupted" >>> >>> _______________________________________________ >>> 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/20100525/1643c77a/attachment.htm>
Vito Tafuni
2010-May-25 09:21 UTC
[Mapstraction] addeventlistener on click don''t give me position
in the meanwhile i''ve found the problem with microkoft map in mxn.microsoft.core.js change the attachevent with this this.maps[api].AttachEvent(''onclick'', function(event){ var x = event.mapX; var y = event.mapY; var pixel = me.maps[me.api].PixelToLatLong(new VEPixel(x,y)); me.clickHandler(pixel.Latitude,pixel.Longitude); me.click.fire({''location'': new mxn.LatLonPoint(pixel.Latitude, pixel.Longitude)}); }); the clickHandler was called without arguments (so "undefined,undefined") and the click.fire was called with wrong args because VEPixel return pixel.x and pixel.y so you need PixelToLatLong to obtain Latitude and Longitude i''ve made as little changes as possible so i don''t know if is correct for you "me.maps[me.api]." inside the AttachEvent know i can say that the error with googlev3 api on addHandler comes to the fact you have not a unique way to handle events and so google.maps.event.addListener(map, ''click'', function(location){ me.clickHandler(location.latLng.lat(),location.latLng.lng(),location,me); }); doesn''t call the me.click.fire but at this point instead of put a redundant clickHandler + me.click.fire i hope you find a unique solution to handle events in the meanwhile i should suggest to move the clickHandler call in the click.fire for backward compatibility and use the new click.fire -Vito- -- ----------- Tafuni Vito vito at vitotafuni.com --------------------------------------------- "Verba volant, scripta manent... data corrupted" 2010/5/25 Vito Tafuni <vito at vitotafuni.com>> the problem with addHandler seems related to the fact that the function > uses an internal array handlers > > this.addHandler = function(fn, ctx){ > handlers.push({context: ctx, handler: fn}); > }; > > google.maps.event.addListener(map, ''click'', function(location){ > > me.clickHandler(location.latLng.lat(),location.latLng.lng(),location,me); > }); > > Mapstraction.prototype.clickHandler = function(lat, lon, me) { > this.callEventListeners(''click'', { > location: new LatLonPoint(lat, lon) > }); > }; > > Mapstraction.prototype.callEventListeners = function(sEventType, > oEventArgs) { > oEventArgs.source = this; > for(var i = 0; i < this.eventListeners.length; i++) { > var evLi = this.eventListeners[i]; > ... > }; > > while the callEventListeners function loops on eventListeners array > > I''m not so good with Mapstraction code (i''ve started using from yesterday) > so i hope some developer can help us! > > > -- > ----------- > Tafuni Vito > vito at vitotafuni.com > --------------------------------------------- > "Verba volant, scripta manent... data corrupted" > > > 2010/5/25 Vito Tafuni <vito at vitotafuni.com> > >> ok it seems i''m not so wrong... the problem is with microgoft map >> google (i''m using v3) map works fine with addEventListener >> >> but your code doesn''t work! >> in M the click event is triggered with position "undefined,undefined" in G >> the function is never called! >> >> >> >> -- >> ----------- >> Tafuni Vito >> vito at vitotafuni.com >> --------------------------------------------- >> "Verba volant, scripta manent... data corrupted" >> >> >> 2010/5/25 Pablo L?pez Escob?s <plopesc at gmail.com> >> >> Hi! >>> >>> You should use the v2 events handler. Try this: >>> >>> map.click.addHandler(function(type,map,arg){alert(arg.location)}) >>> >>> >>> -- >>> Saludos, >>> Pablo L?pez Escob?s >>> >>> >>> 2010/5/25 Vito Tafuni <vito at vitotafuni.com> >>> >>>> I don''t know where i''m wrong! >>>> >>>> <a href="javascript: >>>> map.addEventListener(''click'',function(p){alert(p);})">click</a><br/> >>>> >>>> the click event is correctly captured but the alert says >>>> "undefined,undefined" >>>> >>>> >>>> >>>> -- >>>> ----------- >>>> Tafuni Vito >>>> vito at vitotafuni.com >>>> --------------------------------------------- >>>> "Verba volant, scripta manent... data corrupted" >>>> >>>> _______________________________________________ >>>> 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/20100525/3467d188/attachment-0001.htm>
Derek Fowler
2010-May-25 12:33 UTC
[Mapstraction] addeventlistener on click don''t give me position
Hi Vito, Thanks for doing some investigation here - hopefully we can get this sorted out. Which version of the Microsoft API are you using, I''m wondering whether this is another case of an API change that has gone unnoticed. I''m starting to think a suite of automated tests is in order here. Derek On 25 May 2010 10:21, Vito Tafuni <vito at vitotafuni.com> wrote:> in the meanwhile i''ve found the problem with microkoft map > in mxn.microsoft.core.js change the attachevent with this > > this.maps[api].AttachEvent(''onclick'', function(event){ > > var x = event.mapX; > var y = event.mapY; > var pixel = me.maps[me.api].PixelToLatLong(new > VEPixel(x,y)); > > me.clickHandler(pixel.Latitude,pixel.Longitude); > me.click.fire({''location'': new > mxn.LatLonPoint(pixel.Latitude, pixel.Longitude)}); > }); > > the clickHandler was called without arguments (so "undefined,undefined") > and the click.fire was called with wrong args because VEPixel return > pixel.x and pixel.y so you need PixelToLatLong to obtain Latitude and > Longitude > > i''ve made as little changes as possible so i don''t know if is correct for > you "me.maps[me.api]." inside the AttachEvent > > > know i can say that the error with googlev3 api on addHandler comes to the > fact you have not a unique way to handle events and so > > > google.maps.event.addListener(map, ''click'', function(location){ > > me.clickHandler(location.latLng.lat(),location.latLng.lng(),location,me); > }); > > doesn''t call the me.click.fire > > but at this point instead of put a redundant clickHandler + me.click.fire i > hope you find a unique solution to handle events > in the meanwhile i should suggest to move the clickHandler call in the click.fire > for backward compatibility and use the new click.fire > > > > -Vito- > > > > > > -- > ----------- > Tafuni Vito > vito at vitotafuni.com > --------------------------------------------- > "Verba volant, scripta manent... data corrupted" > > > 2010/5/25 Vito Tafuni <vito at vitotafuni.com> > >> the problem with addHandler seems related to the fact that the function >> uses an internal array handlers >> >> this.addHandler = function(fn, ctx){ >> handlers.push({context: ctx, handler: fn}); >> }; >> >> google.maps.event.addListener(map, ''click'', function(location){ >> >> me.clickHandler(location.latLng.lat(),location.latLng.lng(),location,me); >> }); >> >> Mapstraction.prototype.clickHandler = function(lat, lon, me) { >> this.callEventListeners(''click'', { >> location: new LatLonPoint(lat, lon) >> }); >> }; >> >> Mapstraction.prototype.callEventListeners = function(sEventType, >> oEventArgs) { >> oEventArgs.source = this; >> for(var i = 0; i < this.eventListeners.length; i++) { >> var evLi = this.eventListeners[i]; >> ... >> }; >> >> while the callEventListeners function loops on eventListeners array >> >> I''m not so good with Mapstraction code (i''ve started using from yesterday) >> so i hope some developer can help us! >> >> >> -- >> ----------- >> Tafuni Vito >> vito at vitotafuni.com >> --------------------------------------------- >> "Verba volant, scripta manent... data corrupted" >> >> >> 2010/5/25 Vito Tafuni <vito at vitotafuni.com> >> >>> ok it seems i''m not so wrong... the problem is with microgoft map >>> google (i''m using v3) map works fine with addEventListener >>> >>> but your code doesn''t work! >>> in M the click event is triggered with position "undefined,undefined" in >>> G the function is never called! >>> >>> >>> >>> -- >>> ----------- >>> Tafuni Vito >>> vito at vitotafuni.com >>> --------------------------------------------- >>> "Verba volant, scripta manent... data corrupted" >>> >>> >>> 2010/5/25 Pablo L?pez Escob?s <plopesc at gmail.com> >>> >>> Hi! >>>> >>>> You should use the v2 events handler. Try this: >>>> >>>> map.click.addHandler(function(type,map,arg){alert(arg.location)}) >>>> >>>> >>>> -- >>>> Saludos, >>>> Pablo L?pez Escob?s >>>> >>>> >>>> 2010/5/25 Vito Tafuni <vito at vitotafuni.com> >>>> >>>>> I don''t know where i''m wrong! >>>>> >>>>> <a href="javascript: >>>>> map.addEventListener(''click'',function(p){alert(p);})">click</a><br/> >>>>> >>>>> the click event is correctly captured but the alert says >>>>> "undefined,undefined" >>>>> >>>>> >>>>> >>>>> -- >>>>> ----------- >>>>> Tafuni Vito >>>>> vito at vitotafuni.com >>>>> --------------------------------------------- >>>>> "Verba volant, scripta manent... data corrupted" >>>>> >>>>> _______________________________________________ >>>>> 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 >>>> >>>> >>> >> > > _______________________________________________ > 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/20100525/026b2d7f/attachment.htm>
Pablo López Escobés
2010-May-25 12:43 UTC
[Mapstraction] addeventlistener on click don''t give me position
Hi! It is a problem of Mapsttraction v2 mxn.microsoft.core.js file. I posted the mxn.microsoft.core.js file in the Git repository in December with this problem fixed. -- Saludos, Pablo L?pez Escob?s 2010/5/25 Derek Fowler <dezfowler at gmail.com>> Hi Vito, > > Thanks for doing some investigation here - hopefully we can get this sorted > out. Which version of the Microsoft API are you using, I''m wondering whether > this is another case of an API change that has gone unnoticed. I''m starting > to think a suite of automated tests is in order here. > > Derek > > > On 25 May 2010 10:21, Vito Tafuni <vito at vitotafuni.com> wrote: > >> in the meanwhile i''ve found the problem with microkoft map >> in mxn.microsoft.core.js change the attachevent with this >> >> this.maps[api].AttachEvent(''onclick'', function(event){ >> >> var x = event.mapX; >> var y = event.mapY; >> var pixel = me.maps[me.api].PixelToLatLong(new >> VEPixel(x,y)); >> >> me.clickHandler(pixel.Latitude,pixel.Longitude); >> me.click.fire({''location'': new >> mxn.LatLonPoint(pixel.Latitude, pixel.Longitude)}); >> }); >> >> the clickHandler was called without arguments (so "undefined,undefined") >> and the click.fire was called with wrong args because VEPixel return >> pixel.x and pixel.y so you need PixelToLatLong to obtain Latitude and >> Longitude >> >> i''ve made as little changes as possible so i don''t know if is correct for >> you "me.maps[me.api]." inside the AttachEvent >> >> >> know i can say that the error with googlev3 api on addHandler comes to the >> fact you have not a unique way to handle events and so >> >> >> google.maps.event.addListener(map, ''click'', function(location){ >> >> me.clickHandler(location.latLng.lat(),location.latLng.lng(),location,me); >> }); >> >> doesn''t call the me.click.fire >> >> but at this point instead of put a redundant clickHandler + me.click.fire >> i hope you find a unique solution to handle events >> in the meanwhile i should suggest to move the clickHandler call in the click.fire >> for backward compatibility and use the new click.fire >> >> >> >> -Vito- >> >> >> >> >> >> -- >> ----------- >> Tafuni Vito >> vito at vitotafuni.com >> --------------------------------------------- >> "Verba volant, scripta manent... data corrupted" >> >> >> 2010/5/25 Vito Tafuni <vito at vitotafuni.com> >> >>> the problem with addHandler seems related to the fact that the function >>> uses an internal array handlers >>> >>> this.addHandler = function(fn, ctx){ >>> handlers.push({context: ctx, handler: fn}); >>> }; >>> >>> google.maps.event.addListener(map, ''click'', function(location){ >>> >>> me.clickHandler(location.latLng.lat(),location.latLng.lng(),location,me); >>> }); >>> >>> Mapstraction.prototype.clickHandler = function(lat, lon, me) { >>> this.callEventListeners(''click'', { >>> location: new LatLonPoint(lat, lon) >>> }); >>> }; >>> >>> Mapstraction.prototype.callEventListeners = function(sEventType, >>> oEventArgs) { >>> oEventArgs.source = this; >>> for(var i = 0; i < this.eventListeners.length; i++) { >>> var evLi = this.eventListeners[i]; >>> ... >>> }; >>> >>> while the callEventListeners function loops on eventListeners array >>> >>> I''m not so good with Mapstraction code (i''ve started using from >>> yesterday) so i hope some developer can help us! >>> >>> >>> -- >>> ----------- >>> Tafuni Vito >>> vito at vitotafuni.com >>> --------------------------------------------- >>> "Verba volant, scripta manent... data corrupted" >>> >>> >>> 2010/5/25 Vito Tafuni <vito at vitotafuni.com> >>> >>>> ok it seems i''m not so wrong... the problem is with microgoft map >>>> google (i''m using v3) map works fine with addEventListener >>>> >>>> but your code doesn''t work! >>>> in M the click event is triggered with position "undefined,undefined" in >>>> G the function is never called! >>>> >>>> >>>> >>>> -- >>>> ----------- >>>> Tafuni Vito >>>> vito at vitotafuni.com >>>> --------------------------------------------- >>>> "Verba volant, scripta manent... data corrupted" >>>> >>>> >>>> 2010/5/25 Pablo L?pez Escob?s <plopesc at gmail.com> >>>> >>>> Hi! >>>>> >>>>> You should use the v2 events handler. Try this: >>>>> >>>>> map.click.addHandler(function(type,map,arg){alert(arg.location)}) >>>>> >>>>> >>>>> -- >>>>> Saludos, >>>>> Pablo L?pez Escob?s >>>>> >>>>> >>>>> 2010/5/25 Vito Tafuni <vito at vitotafuni.com> >>>>> >>>>>> I don''t know where i''m wrong! >>>>>> >>>>>> <a href="javascript: >>>>>> map.addEventListener(''click'',function(p){alert(p);})">click</a><br/> >>>>>> >>>>>> the click event is correctly captured but the alert says >>>>>> "undefined,undefined" >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> ----------- >>>>>> Tafuni Vito >>>>>> vito at vitotafuni.com >>>>>> --------------------------------------------- >>>>>> "Verba volant, scripta manent... data corrupted" >>>>>> >>>>>> _______________________________________________ >>>>>> 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 >>>>> >>>>> >>>> >>> >> >> _______________________________________________ >> 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 > > _______________________________________________ > 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/20100525/90b6349b/attachment-0001.htm>
Vito Tafuni
2010-May-25 14:21 UTC
[Mapstraction] addeventlistener on click don''t give me position
i''ve taked this from microsoft msdn <script type="text/javascript" src=" http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.2&mkt=it-IT "></script> what about a way to avoid manual linkage of the various api scripts?? can''t you find a way to load the script automatically when loading the api mxn.*.core.js file? -- ----------- Tafuni Vito vito at vitotafuni.com --------------------------------------------- "Verba volant, scripta manent... data corrupted" 2010/5/25 Derek Fowler <dezfowler at gmail.com>> Hi Vito, > > Thanks for doing some investigation here - hopefully we can get this sorted > out. Which version of the Microsoft API are you using, I''m wondering whether > this is another case of an API change that has gone unnoticed. I''m starting > to think a suite of automated tests is in order here. > > Derek > > > On 25 May 2010 10:21, Vito Tafuni <vito at vitotafuni.com> wrote: > >> in the meanwhile i''ve found the problem with microkoft map >> in mxn.microsoft.core.js change the attachevent with this >> >> this.maps[api].AttachEvent(''onclick'', function(event){ >> >> var x = event.mapX; >> var y = event.mapY; >> var pixel = me.maps[me.api].PixelToLatLong(new >> VEPixel(x,y)); >> >> me.clickHandler(pixel.Latitude,pixel.Longitude); >> me.click.fire({''location'': new >> mxn.LatLonPoint(pixel.Latitude, pixel.Longitude)}); >> }); >> >> the clickHandler was called without arguments (so "undefined,undefined") >> and the click.fire was called with wrong args because VEPixel return >> pixel.x and pixel.y so you need PixelToLatLong to obtain Latitude and >> Longitude >> >> i''ve made as little changes as possible so i don''t know if is correct for >> you "me.maps[me.api]." inside the AttachEvent >> >> >> know i can say that the error with googlev3 api on addHandler comes to the >> fact you have not a unique way to handle events and so >> >> >> google.maps.event.addListener(map, ''click'', function(location){ >> >> me.clickHandler(location.latLng.lat(),location.latLng.lng(),location,me); >> }); >> >> doesn''t call the me.click.fire >> >> but at this point instead of put a redundant clickHandler + me.click.fire >> i hope you find a unique solution to handle events >> in the meanwhile i should suggest to move the clickHandler call in the click.fire >> for backward compatibility and use the new click.fire >> >> >> >> -Vito- >> >> >> >> >> >> -- >> ----------- >> Tafuni Vito >> vito at vitotafuni.com >> --------------------------------------------- >> "Verba volant, scripta manent... data corrupted" >> >> >> 2010/5/25 Vito Tafuni <vito at vitotafuni.com> >> >>> the problem with addHandler seems related to the fact that the function >>> uses an internal array handlers >>> >>> this.addHandler = function(fn, ctx){ >>> handlers.push({context: ctx, handler: fn}); >>> }; >>> >>> google.maps.event.addListener(map, ''click'', function(location){ >>> >>> me.clickHandler(location.latLng.lat(),location.latLng.lng(),location,me); >>> }); >>> >>> Mapstraction.prototype.clickHandler = function(lat, lon, me) { >>> this.callEventListeners(''click'', { >>> location: new LatLonPoint(lat, lon) >>> }); >>> }; >>> >>> Mapstraction.prototype.callEventListeners = function(sEventType, >>> oEventArgs) { >>> oEventArgs.source = this; >>> for(var i = 0; i < this.eventListeners.length; i++) { >>> var evLi = this.eventListeners[i]; >>> ... >>> }; >>> >>> while the callEventListeners function loops on eventListeners array >>> >>> I''m not so good with Mapstraction code (i''ve started using from >>> yesterday) so i hope some developer can help us! >>> >>> >>> -- >>> ----------- >>> Tafuni Vito >>> vito at vitotafuni.com >>> --------------------------------------------- >>> "Verba volant, scripta manent... data corrupted" >>> >>> >>> 2010/5/25 Vito Tafuni <vito at vitotafuni.com> >>> >>>> ok it seems i''m not so wrong... the problem is with microgoft map >>>> google (i''m using v3) map works fine with addEventListener >>>> >>>> but your code doesn''t work! >>>> in M the click event is triggered with position "undefined,undefined" in >>>> G the function is never called! >>>> >>>> >>>> >>>> -- >>>> ----------- >>>> Tafuni Vito >>>> vito at vitotafuni.com >>>> --------------------------------------------- >>>> "Verba volant, scripta manent... data corrupted" >>>> >>>> >>>> 2010/5/25 Pablo L?pez Escob?s <plopesc at gmail.com> >>>> >>>> Hi! >>>>> >>>>> You should use the v2 events handler. Try this: >>>>> >>>>> map.click.addHandler(function(type,map,arg){alert(arg.location)}) >>>>> >>>>> >>>>> -- >>>>> Saludos, >>>>> Pablo L?pez Escob?s >>>>> >>>>> >>>>> 2010/5/25 Vito Tafuni <vito at vitotafuni.com> >>>>> >>>>>> I don''t know where i''m wrong! >>>>>> >>>>>> <a href="javascript: >>>>>> map.addEventListener(''click'',function(p){alert(p);})">click</a><br/> >>>>>> >>>>>> the click event is correctly captured but the alert says >>>>>> "undefined,undefined" >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> ----------- >>>>>> Tafuni Vito >>>>>> vito at vitotafuni.com >>>>>> --------------------------------------------- >>>>>> "Verba volant, scripta manent... data corrupted" >>>>>> >>>>>> _______________________________________________ >>>>>> 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 >>>>> >>>>> >>>> >>> >> >> _______________________________________________ >> 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 > > _______________________________________________ > 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/20100525/39784ebc/attachment.htm>
Vito Tafuni
2010-May-25 14:23 UTC
[Mapstraction] addeventlistener on click don''t give me position
i''ve downloaded the last svn source yesterday so i don''t know about your changes. hasta luego -- ----------- Tafuni Vito vito at vitotafuni.com --------------------------------------------- "Verba volant, scripta manent... data corrupted" 2010/5/25 Pablo L?pez Escob?s <plopesc at gmail.com>> Hi! > > It is a problem of Mapsttraction v2 mxn.microsoft.core.js file. > I posted the mxn.microsoft.core.js file in the Git repository in December > with this problem fixed. > > -- > Saludos, > Pablo L?pez Escob?s > > > 2010/5/25 Derek Fowler <dezfowler at gmail.com> > > Hi Vito, >> >> Thanks for doing some investigation here - hopefully we can get this >> sorted out. Which version of the Microsoft API are you using, I''m wondering >> whether this is another case of an API change that has gone unnoticed. I''m >> starting to think a suite of automated tests is in order here. >> >> Derek >> >> >> On 25 May 2010 10:21, Vito Tafuni <vito at vitotafuni.com> wrote: >> >>> in the meanwhile i''ve found the problem with microkoft map >>> in mxn.microsoft.core.js change the attachevent with this >>> >>> this.maps[api].AttachEvent(''onclick'', function(event){ >>> >>> var x = event.mapX; >>> var y = event.mapY; >>> var pixel = me.maps[me.api].PixelToLatLong(new >>> VEPixel(x,y)); >>> >>> me.clickHandler(pixel.Latitude,pixel.Longitude); >>> me.click.fire({''location'': new >>> mxn.LatLonPoint(pixel.Latitude, pixel.Longitude)}); >>> }); >>> >>> the clickHandler was called without arguments (so "undefined,undefined") >>> and the click.fire was called with wrong args because VEPixel return >>> pixel.x and pixel.y so you need PixelToLatLong to obtain Latitude and >>> Longitude >>> >>> i''ve made as little changes as possible so i don''t know if is correct for >>> you "me.maps[me.api]." inside the AttachEvent >>> >>> >>> know i can say that the error with googlev3 api on addHandler comes to >>> the fact you have not a unique way to handle events and so >>> >>> >>> google.maps.event.addListener(map, ''click'', function(location){ >>> >>> me.clickHandler(location.latLng.lat(),location.latLng.lng(),location,me); >>> }); >>> >>> doesn''t call the me.click.fire >>> >>> but at this point instead of put a redundant clickHandler + me.click.fire >>> i hope you find a unique solution to handle events >>> in the meanwhile i should suggest to move the clickHandler call in the click.fire >>> for backward compatibility and use the new click.fire >>> >>> >>> >>> -Vito- >>> >>> >>> >>> >>> >>> -- >>> ----------- >>> Tafuni Vito >>> vito at vitotafuni.com >>> --------------------------------------------- >>> "Verba volant, scripta manent... data corrupted" >>> >>> >>> 2010/5/25 Vito Tafuni <vito at vitotafuni.com> >>> >>>> the problem with addHandler seems related to the fact that the function >>>> uses an internal array handlers >>>> >>>> this.addHandler = function(fn, ctx){ >>>> handlers.push({context: ctx, handler: fn}); >>>> }; >>>> >>>> google.maps.event.addListener(map, ''click'', function(location){ >>>> >>>> me.clickHandler(location.latLng.lat(),location.latLng.lng(),location,me); >>>> }); >>>> >>>> Mapstraction.prototype.clickHandler = function(lat, lon, me) { >>>> this.callEventListeners(''click'', { >>>> location: new LatLonPoint(lat, lon) >>>> }); >>>> }; >>>> >>>> Mapstraction.prototype.callEventListeners = function(sEventType, >>>> oEventArgs) { >>>> oEventArgs.source = this; >>>> for(var i = 0; i < this.eventListeners.length; i++) { >>>> var evLi = this.eventListeners[i]; >>>> ... >>>> }; >>>> >>>> while the callEventListeners function loops on eventListeners array >>>> >>>> I''m not so good with Mapstraction code (i''ve started using from >>>> yesterday) so i hope some developer can help us! >>>> >>>> >>>> -- >>>> ----------- >>>> Tafuni Vito >>>> vito at vitotafuni.com >>>> --------------------------------------------- >>>> "Verba volant, scripta manent... data corrupted" >>>> >>>> >>>> 2010/5/25 Vito Tafuni <vito at vitotafuni.com> >>>> >>>>> ok it seems i''m not so wrong... the problem is with microgoft map >>>>> google (i''m using v3) map works fine with addEventListener >>>>> >>>>> but your code doesn''t work! >>>>> in M the click event is triggered with position "undefined,undefined" >>>>> in G the function is never called! >>>>> >>>>> >>>>> >>>>> -- >>>>> ----------- >>>>> Tafuni Vito >>>>> vito at vitotafuni.com >>>>> --------------------------------------------- >>>>> "Verba volant, scripta manent... data corrupted" >>>>> >>>>> >>>>> 2010/5/25 Pablo L?pez Escob?s <plopesc at gmail.com> >>>>> >>>>> Hi! >>>>>> >>>>>> You should use the v2 events handler. Try this: >>>>>> >>>>>> map.click.addHandler(function(type,map,arg){alert(arg.location)}) >>>>>> >>>>>> >>>>>> -- >>>>>> Saludos, >>>>>> Pablo L?pez Escob?s >>>>>> >>>>>> >>>>>> 2010/5/25 Vito Tafuni <vito at vitotafuni.com> >>>>>> >>>>>>> I don''t know where i''m wrong! >>>>>>> >>>>>>> <a href="javascript: >>>>>>> map.addEventListener(''click'',function(p){alert(p);})">click</a><br/> >>>>>>> >>>>>>> the click event is correctly captured but the alert says >>>>>>> "undefined,undefined" >>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> ----------- >>>>>>> Tafuni Vito >>>>>>> vito at vitotafuni.com >>>>>>> --------------------------------------------- >>>>>>> "Verba volant, scripta manent... data corrupted" >>>>>>> >>>>>>> _______________________________________________ >>>>>>> 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 >>>>>> >>>>>> >>>>> >>>> >>> >>> _______________________________________________ >>> 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 >> >> _______________________________________________ >> 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/20100525/ea0afaed/attachment-0001.htm>
Vito Tafuni
2010-May-25 14:26 UTC
[Mapstraction] addeventlistener on click don''t give me position
another thing... why you use a map.[event].addHandler notation? can''t you use a map.addEvent(''event'',func) like in common ajax frameworks?? waht if i need to track mousedown and mouseup on the map? It''s just a curiousity! -Vito- -- ----------- Tafuni Vito vito at vitotafuni.com --------------------------------------------- "Verba volant, scripta manent... data corrupted" 2010/5/25 Derek Fowler <dezfowler at gmail.com>> Hi Vito, > > Thanks for doing some investigation here - hopefully we can get this sorted > out. Which version of the Microsoft API are you using, I''m wondering whether > this is another case of an API change that has gone unnoticed. I''m starting > to think a suite of automated tests is in order here. > > Derek > > > On 25 May 2010 10:21, Vito Tafuni <vito at vitotafuni.com> wrote: > >> in the meanwhile i''ve found the problem with microkoft map >> in mxn.microsoft.core.js change the attachevent with this >> >> this.maps[api].AttachEvent(''onclick'', function(event){ >> >> var x = event.mapX; >> var y = event.mapY; >> var pixel = me.maps[me.api].PixelToLatLong(new >> VEPixel(x,y)); >> >> me.clickHandler(pixel.Latitude,pixel.Longitude); >> me.click.fire({''location'': new >> mxn.LatLonPoint(pixel.Latitude, pixel.Longitude)}); >> }); >> >> the clickHandler was called without arguments (so "undefined,undefined") >> and the click.fire was called with wrong args because VEPixel return >> pixel.x and pixel.y so you need PixelToLatLong to obtain Latitude and >> Longitude >> >> i''ve made as little changes as possible so i don''t know if is correct for >> you "me.maps[me.api]." inside the AttachEvent >> >> >> know i can say that the error with googlev3 api on addHandler comes to the >> fact you have not a unique way to handle events and so >> >> >> google.maps.event.addListener(map, ''click'', function(location){ >> >> me.clickHandler(location.latLng.lat(),location.latLng.lng(),location,me); >> }); >> >> doesn''t call the me.click.fire >> >> but at this point instead of put a redundant clickHandler + me.click.fire >> i hope you find a unique solution to handle events >> in the meanwhile i should suggest to move the clickHandler call in the click.fire >> for backward compatibility and use the new click.fire >> >> >> >> -Vito- >> >> >> >> >> >> -- >> ----------- >> Tafuni Vito >> vito at vitotafuni.com >> --------------------------------------------- >> "Verba volant, scripta manent... data corrupted" >> >> >> 2010/5/25 Vito Tafuni <vito at vitotafuni.com> >> >>> the problem with addHandler seems related to the fact that the function >>> uses an internal array handlers >>> >>> this.addHandler = function(fn, ctx){ >>> handlers.push({context: ctx, handler: fn}); >>> }; >>> >>> google.maps.event.addListener(map, ''click'', function(location){ >>> >>> me.clickHandler(location.latLng.lat(),location.latLng.lng(),location,me); >>> }); >>> >>> Mapstraction.prototype.clickHandler = function(lat, lon, me) { >>> this.callEventListeners(''click'', { >>> location: new LatLonPoint(lat, lon) >>> }); >>> }; >>> >>> Mapstraction.prototype.callEventListeners = function(sEventType, >>> oEventArgs) { >>> oEventArgs.source = this; >>> for(var i = 0; i < this.eventListeners.length; i++) { >>> var evLi = this.eventListeners[i]; >>> ... >>> }; >>> >>> while the callEventListeners function loops on eventListeners array >>> >>> I''m not so good with Mapstraction code (i''ve started using from >>> yesterday) so i hope some developer can help us! >>> >>> >>> -- >>> ----------- >>> Tafuni Vito >>> vito at vitotafuni.com >>> --------------------------------------------- >>> "Verba volant, scripta manent... data corrupted" >>> >>> >>> 2010/5/25 Vito Tafuni <vito at vitotafuni.com> >>> >>>> ok it seems i''m not so wrong... the problem is with microgoft map >>>> google (i''m using v3) map works fine with addEventListener >>>> >>>> but your code doesn''t work! >>>> in M the click event is triggered with position "undefined,undefined" in >>>> G the function is never called! >>>> >>>> >>>> >>>> -- >>>> ----------- >>>> Tafuni Vito >>>> vito at vitotafuni.com >>>> --------------------------------------------- >>>> "Verba volant, scripta manent... data corrupted" >>>> >>>> >>>> 2010/5/25 Pablo L?pez Escob?s <plopesc at gmail.com> >>>> >>>> Hi! >>>>> >>>>> You should use the v2 events handler. Try this: >>>>> >>>>> map.click.addHandler(function(type,map,arg){alert(arg.location)}) >>>>> >>>>> >>>>> -- >>>>> Saludos, >>>>> Pablo L?pez Escob?s >>>>> >>>>> >>>>> 2010/5/25 Vito Tafuni <vito at vitotafuni.com> >>>>> >>>>>> I don''t know where i''m wrong! >>>>>> >>>>>> <a href="javascript: >>>>>> map.addEventListener(''click'',function(p){alert(p);})">click</a><br/> >>>>>> >>>>>> the click event is correctly captured but the alert says >>>>>> "undefined,undefined" >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> ----------- >>>>>> Tafuni Vito >>>>>> vito at vitotafuni.com >>>>>> --------------------------------------------- >>>>>> "Verba volant, scripta manent... data corrupted" >>>>>> >>>>>> _______________________________________________ >>>>>> 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 >>>>> >>>>> >>>> >>> >> >> _______________________________________________ >> 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 > > _______________________________________________ > 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/20100525/0e3fdf88/attachment.htm>
Ed Freyfogle
2010-May-25 14:26 UTC
[Mapstraction] addeventlistener on click don''t give me position
we need to have one source of truth. svn or git. but not both. otherwise we end up with confusion. 2010/5/25 Vito Tafuni <vito at vitotafuni.com>> i''ve downloaded the last svn source yesterday so i don''t know about your > changes. > > hasta luego > > -- > ----------- > Tafuni Vito > vito at vitotafuni.com > --------------------------------------------- > "Verba volant, scripta manent... data corrupted" > > > 2010/5/25 Pablo L?pez Escob?s <plopesc at gmail.com> > >> Hi! >> >> It is a problem of Mapsttraction v2 mxn.microsoft.core.js file. >> I posted the mxn.microsoft.core.js file in the Git repository in December >> with this problem fixed. >> >> >> -- >> Saludos, >> Pablo L?pez Escob?s >> >> >> 2010/5/25 Derek Fowler <dezfowler at gmail.com> >> >> Hi Vito, >>> >>> Thanks for doing some investigation here - hopefully we can get this >>> sorted out. Which version of the Microsoft API are you using, I''m wondering >>> whether this is another case of an API change that has gone unnoticed. I''m >>> starting to think a suite of automated tests is in order here. >>> >>> Derek >>> >>> >>> On 25 May 2010 10:21, Vito Tafuni <vito at vitotafuni.com> wrote: >>> >>>> in the meanwhile i''ve found the problem with microkoft map >>>> in mxn.microsoft.core.js change the attachevent with this >>>> >>>> this.maps[api].AttachEvent(''onclick'', function(event){ >>>> >>>> var x = event.mapX; >>>> var y = event.mapY; >>>> var pixel = me.maps[me.api].PixelToLatLong(new >>>> VEPixel(x,y)); >>>> >>>> me.clickHandler(pixel.Latitude,pixel.Longitude); >>>> me.click.fire({''location'': new >>>> mxn.LatLonPoint(pixel.Latitude, pixel.Longitude)}); >>>> }); >>>> >>>> the clickHandler was called without arguments (so "undefined,undefined") >>>> and the click.fire was called with wrong args because VEPixel return >>>> pixel.x and pixel.y so you need PixelToLatLong to obtain Latitude and >>>> Longitude >>>> >>>> i''ve made as little changes as possible so i don''t know if is correct >>>> for you "me.maps[me.api]." inside the AttachEvent >>>> >>>> >>>> know i can say that the error with googlev3 api on addHandler comes to >>>> the fact you have not a unique way to handle events and so >>>> >>>> >>>> google.maps.event.addListener(map, ''click'', function(location){ >>>> >>>> me.clickHandler(location.latLng.lat(),location.latLng.lng(),location,me); >>>> }); >>>> >>>> doesn''t call the me.click.fire >>>> >>>> but at this point instead of put a redundant clickHandler + >>>> me.click.fire i hope you find a unique solution to handle events >>>> in the meanwhile i should suggest to move the clickHandler call in the click.fire >>>> for backward compatibility and use the new click.fire >>>> >>>> >>>> >>>> -Vito- >>>> >>>> >>>> >>>> >>>> >>>> -- >>>> ----------- >>>> Tafuni Vito >>>> vito at vitotafuni.com >>>> --------------------------------------------- >>>> "Verba volant, scripta manent... data corrupted" >>>> >>>> >>>> 2010/5/25 Vito Tafuni <vito at vitotafuni.com> >>>> >>>>> the problem with addHandler seems related to the fact that the function >>>>> uses an internal array handlers >>>>> >>>>> this.addHandler = function(fn, ctx){ >>>>> handlers.push({context: ctx, handler: fn}); >>>>> }; >>>>> >>>>> google.maps.event.addListener(map, ''click'', function(location){ >>>>> >>>>> me.clickHandler(location.latLng.lat(),location.latLng.lng(),location,me); >>>>> }); >>>>> >>>>> Mapstraction.prototype.clickHandler = function(lat, lon, me) { >>>>> this.callEventListeners(''click'', { >>>>> location: new LatLonPoint(lat, lon) >>>>> }); >>>>> }; >>>>> >>>>> Mapstraction.prototype.callEventListeners = function(sEventType, >>>>> oEventArgs) { >>>>> oEventArgs.source = this; >>>>> for(var i = 0; i < this.eventListeners.length; i++) { >>>>> var evLi = this.eventListeners[i]; >>>>> ... >>>>> }; >>>>> >>>>> while the callEventListeners function loops on eventListeners array >>>>> >>>>> I''m not so good with Mapstraction code (i''ve started using from >>>>> yesterday) so i hope some developer can help us! >>>>> >>>>> >>>>> -- >>>>> ----------- >>>>> Tafuni Vito >>>>> vito at vitotafuni.com >>>>> --------------------------------------------- >>>>> "Verba volant, scripta manent... data corrupted" >>>>> >>>>> >>>>> 2010/5/25 Vito Tafuni <vito at vitotafuni.com> >>>>> >>>>>> ok it seems i''m not so wrong... the problem is with microgoft map >>>>>> google (i''m using v3) map works fine with addEventListener >>>>>> >>>>>> but your code doesn''t work! >>>>>> in M the click event is triggered with position "undefined,undefined" >>>>>> in G the function is never called! >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> ----------- >>>>>> Tafuni Vito >>>>>> vito at vitotafuni.com >>>>>> --------------------------------------------- >>>>>> "Verba volant, scripta manent... data corrupted" >>>>>> >>>>>> >>>>>> 2010/5/25 Pablo L?pez Escob?s <plopesc at gmail.com> >>>>>> >>>>>> Hi! >>>>>>> >>>>>>> You should use the v2 events handler. Try this: >>>>>>> >>>>>>> map.click.addHandler(function(type,map,arg){alert(arg.location)}) >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> Saludos, >>>>>>> Pablo L?pez Escob?s >>>>>>> >>>>>>> >>>>>>> 2010/5/25 Vito Tafuni <vito at vitotafuni.com> >>>>>>> >>>>>>>> I don''t know where i''m wrong! >>>>>>>> >>>>>>>> <a href="javascript: >>>>>>>> map.addEventListener(''click'',function(p){alert(p);})">click</a><br/> >>>>>>>> >>>>>>>> the click event is correctly captured but the alert says >>>>>>>> "undefined,undefined" >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> ----------- >>>>>>>> Tafuni Vito >>>>>>>> vito at vitotafuni.com >>>>>>>> --------------------------------------------- >>>>>>>> "Verba volant, scripta manent... data corrupted" >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> 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 >>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>>> _______________________________________________ >>>> 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 >>> >>> _______________________________________________ >>> 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 >> >> > > _______________________________________________ > 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/20100525/2da667e8/attachment-0001.htm>
Vito Tafuni
2010-May-25 14:31 UTC
[Mapstraction] addeventlistener on click don''t give me position
I agree but i didn''t know of a git repository! http://code.google.com/p/mapstraction/source/checkout -- ----------- Tafuni Vito vito at vitotafuni.com --------------------------------------------- "Verba volant, scripta manent... data corrupted" 2010/5/25 Ed Freyfogle <edf at sloan.mit.edu>> we need to have one source of truth. svn or git. but not both. otherwise we > end up with confusion. > > > > 2010/5/25 Vito Tafuni <vito at vitotafuni.com> > >> i''ve downloaded the last svn source yesterday so i don''t know about your >> changes. >> >> hasta luego >> >> -- >> ----------- >> Tafuni Vito >> vito at vitotafuni.com >> --------------------------------------------- >> "Verba volant, scripta manent... data corrupted" >> >> >> 2010/5/25 Pablo L?pez Escob?s <plopesc at gmail.com> >> >>> Hi! >>> >>> It is a problem of Mapsttraction v2 mxn.microsoft.core.js file. >>> I posted the mxn.microsoft.core.js file in the Git repository in December >>> with this problem fixed. >>> >>> >>> -- >>> Saludos, >>> Pablo L?pez Escob?s >>> >>> >>> 2010/5/25 Derek Fowler <dezfowler at gmail.com> >>> >>> Hi Vito, >>>> >>>> Thanks for doing some investigation here - hopefully we can get this >>>> sorted out. Which version of the Microsoft API are you using, I''m wondering >>>> whether this is another case of an API change that has gone unnoticed. I''m >>>> starting to think a suite of automated tests is in order here. >>>> >>>> Derek >>>> >>>> >>>> On 25 May 2010 10:21, Vito Tafuni <vito at vitotafuni.com> wrote: >>>> >>>>> in the meanwhile i''ve found the problem with microkoft map >>>>> in mxn.microsoft.core.js change the attachevent with this >>>>> >>>>> this.maps[api].AttachEvent(''onclick'', function(event){ >>>>> >>>>> var x = event.mapX; >>>>> var y = event.mapY; >>>>> var pixel = me.maps[me.api].PixelToLatLong(new >>>>> VEPixel(x,y)); >>>>> >>>>> me.clickHandler(pixel.Latitude,pixel.Longitude); >>>>> me.click.fire({''location'': new >>>>> mxn.LatLonPoint(pixel.Latitude, pixel.Longitude)}); >>>>> }); >>>>> >>>>> the clickHandler was called without arguments (so >>>>> "undefined,undefined") >>>>> and the click.fire was called with wrong args because VEPixel return >>>>> pixel.x and pixel.y so you need PixelToLatLong to obtain Latitude and >>>>> Longitude >>>>> >>>>> i''ve made as little changes as possible so i don''t know if is correct >>>>> for you "me.maps[me.api]." inside the AttachEvent >>>>> >>>>> >>>>> know i can say that the error with googlev3 api on addHandler comes to >>>>> the fact you have not a unique way to handle events and so >>>>> >>>>> >>>>> google.maps.event.addListener(map, ''click'', function(location){ >>>>> >>>>> me.clickHandler(location.latLng.lat(),location.latLng.lng(),location,me); >>>>> }); >>>>> >>>>> doesn''t call the me.click.fire >>>>> >>>>> but at this point instead of put a redundant clickHandler + >>>>> me.click.fire i hope you find a unique solution to handle events >>>>> in the meanwhile i should suggest to move the clickHandler call in the >>>>> click.fire for backward compatibility and use the new click.fire >>>>> >>>>> >>>>> >>>>> -Vito- >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> ----------- >>>>> Tafuni Vito >>>>> vito at vitotafuni.com >>>>> --------------------------------------------- >>>>> "Verba volant, scripta manent... data corrupted" >>>>> >>>>> >>>>> 2010/5/25 Vito Tafuni <vito at vitotafuni.com> >>>>> >>>>>> the problem with addHandler seems related to the fact that the >>>>>> function uses an internal array handlers >>>>>> >>>>>> this.addHandler = function(fn, ctx){ >>>>>> handlers.push({context: ctx, handler: fn}); >>>>>> }; >>>>>> >>>>>> google.maps.event.addListener(map, ''click'', function(location){ >>>>>> >>>>>> me.clickHandler(location.latLng.lat(),location.latLng.lng(),location,me); >>>>>> }); >>>>>> >>>>>> Mapstraction.prototype.clickHandler = function(lat, lon, me) { >>>>>> this.callEventListeners(''click'', { >>>>>> location: new LatLonPoint(lat, lon) >>>>>> }); >>>>>> }; >>>>>> >>>>>> Mapstraction.prototype.callEventListeners = function(sEventType, >>>>>> oEventArgs) { >>>>>> oEventArgs.source = this; >>>>>> for(var i = 0; i < this.eventListeners.length; i++) { >>>>>> var evLi = this.eventListeners[i]; >>>>>> ... >>>>>> }; >>>>>> >>>>>> while the callEventListeners function loops on eventListeners array >>>>>> >>>>>> I''m not so good with Mapstraction code (i''ve started using from >>>>>> yesterday) so i hope some developer can help us! >>>>>> >>>>>> >>>>>> -- >>>>>> ----------- >>>>>> Tafuni Vito >>>>>> vito at vitotafuni.com >>>>>> --------------------------------------------- >>>>>> "Verba volant, scripta manent... data corrupted" >>>>>> >>>>>> >>>>>> 2010/5/25 Vito Tafuni <vito at vitotafuni.com> >>>>>> >>>>>>> ok it seems i''m not so wrong... the problem is with microgoft map >>>>>>> google (i''m using v3) map works fine with addEventListener >>>>>>> >>>>>>> but your code doesn''t work! >>>>>>> in M the click event is triggered with position "undefined,undefined" >>>>>>> in G the function is never called! >>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> ----------- >>>>>>> Tafuni Vito >>>>>>> vito at vitotafuni.com >>>>>>> --------------------------------------------- >>>>>>> "Verba volant, scripta manent... data corrupted" >>>>>>> >>>>>>> >>>>>>> 2010/5/25 Pablo L?pez Escob?s <plopesc at gmail.com> >>>>>>> >>>>>>> Hi! >>>>>>>> >>>>>>>> You should use the v2 events handler. Try this: >>>>>>>> >>>>>>>> map.click.addHandler(function(type,map,arg){alert(arg.location)}) >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> Saludos, >>>>>>>> Pablo L?pez Escob?s >>>>>>>> >>>>>>>> >>>>>>>> 2010/5/25 Vito Tafuni <vito at vitotafuni.com> >>>>>>>> >>>>>>>>> I don''t know where i''m wrong! >>>>>>>>> >>>>>>>>> <a href="javascript: >>>>>>>>> map.addEventListener(''click'',function(p){alert(p);})">click</a><br/> >>>>>>>>> >>>>>>>>> the click event is correctly captured but the alert says >>>>>>>>> "undefined,undefined" >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> -- >>>>>>>>> ----------- >>>>>>>>> Tafuni Vito >>>>>>>>> vito at vitotafuni.com >>>>>>>>> --------------------------------------------- >>>>>>>>> "Verba volant, scripta manent... data corrupted" >>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>>> 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 >>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>> >>>>> _______________________________________________ >>>>> 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 >>>> >>>> _______________________________________________ >>>> 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 >>> >>> >> >> _______________________________________________ >> 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/20100525/acf94bb4/attachment.htm>
Ed Freyfogle
2010-May-25 14:33 UTC
[Mapstraction] addeventlistener on click don''t give me position
sorry, I should have been more explicit. in my opinion the current source of truth is svn. I have no preference what we use, but we need one place for people to edit, not multiple Or at the very least we need to explain why there are multiple 2010/5/25 Vito Tafuni <vito at vitotafuni.com>> I agree but i didn''t know of a git repository! > > http://code.google.com/p/mapstraction/source/checkout > > > > -- > ----------- > Tafuni Vito > vito at vitotafuni.com > --------------------------------------------- > "Verba volant, scripta manent... data corrupted" > > > 2010/5/25 Ed Freyfogle <edf at sloan.mit.edu> > > we need to have one source of truth. svn or git. but not both. otherwise we >> end up with confusion. >> >> >> >> 2010/5/25 Vito Tafuni <vito at vitotafuni.com> >> >>> i''ve downloaded the last svn source yesterday so i don''t know about your >>> changes. >>> >>> hasta luego >>> >>> -- >>> ----------- >>> Tafuni Vito >>> vito at vitotafuni.com >>> --------------------------------------------- >>> "Verba volant, scripta manent... data corrupted" >>> >>> >>> 2010/5/25 Pablo L?pez Escob?s <plopesc at gmail.com> >>> >>>> Hi! >>>> >>>> It is a problem of Mapsttraction v2 mxn.microsoft.core.js file. >>>> I posted the mxn.microsoft.core.js file in the Git repository in >>>> December with this problem fixed. >>>> >>>> >>>> -- >>>> Saludos, >>>> Pablo L?pez Escob?s >>>> >>>> >>>> 2010/5/25 Derek Fowler <dezfowler at gmail.com> >>>> >>>> Hi Vito, >>>>> >>>>> Thanks for doing some investigation here - hopefully we can get this >>>>> sorted out. Which version of the Microsoft API are you using, I''m wondering >>>>> whether this is another case of an API change that has gone unnoticed. I''m >>>>> starting to think a suite of automated tests is in order here. >>>>> >>>>> Derek >>>>> >>>>> >>>>> On 25 May 2010 10:21, Vito Tafuni <vito at vitotafuni.com> wrote: >>>>> >>>>>> in the meanwhile i''ve found the problem with microkoft map >>>>>> in mxn.microsoft.core.js change the attachevent with this >>>>>> >>>>>> this.maps[api].AttachEvent(''onclick'', function(event){ >>>>>> >>>>>> var x = event.mapX; >>>>>> var y = event.mapY; >>>>>> var pixel = me.maps[me.api].PixelToLatLong(new >>>>>> VEPixel(x,y)); >>>>>> >>>>>> me.clickHandler(pixel.Latitude,pixel.Longitude); >>>>>> me.click.fire({''location'': new >>>>>> mxn.LatLonPoint(pixel.Latitude, pixel.Longitude)}); >>>>>> }); >>>>>> >>>>>> the clickHandler was called without arguments (so >>>>>> "undefined,undefined") >>>>>> and the click.fire was called with wrong args because VEPixel return >>>>>> pixel.x and pixel.y so you need PixelToLatLong to obtain Latitude and >>>>>> Longitude >>>>>> >>>>>> i''ve made as little changes as possible so i don''t know if is correct >>>>>> for you "me.maps[me.api]." inside the AttachEvent >>>>>> >>>>>> >>>>>> know i can say that the error with googlev3 api on addHandler comes to >>>>>> the fact you have not a unique way to handle events and so >>>>>> >>>>>> >>>>>> google.maps.event.addListener(map, ''click'', function(location){ >>>>>> >>>>>> me.clickHandler(location.latLng.lat(),location.latLng.lng(),location,me); >>>>>> }); >>>>>> >>>>>> doesn''t call the me.click.fire >>>>>> >>>>>> but at this point instead of put a redundant clickHandler + >>>>>> me.click.fire i hope you find a unique solution to handle events >>>>>> in the meanwhile i should suggest to move the clickHandler call in >>>>>> the click.fire for backward compatibility and use the new click.fire >>>>>> >>>>>> >>>>>> >>>>>> -Vito- >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> ----------- >>>>>> Tafuni Vito >>>>>> vito at vitotafuni.com >>>>>> --------------------------------------------- >>>>>> "Verba volant, scripta manent... data corrupted" >>>>>> >>>>>> >>>>>> 2010/5/25 Vito Tafuni <vito at vitotafuni.com> >>>>>> >>>>>>> the problem with addHandler seems related to the fact that the >>>>>>> function uses an internal array handlers >>>>>>> >>>>>>> this.addHandler = function(fn, ctx){ >>>>>>> handlers.push({context: ctx, handler: fn}); >>>>>>> }; >>>>>>> >>>>>>> google.maps.event.addListener(map, ''click'', function(location){ >>>>>>> >>>>>>> me.clickHandler(location.latLng.lat(),location.latLng.lng(),location,me); >>>>>>> }); >>>>>>> >>>>>>> Mapstraction.prototype.clickHandler = function(lat, lon, me) { >>>>>>> this.callEventListeners(''click'', { >>>>>>> location: new LatLonPoint(lat, lon) >>>>>>> }); >>>>>>> }; >>>>>>> >>>>>>> Mapstraction.prototype.callEventListeners = function(sEventType, >>>>>>> oEventArgs) { >>>>>>> oEventArgs.source = this; >>>>>>> for(var i = 0; i < this.eventListeners.length; i++) { >>>>>>> var evLi = this.eventListeners[i]; >>>>>>> ... >>>>>>> }; >>>>>>> >>>>>>> while the callEventListeners function loops on eventListeners array >>>>>>> >>>>>>> I''m not so good with Mapstraction code (i''ve started using from >>>>>>> yesterday) so i hope some developer can help us! >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> ----------- >>>>>>> Tafuni Vito >>>>>>> vito at vitotafuni.com >>>>>>> --------------------------------------------- >>>>>>> "Verba volant, scripta manent... data corrupted" >>>>>>> >>>>>>> >>>>>>> 2010/5/25 Vito Tafuni <vito at vitotafuni.com> >>>>>>> >>>>>>>> ok it seems i''m not so wrong... the problem is with microgoft map >>>>>>>> google (i''m using v3) map works fine with addEventListener >>>>>>>> >>>>>>>> but your code doesn''t work! >>>>>>>> in M the click event is triggered with position >>>>>>>> "undefined,undefined" in G the function is never called! >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> ----------- >>>>>>>> Tafuni Vito >>>>>>>> vito at vitotafuni.com >>>>>>>> --------------------------------------------- >>>>>>>> "Verba volant, scripta manent... data corrupted" >>>>>>>> >>>>>>>> >>>>>>>> 2010/5/25 Pablo L?pez Escob?s <plopesc at gmail.com> >>>>>>>> >>>>>>>> Hi! >>>>>>>>> >>>>>>>>> You should use the v2 events handler. Try this: >>>>>>>>> >>>>>>>>> map.click.addHandler(function(type,map,arg){alert(arg.location)}) >>>>>>>>> >>>>>>>>> >>>>>>>>> -- >>>>>>>>> Saludos, >>>>>>>>> Pablo L?pez Escob?s >>>>>>>>> >>>>>>>>> >>>>>>>>> 2010/5/25 Vito Tafuni <vito at vitotafuni.com> >>>>>>>>> >>>>>>>>>> I don''t know where i''m wrong! >>>>>>>>>> >>>>>>>>>> <a href="javascript: >>>>>>>>>> map.addEventListener(''click'',function(p){alert(p);})">click</a><br/> >>>>>>>>>> >>>>>>>>>> the click event is correctly captured but the alert says >>>>>>>>>> "undefined,undefined" >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> -- >>>>>>>>>> ----------- >>>>>>>>>> Tafuni Vito >>>>>>>>>> vito at vitotafuni.com >>>>>>>>>> --------------------------------------------- >>>>>>>>>> "Verba volant, scripta manent... data corrupted" >>>>>>>>>> >>>>>>>>>> _______________________________________________ >>>>>>>>>> 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 >>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> 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 >>>>> >>>>> _______________________________________________ >>>>> 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 >>>> >>>> >>> >>> _______________________________________________ >>> 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 >> >> > > _______________________________________________ > 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/20100525/bafc44ff/attachment-0001.htm>
Vito Tafuni
2010-May-25 14:40 UTC
[Mapstraction] addeventlistener on click don''t give me position
ok for me the problem is not the repos but the freshness of the code. so... why Pablo L?pez Escob?s changes of December are not in the repos?? i''ve found and solved a problem that would not be there!?! -- ----------- Tafuni Vito vito at vitotafuni.com --------------------------------------------- "Verba volant, scripta manent... data corrupted" 2010/5/25 Ed Freyfogle <edf at sloan.mit.edu>> sorry, I should have been more explicit. in my opinion the current source > of truth is svn. > I have no preference what we use, but we need one place for people to edit, > not multiple > > Or at the very least we need to explain why there are multiple > > > > > 2010/5/25 Vito Tafuni <vito at vitotafuni.com> > >> I agree but i didn''t know of a git repository! >> >> http://code.google.com/p/mapstraction/source/checkout >> >> >> >> -- >> ----------- >> Tafuni Vito >> vito at vitotafuni.com >> --------------------------------------------- >> "Verba volant, scripta manent... data corrupted" >> >> >> 2010/5/25 Ed Freyfogle <edf at sloan.mit.edu> >> >> we need to have one source of truth. svn or git. but not both. otherwise >>> we end up with confusion. >>> >>> >>> >>> 2010/5/25 Vito Tafuni <vito at vitotafuni.com> >>> >>>> i''ve downloaded the last svn source yesterday so i don''t know about your >>>> changes. >>>> >>>> hasta luego >>>> >>>> -- >>>> ----------- >>>> Tafuni Vito >>>> vito at vitotafuni.com >>>> --------------------------------------------- >>>> "Verba volant, scripta manent... data corrupted" >>>> >>>> >>>> 2010/5/25 Pablo L?pez Escob?s <plopesc at gmail.com> >>>> >>>>> Hi! >>>>> >>>>> It is a problem of Mapsttraction v2 mxn.microsoft.core.js file. >>>>> I posted the mxn.microsoft.core.js file in the Git repository in >>>>> December with this problem fixed. >>>>> >>>>> >>>>> -- >>>>> Saludos, >>>>> Pablo L?pez Escob?s >>>>> >>>>> >>>>> 2010/5/25 Derek Fowler <dezfowler at gmail.com> >>>>> >>>>> Hi Vito, >>>>>> >>>>>> Thanks for doing some investigation here - hopefully we can get this >>>>>> sorted out. Which version of the Microsoft API are you using, I''m wondering >>>>>> whether this is another case of an API change that has gone unnoticed. I''m >>>>>> starting to think a suite of automated tests is in order here. >>>>>> >>>>>> Derek >>>>>> >>>>>> >>>>>> On 25 May 2010 10:21, Vito Tafuni <vito at vitotafuni.com> wrote: >>>>>> >>>>>>> in the meanwhile i''ve found the problem with microkoft map >>>>>>> in mxn.microsoft.core.js change the attachevent with this >>>>>>> >>>>>>> this.maps[api].AttachEvent(''onclick'', function(event){ >>>>>>> >>>>>>> var x = event.mapX; >>>>>>> var y = event.mapY; >>>>>>> var pixel = me.maps[me.api].PixelToLatLong(new >>>>>>> VEPixel(x,y)); >>>>>>> >>>>>>> me.clickHandler(pixel.Latitude,pixel.Longitude); >>>>>>> me.click.fire({''location'': new >>>>>>> mxn.LatLonPoint(pixel.Latitude, pixel.Longitude)}); >>>>>>> }); >>>>>>> >>>>>>> the clickHandler was called without arguments (so >>>>>>> "undefined,undefined") >>>>>>> and the click.fire was called with wrong args because VEPixel return >>>>>>> pixel.x and pixel.y so you need PixelToLatLong to obtain Latitude and >>>>>>> Longitude >>>>>>> >>>>>>> i''ve made as little changes as possible so i don''t know if is correct >>>>>>> for you "me.maps[me.api]." inside the AttachEvent >>>>>>> >>>>>>> >>>>>>> know i can say that the error with googlev3 api on addHandler comes >>>>>>> to the fact you have not a unique way to handle events and so >>>>>>> >>>>>>> >>>>>>> google.maps.event.addListener(map, ''click'', function(location){ >>>>>>> >>>>>>> me.clickHandler(location.latLng.lat(),location.latLng.lng(),location,me); >>>>>>> }); >>>>>>> >>>>>>> doesn''t call the me.click.fire >>>>>>> >>>>>>> but at this point instead of put a redundant clickHandler + >>>>>>> me.click.fire i hope you find a unique solution to handle events >>>>>>> in the meanwhile i should suggest to move the clickHandler call in >>>>>>> the click.fire for backward compatibility and use the new click.fire >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> -Vito- >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> ----------- >>>>>>> Tafuni Vito >>>>>>> vito at vitotafuni.com >>>>>>> --------------------------------------------- >>>>>>> "Verba volant, scripta manent... data corrupted" >>>>>>> >>>>>>> >>>>>>> 2010/5/25 Vito Tafuni <vito at vitotafuni.com> >>>>>>> >>>>>>>> the problem with addHandler seems related to the fact that the >>>>>>>> function uses an internal array handlers >>>>>>>> >>>>>>>> this.addHandler = function(fn, ctx){ >>>>>>>> handlers.push({context: ctx, handler: fn}); >>>>>>>> }; >>>>>>>> >>>>>>>> google.maps.event.addListener(map, ''click'', function(location){ >>>>>>>> >>>>>>>> me.clickHandler(location.latLng.lat(),location.latLng.lng(),location,me); >>>>>>>> }); >>>>>>>> >>>>>>>> Mapstraction.prototype.clickHandler = function(lat, lon, me) { >>>>>>>> this.callEventListeners(''click'', { >>>>>>>> location: new LatLonPoint(lat, lon) >>>>>>>> }); >>>>>>>> }; >>>>>>>> >>>>>>>> Mapstraction.prototype.callEventListeners = function(sEventType, >>>>>>>> oEventArgs) { >>>>>>>> oEventArgs.source = this; >>>>>>>> for(var i = 0; i < this.eventListeners.length; i++) { >>>>>>>> var evLi = this.eventListeners[i]; >>>>>>>> ... >>>>>>>> }; >>>>>>>> >>>>>>>> while the callEventListeners function loops on eventListeners array >>>>>>>> >>>>>>>> I''m not so good with Mapstraction code (i''ve started using from >>>>>>>> yesterday) so i hope some developer can help us! >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> ----------- >>>>>>>> Tafuni Vito >>>>>>>> vito at vitotafuni.com >>>>>>>> --------------------------------------------- >>>>>>>> "Verba volant, scripta manent... data corrupted" >>>>>>>> >>>>>>>> >>>>>>>> 2010/5/25 Vito Tafuni <vito at vitotafuni.com> >>>>>>>> >>>>>>>>> ok it seems i''m not so wrong... the problem is with microgoft map >>>>>>>>> google (i''m using v3) map works fine with addEventListener >>>>>>>>> >>>>>>>>> but your code doesn''t work! >>>>>>>>> in M the click event is triggered with position >>>>>>>>> "undefined,undefined" in G the function is never called! >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> -- >>>>>>>>> ----------- >>>>>>>>> Tafuni Vito >>>>>>>>> vito at vitotafuni.com >>>>>>>>> --------------------------------------------- >>>>>>>>> "Verba volant, scripta manent... data corrupted" >>>>>>>>> >>>>>>>>> >>>>>>>>> 2010/5/25 Pablo L?pez Escob?s <plopesc at gmail.com> >>>>>>>>> >>>>>>>>> Hi! >>>>>>>>>> >>>>>>>>>> You should use the v2 events handler. Try this: >>>>>>>>>> >>>>>>>>>> map.click.addHandler(function(type,map,arg){alert(arg.location)}) >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> -- >>>>>>>>>> Saludos, >>>>>>>>>> Pablo L?pez Escob?s >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> 2010/5/25 Vito Tafuni <vito at vitotafuni.com> >>>>>>>>>> >>>>>>>>>>> I don''t know where i''m wrong! >>>>>>>>>>> >>>>>>>>>>> <a href="javascript: >>>>>>>>>>> map.addEventListener(''click'',function(p){alert(p);})">click</a><br/> >>>>>>>>>>> >>>>>>>>>>> the click event is correctly captured but the alert says >>>>>>>>>>> "undefined,undefined" >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> -- >>>>>>>>>>> ----------- >>>>>>>>>>> Tafuni Vito >>>>>>>>>>> vito at vitotafuni.com >>>>>>>>>>> --------------------------------------------- >>>>>>>>>>> "Verba volant, scripta manent... data corrupted" >>>>>>>>>>> >>>>>>>>>>> _______________________________________________ >>>>>>>>>>> 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 >>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> 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 >>>>>> >>>>>> _______________________________________________ >>>>>> 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 >>>>> >>>>> >>>> >>>> _______________________________________________ >>>> 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 >>> >>> >> >> _______________________________________________ >> 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/20100525/c05e55ee/attachment.htm>
Pablo López Escobés
2010-May-25 14:40 UTC
[Mapstraction] addeventlistener on click don''t give me position
I think that the idea of both repositories is not bad, but need hard work from maintainers. Git repository is where contributors post their contributions to the library, and svn repository is where maintainers should merge the different forks in order to improve the library. But all this should be explained in a docummentation page to avoid misunderstandings. -- Saludos, Pablo L?pez Escob?s 2010/5/25 Ed Freyfogle <edf at sloan.mit.edu>> sorry, I should have been more explicit. in my opinion the current source > of truth is svn. > I have no preference what we use, but we need one place for people to edit, > not multiple > > Or at the very least we need to explain why there are multiple > > > > > 2010/5/25 Vito Tafuni <vito at vitotafuni.com> > >> I agree but i didn''t know of a git repository! >> >> http://code.google.com/p/mapstraction/source/checkout >> >> >> >> -- >> ----------- >> Tafuni Vito >> vito at vitotafuni.com >> --------------------------------------------- >> "Verba volant, scripta manent... data corrupted" >> >> >> 2010/5/25 Ed Freyfogle <edf at sloan.mit.edu> >> >> we need to have one source of truth. svn or git. but not both. otherwise >>> we end up with confusion. >>> >>> >>> >>> 2010/5/25 Vito Tafuni <vito at vitotafuni.com> >>> >>>> i''ve downloaded the last svn source yesterday so i don''t know about your >>>> changes. >>>> >>>> hasta luego >>>> >>>> -- >>>> ----------- >>>> Tafuni Vito >>>> vito at vitotafuni.com >>>> --------------------------------------------- >>>> "Verba volant, scripta manent... data corrupted" >>>> >>>> >>>> 2010/5/25 Pablo L?pez Escob?s <plopesc at gmail.com> >>>> >>>>> Hi! >>>>> >>>>> It is a problem of Mapsttraction v2 mxn.microsoft.core.js file. >>>>> I posted the mxn.microsoft.core.js file in the Git repository in >>>>> December with this problem fixed. >>>>> >>>>> >>>>> -- >>>>> Saludos, >>>>> Pablo L?pez Escob?s >>>>> >>>>> >>>>> 2010/5/25 Derek Fowler <dezfowler at gmail.com> >>>>> >>>>> Hi Vito, >>>>>> >>>>>> Thanks for doing some investigation here - hopefully we can get this >>>>>> sorted out. Which version of the Microsoft API are you using, I''m wondering >>>>>> whether this is another case of an API change that has gone unnoticed. I''m >>>>>> starting to think a suite of automated tests is in order here. >>>>>> >>>>>> Derek >>>>>> >>>>>> >>>>>> On 25 May 2010 10:21, Vito Tafuni <vito at vitotafuni.com> wrote: >>>>>> >>>>>>> in the meanwhile i''ve found the problem with microkoft map >>>>>>> in mxn.microsoft.core.js change the attachevent with this >>>>>>> >>>>>>> this.maps[api].AttachEvent(''onclick'', function(event){ >>>>>>> >>>>>>> var x = event.mapX; >>>>>>> var y = event.mapY; >>>>>>> var pixel = me.maps[me.api].PixelToLatLong(new >>>>>>> VEPixel(x,y)); >>>>>>> >>>>>>> me.clickHandler(pixel.Latitude,pixel.Longitude); >>>>>>> me.click.fire({''location'': new >>>>>>> mxn.LatLonPoint(pixel.Latitude, pixel.Longitude)}); >>>>>>> }); >>>>>>> >>>>>>> the clickHandler was called without arguments (so >>>>>>> "undefined,undefined") >>>>>>> and the click.fire was called with wrong args because VEPixel return >>>>>>> pixel.x and pixel.y so you need PixelToLatLong to obtain Latitude and >>>>>>> Longitude >>>>>>> >>>>>>> i''ve made as little changes as possible so i don''t know if is correct >>>>>>> for you "me.maps[me.api]." inside the AttachEvent >>>>>>> >>>>>>> >>>>>>> know i can say that the error with googlev3 api on addHandler comes >>>>>>> to the fact you have not a unique way to handle events and so >>>>>>> >>>>>>> >>>>>>> google.maps.event.addListener(map, ''click'', function(location){ >>>>>>> >>>>>>> me.clickHandler(location.latLng.lat(),location.latLng.lng(),location,me); >>>>>>> }); >>>>>>> >>>>>>> doesn''t call the me.click.fire >>>>>>> >>>>>>> but at this point instead of put a redundant clickHandler + >>>>>>> me.click.fire i hope you find a unique solution to handle events >>>>>>> in the meanwhile i should suggest to move the clickHandler call in >>>>>>> the click.fire for backward compatibility and use the new click.fire >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> -Vito- >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> ----------- >>>>>>> Tafuni Vito >>>>>>> vito at vitotafuni.com >>>>>>> --------------------------------------------- >>>>>>> "Verba volant, scripta manent... data corrupted" >>>>>>> >>>>>>> >>>>>>> 2010/5/25 Vito Tafuni <vito at vitotafuni.com> >>>>>>> >>>>>>>> the problem with addHandler seems related to the fact that the >>>>>>>> function uses an internal array handlers >>>>>>>> >>>>>>>> this.addHandler = function(fn, ctx){ >>>>>>>> handlers.push({context: ctx, handler: fn}); >>>>>>>> }; >>>>>>>> >>>>>>>> google.maps.event.addListener(map, ''click'', function(location){ >>>>>>>> >>>>>>>> me.clickHandler(location.latLng.lat(),location.latLng.lng(),location,me); >>>>>>>> }); >>>>>>>> >>>>>>>> Mapstraction.prototype.clickHandler = function(lat, lon, me) { >>>>>>>> this.callEventListeners(''click'', { >>>>>>>> location: new LatLonPoint(lat, lon) >>>>>>>> }); >>>>>>>> }; >>>>>>>> >>>>>>>> Mapstraction.prototype.callEventListeners = function(sEventType, >>>>>>>> oEventArgs) { >>>>>>>> oEventArgs.source = this; >>>>>>>> for(var i = 0; i < this.eventListeners.length; i++) { >>>>>>>> var evLi = this.eventListeners[i]; >>>>>>>> ... >>>>>>>> }; >>>>>>>> >>>>>>>> while the callEventListeners function loops on eventListeners array >>>>>>>> >>>>>>>> I''m not so good with Mapstraction code (i''ve started using from >>>>>>>> yesterday) so i hope some developer can help us! >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> ----------- >>>>>>>> Tafuni Vito >>>>>>>> vito at vitotafuni.com >>>>>>>> --------------------------------------------- >>>>>>>> "Verba volant, scripta manent... data corrupted" >>>>>>>> >>>>>>>> >>>>>>>> 2010/5/25 Vito Tafuni <vito at vitotafuni.com> >>>>>>>> >>>>>>>>> ok it seems i''m not so wrong... the problem is with microgoft map >>>>>>>>> google (i''m using v3) map works fine with addEventListener >>>>>>>>> >>>>>>>>> but your code doesn''t work! >>>>>>>>> in M the click event is triggered with position >>>>>>>>> "undefined,undefined" in G the function is never called! >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> -- >>>>>>>>> ----------- >>>>>>>>> Tafuni Vito >>>>>>>>> vito at vitotafuni.com >>>>>>>>> --------------------------------------------- >>>>>>>>> "Verba volant, scripta manent... data corrupted" >>>>>>>>> >>>>>>>>> >>>>>>>>> 2010/5/25 Pablo L?pez Escob?s <plopesc at gmail.com> >>>>>>>>> >>>>>>>>> Hi! >>>>>>>>>> >>>>>>>>>> You should use the v2 events handler. Try this: >>>>>>>>>> >>>>>>>>>> map.click.addHandler(function(type,map,arg){alert(arg.location)}) >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> -- >>>>>>>>>> Saludos, >>>>>>>>>> Pablo L?pez Escob?s >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> 2010/5/25 Vito Tafuni <vito at vitotafuni.com> >>>>>>>>>> >>>>>>>>>>> I don''t know where i''m wrong! >>>>>>>>>>> >>>>>>>>>>> <a href="javascript: >>>>>>>>>>> map.addEventListener(''click'',function(p){alert(p);})">click</a><br/> >>>>>>>>>>> >>>>>>>>>>> the click event is correctly captured but the alert says >>>>>>>>>>> "undefined,undefined" >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> -- >>>>>>>>>>> ----------- >>>>>>>>>>> Tafuni Vito >>>>>>>>>>> vito at vitotafuni.com >>>>>>>>>>> --------------------------------------------- >>>>>>>>>>> "Verba volant, scripta manent... data corrupted" >>>>>>>>>>> >>>>>>>>>>> _______________________________________________ >>>>>>>>>>> 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 >>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> 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 >>>>>> >>>>>> _______________________________________________ >>>>>> 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 >>>>> >>>>> >>>> >>>> _______________________________________________ >>>> 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 >>> >>> >> >> _______________________________________________ >> 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/20100525/2a6d6176/attachment-0001.htm>
Vito Tafuni
2010-May-25 15:08 UTC
[Mapstraction] addeventlistener on click don''t give me position
ok but i think that simple and needed changes had to be applyed asap to the svn repository.>From a user point of view one can''t download two repos just to see whatworks better!! we risk of having a slow stable repos and a fast testing one instead of a user repos and a developer one may be i''m wrong... -- ----------- Tafuni Vito vito at vitotafuni.com --------------------------------------------- "Verba volant, scripta manent... data corrupted" 2010/5/25 Pablo L?pez Escob?s <plopesc at gmail.com>> I think that the idea of both repositories is not bad, but need hard work > from maintainers. > > Git repository is where contributors post their contributions to the > library, and svn repository is where maintainers should merge the different > forks in order to improve the library. > > But all this should be explained in a docummentation page to avoid > misunderstandings. > > > > -- > Saludos, > Pablo L?pez Escob?s > > > 2010/5/25 Ed Freyfogle <edf at sloan.mit.edu> > >> sorry, I should have been more explicit. in my opinion the current source >> of truth is svn. >> I have no preference what we use, but we need one place for people to >> edit, not multiple >> >> Or at the very least we need to explain why there are multiple >> >> >> >> >> 2010/5/25 Vito Tafuni <vito at vitotafuni.com> >> >>> I agree but i didn''t know of a git repository! >>> >>> http://code.google.com/p/mapstraction/source/checkout >>> >>> >>> >>> -- >>> ----------- >>> Tafuni Vito >>> vito at vitotafuni.com >>> --------------------------------------------- >>> "Verba volant, scripta manent... data corrupted" >>> >>> >>> 2010/5/25 Ed Freyfogle <edf at sloan.mit.edu> >>> >>> we need to have one source of truth. svn or git. but not both. otherwise >>>> we end up with confusion. >>>> >>>> >>>> >>>> 2010/5/25 Vito Tafuni <vito at vitotafuni.com> >>>> >>>>> i''ve downloaded the last svn source yesterday so i don''t know about >>>>> your changes. >>>>> >>>>> hasta luego >>>>> >>>>> -- >>>>> ----------- >>>>> Tafuni Vito >>>>> vito at vitotafuni.com >>>>> --------------------------------------------- >>>>> "Verba volant, scripta manent... data corrupted" >>>>> >>>>> >>>>> 2010/5/25 Pablo L?pez Escob?s <plopesc at gmail.com> >>>>> >>>>>> Hi! >>>>>> >>>>>> It is a problem of Mapsttraction v2 mxn.microsoft.core.js file. >>>>>> I posted the mxn.microsoft.core.js file in the Git repository in >>>>>> December with this problem fixed. >>>>>> >>>>>> >>>>>> -- >>>>>> Saludos, >>>>>> Pablo L?pez Escob?s >>>>>> >>>>>> >>>>>> 2010/5/25 Derek Fowler <dezfowler at gmail.com> >>>>>> >>>>>> Hi Vito, >>>>>>> >>>>>>> Thanks for doing some investigation here - hopefully we can get this >>>>>>> sorted out. Which version of the Microsoft API are you using, I''m wondering >>>>>>> whether this is another case of an API change that has gone unnoticed. I''m >>>>>>> starting to think a suite of automated tests is in order here. >>>>>>> >>>>>>> Derek >>>>>>> >>>>>>> >>>>>>> On 25 May 2010 10:21, Vito Tafuni <vito at vitotafuni.com> wrote: >>>>>>> >>>>>>>> in the meanwhile i''ve found the problem with microkoft map >>>>>>>> in mxn.microsoft.core.js change the attachevent with this >>>>>>>> >>>>>>>> this.maps[api].AttachEvent(''onclick'', function(event){ >>>>>>>> >>>>>>>> var x = event.mapX; >>>>>>>> var y = event.mapY; >>>>>>>> var pixel = me.maps[me.api].PixelToLatLong(new >>>>>>>> VEPixel(x,y)); >>>>>>>> >>>>>>>> me.clickHandler(pixel.Latitude,pixel.Longitude); >>>>>>>> me.click.fire({''location'': new >>>>>>>> mxn.LatLonPoint(pixel.Latitude, pixel.Longitude)}); >>>>>>>> }); >>>>>>>> >>>>>>>> the clickHandler was called without arguments (so >>>>>>>> "undefined,undefined") >>>>>>>> and the click.fire was called with wrong args because VEPixel return >>>>>>>> pixel.x and pixel.y so you need PixelToLatLong to obtain Latitude and >>>>>>>> Longitude >>>>>>>> >>>>>>>> i''ve made as little changes as possible so i don''t know if is >>>>>>>> correct for you "me.maps[me.api]." inside the AttachEvent >>>>>>>> >>>>>>>> >>>>>>>> know i can say that the error with googlev3 api on addHandler comes >>>>>>>> to the fact you have not a unique way to handle events and so >>>>>>>> >>>>>>>> >>>>>>>> google.maps.event.addListener(map, ''click'', function(location){ >>>>>>>> >>>>>>>> me.clickHandler(location.latLng.lat(),location.latLng.lng(),location,me); >>>>>>>> }); >>>>>>>> >>>>>>>> doesn''t call the me.click.fire >>>>>>>> >>>>>>>> but at this point instead of put a redundant clickHandler + >>>>>>>> me.click.fire i hope you find a unique solution to handle events >>>>>>>> in the meanwhile i should suggest to move the clickHandler call in >>>>>>>> the click.fire for backward compatibility and use the new >>>>>>>> click.fire >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> -Vito- >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> ----------- >>>>>>>> Tafuni Vito >>>>>>>> vito at vitotafuni.com >>>>>>>> --------------------------------------------- >>>>>>>> "Verba volant, scripta manent... data corrupted" >>>>>>>> >>>>>>>> >>>>>>>> 2010/5/25 Vito Tafuni <vito at vitotafuni.com> >>>>>>>> >>>>>>>>> the problem with addHandler seems related to the fact that the >>>>>>>>> function uses an internal array handlers >>>>>>>>> >>>>>>>>> this.addHandler = function(fn, ctx){ >>>>>>>>> handlers.push({context: ctx, handler: fn}); >>>>>>>>> }; >>>>>>>>> >>>>>>>>> google.maps.event.addListener(map, ''click'', function(location){ >>>>>>>>> >>>>>>>>> me.clickHandler(location.latLng.lat(),location.latLng.lng(),location,me); >>>>>>>>> }); >>>>>>>>> >>>>>>>>> Mapstraction.prototype.clickHandler = function(lat, lon, me) { >>>>>>>>> this.callEventListeners(''click'', { >>>>>>>>> location: new LatLonPoint(lat, lon) >>>>>>>>> }); >>>>>>>>> }; >>>>>>>>> >>>>>>>>> Mapstraction.prototype.callEventListeners = function(sEventType, >>>>>>>>> oEventArgs) { >>>>>>>>> oEventArgs.source = this; >>>>>>>>> for(var i = 0; i < this.eventListeners.length; i++) { >>>>>>>>> var evLi = this.eventListeners[i]; >>>>>>>>> ... >>>>>>>>> }; >>>>>>>>> >>>>>>>>> while the callEventListeners function loops on eventListeners array >>>>>>>>> >>>>>>>>> I''m not so good with Mapstraction code (i''ve started using from >>>>>>>>> yesterday) so i hope some developer can help us! >>>>>>>>> >>>>>>>>> >>>>>>>>> -- >>>>>>>>> ----------- >>>>>>>>> Tafuni Vito >>>>>>>>> vito at vitotafuni.com >>>>>>>>> --------------------------------------------- >>>>>>>>> "Verba volant, scripta manent... data corrupted" >>>>>>>>> >>>>>>>>> >>>>>>>>> 2010/5/25 Vito Tafuni <vito at vitotafuni.com> >>>>>>>>> >>>>>>>>>> ok it seems i''m not so wrong... the problem is with microgoft map >>>>>>>>>> google (i''m using v3) map works fine with addEventListener >>>>>>>>>> >>>>>>>>>> but your code doesn''t work! >>>>>>>>>> in M the click event is triggered with position >>>>>>>>>> "undefined,undefined" in G the function is never called! >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> -- >>>>>>>>>> ----------- >>>>>>>>>> Tafuni Vito >>>>>>>>>> vito at vitotafuni.com >>>>>>>>>> --------------------------------------------- >>>>>>>>>> "Verba volant, scripta manent... data corrupted" >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> 2010/5/25 Pablo L?pez Escob?s <plopesc at gmail.com> >>>>>>>>>> >>>>>>>>>> Hi! >>>>>>>>>>> >>>>>>>>>>> You should use the v2 events handler. Try this: >>>>>>>>>>> >>>>>>>>>>> map.click.addHandler(function(type,map,arg){alert(arg.location)}) >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> -- >>>>>>>>>>> Saludos, >>>>>>>>>>> Pablo L?pez Escob?s >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> 2010/5/25 Vito Tafuni <vito at vitotafuni.com> >>>>>>>>>>> >>>>>>>>>>>> I don''t know where i''m wrong! >>>>>>>>>>>> >>>>>>>>>>>> <a href="javascript: >>>>>>>>>>>> map.addEventListener(''click'',function(p){alert(p);})">click</a><br/> >>>>>>>>>>>> >>>>>>>>>>>> the click event is correctly captured but the alert says >>>>>>>>>>>> "undefined,undefined" >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> -- >>>>>>>>>>>> ----------- >>>>>>>>>>>> Tafuni Vito >>>>>>>>>>>> vito at vitotafuni.com >>>>>>>>>>>> --------------------------------------------- >>>>>>>>>>>> "Verba volant, scripta manent... data corrupted" >>>>>>>>>>>> >>>>>>>>>>>> _______________________________________________ >>>>>>>>>>>> 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 >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> 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 >>>>>>> >>>>>>> _______________________________________________ >>>>>>> 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 >>>>>> >>>>>> >>>>> >>>>> _______________________________________________ >>>>> 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 >>>> >>>> >>> >>> _______________________________________________ >>> 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 >> >> > > _______________________________________________ > 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/20100525/394fa6b1/attachment-0001.htm>