nojunksam at email2me.net
2010-Feb-22 16:01 UTC
[Mapstraction] using LatLonPoint to convert from GLatLng
I am trying to add the following to the google provider code to allow support for clicking on a polyline. GEvent.addListener(polyLine, "click", function(clickLocation) { var clickArgs = new mxn.LatLonPoint(); clickArgs.fromProprietary(this.api, clickLocation); me.click.fire(clickArgs); }); "click", function(clickLocation) { var clickArgs = new mxn.LatLonPoint(); clickArgs.fromProprietary(this.api, clickLocation); me.click.fire(clickArgs); }); var clickArgs = new mxn.LatLonPoint(); clickArgs.fromProprietary(this.api, clickLocation); me.click.fire(clickArgs); }); this.api, clickLocation); me.click.fire(clickArgs); }); The problem is that "this.api" is not valid in the call to fromProprietary as I am in the polyline object. How do you use the LatLonPoint from within other objects other than the map? I have tried using the click event code from within the map, but the location is not supplied so the click on the polyline is required in the google case. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mapstraction.com/pipermail/mapstraction-mapstraction.com/attachments/20100222/3010e2d5/attachment.htm>
Derek Fowler
2010-Feb-22 16:30 UTC
[Mapstraction] using LatLonPoint to convert from GLatLng
You just need to change this.api for "google". Would be good for it to pass the same arg as the map click event though i.e. me.click.fire({''location'':clickArgs}); Derek On 22 February 2010 16:01, <nojunksam at email2me.net> wrote:> I am trying to add the following to the google provider code to allow > support for clicking on a polyline. > > GEvent.addListener(polyLine, > "click", function(clickLocation) { > var clickArgs = new mxn.LatLonPoint(); > clickArgs.fromProprietary( > this.api, clickLocation); > me.click.fire(clickArgs); > }); > > > The problem is that "this.api" is not valid in the call to fromProprietary > as I am in the polyline object. How do you use the LatLonPoint from within > other objects other than the map? > > I have tried using the click event code from within the map, but the > location is not supplied so the click on the polyline is required in the > google case. > > > > _______________________________________________ > 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/20100222/cde87581/attachment.htm>