[OpenLayers-Users] How to transfer parameters in marker click event?

BenJamin2007 ukliming at hotmail.com
Thu Oct 18 15:35:10 EDT 2007


well,  good job...




Christopher Schmidt-4 wrote:
> 
> On Tue, Oct 16, 2007 at 05:00:03PM +0800, Yang Zhaohui wrote:
>> Hello dear sir,
>> I have a question to consult you.Referencing to the example of adding
>> a Marker with an AnchoredBubble popup,I implete a demo. I use WFS to
>> query some data.And I make the popup display the data.It needs to
>> transfer  some parameters.But when I change the function registerd on
>> the marker,
>> It returns wrong.The codes are as follows.What I change is that
>> "marker.events.register("mousedown", marker, mousedown(evt,str));".
> 
> The third argument to 'register' is a function -- you can not pass
> parameters to it. The second argument is an object -- if you want to
> pass a string, you should probably make the second parameter:
> 
>  { 'marker': marker, 'string': str }
> 
> Then in mousedown, you can reference:
>    this.marker
>    this.string
> 
> To get the data back out.   
> 
> Regards,
> -- 
> Christopher Schmidt
> MetaCarta
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-transfer-parameters-in-marker-click-event--tf4632835.html#a13282017
Sent from the OpenLayers Users mailing list archive at Nabble.com.




More information about the Users mailing list