[mapserver-users] map mouseclick snafu

Ben Thompson benftee at gmail.com
Tue Feb 19 13:34:36 EST 2008


Thanks for the help! Ii got it working...for some reason beyond me the code
below did not do the job, but, this slightly different code works:

    if (window.event) //ms model-IE
        event.cancelBubble=true
    else if (e.stopPropagation) //w3c model-FF
        e.stopPropagation()

???

On Feb 18, 2008 3:00 PM, Paul Spencer <pspencer at dmsolutions.ca> wrote:

> In the code that handles the mouse click on the menu, you need to stop
> the event from propagating [1].  If you are using a javascript
> framework such as prototype [2], it will probably have such a
> mechanism (in prototype, for instance, you call Event.stop(evt)).  If
> you are not using a framework, you will need to add the code for
> stopping the event, this is what prototype uses:
>
> if (evt.preventDefault) {
>   evt.preventDefault();
>   evt.stopPropagation();
> } else {
>   evt.returnValue = false;
>   evt.cancelBubble = true;
> }
>
> The quirksmode site has some good information general information
> about javascript events [3].
>
> Cheers
>
> Paul
>
> [1] http://www.quirksmode.org/js/events_order.html
> [2] http://www.prototypejs.org/
> [3] http://www.quirksmode.org/js/introevents.html
>
>
> On 18-Feb-08, at 2:31 PM, Ben Thompson wrote:
>
> > we have some dropdown menus above the map area. each item consisting
> > of an <a href=xxx>
> > problem is, the menus overlay the map when unrolled and for some
> > reason the map gets the mouseclick too, causing it to repeat
> > applying whatever tool was last used (zoom in, etc). How to tell the
> > map not to do this (i.e., disable active tool), or, better, how to
> > make it not get clicked in the first place?
> >
> > thanx,
> > Ben Thompson
> > _______________________________________________
> > mapserver-users mailing list
> > mapserver-users at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
>
> __________________________________________
>
>    Paul Spencer
>    Chief Technology Officer
>    DM Solutions Group Inc
>    http://www.dmsolutions.ca/
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20080219/a30af222/attachment.html


More information about the mapserver-users mailing list