[OpenLayers-Users] Help dealing with popup clicks verse click handlers

Stephen Woodbridge woodbri at swoodbridge.com
Tue May 27 12:28:37 EDT 2008


Kusum wrote:
> why don't u use hover event to see popup on marker instead of using click.

That might be useful eventually, but it can be very annoying also if the 
hover time is too small and windows popup as you are trying to do 
something else. Anyway, its a good thought and I will keep it in mind, 
but right now I just want to understand what is happening with the 
current code, especially if I have a misunderstanding on how to use it 
or if I have found a bug.

Thanks,
   -Steve

> --------------------------------------------------
> From: "Stephen Woodbridge" <woodbri at swoodbridge.com>
> Sent: Tuesday, May 27, 2008 6:28 AM
> To: "Christopher Schmidt" <crschmidt at metacarta.com>
> Cc: "openlayers user list" <users at openlayers.org>
> Subject: Re: [OpenLayers-Users] Help dealing with popup clicks verse 
> click handlers
> 
>> Christopher Schmidt wrote:
>>> On Mon, May 26, 2008 at 07:11:24PM -0500, Stephen Woodbridge wrote:
>>>> Hi all,
>>>>
>>>> I have a marker layer that which is working great. I just added a click
>>>> handler that reverse geocodes on a click and adds a marker at the click
>>>> point and populates the popup with the XML  response. This is all
>>>> working great EXCEPT that when I click on the icons to open or close a
>>>> popup, that click is propagating to the click handler causing another
>>>> marker to be added.
>>>>
>>>> How to I control or stop this?
>>>
>>> Return false or OpenLayers.Event.stop(evt); inside your marker click
>>> handler. (I can't remember which it is; one of them should do it, I
>>> don't know which.)
>>>
>>> Regards,
>>
>> Thanks,
>>
>> I was already calling OpenLayers.Event.stop(evt); and added return false
>> for good measure, but without success.
>>
>> I just found another symptom that might be relevant, which is that this
>> behavior only happens UNTIL I do a click drag on the map, then it
>> behaves as expected. Opening a popup that causes a pan does not fix the
>> problem.
>>
>> Sorry I meant to post the url in the last message:
>>
>> http://imaptools.com/maps2/tiger.html
>>
>> To reproduce:
>>
>> enter an address like: 11 radcliffe rd, n chelmsford, ma 01863
>> click Go
>> Click on the Red Marker you will get an aqua marker where you click,
>> click on the close button and you will get another aqua marker.
>>
>> Now, reload the page and repeat, BUT after you click Go, do a click drag
>> first and then will not get the extra markers.
>>
>> -Steve
>> _______________________________________________
>> Users mailing list
>> Users at openlayers.org
>> http://openlayers.org/mailman/listinfo/users 
> 
> 




More information about the Users mailing list