Master
Master

Reputation: 110

handle click event of marker for openlayers mobile

i have integrate openlayer map for my sencha touch application. and, add marker on particular place. i am able to handle click event of markers, but as soon as i add OpenLayers.Control.Navigation() marker click event not worked in mobile but it worked in my browser.

i want both navigation of my map and handle click event of marker for mobile.

Upvotes: 3

Views: 2663

Answers (1)

Tejas
Tejas

Reputation: 928

Try touchstart event as below instead of click event,

mark.events.register( 'touchstart', placeMarker, clickMarker );

function clickMarker() {
    popup = new OpenLayers.Popup("chicken",
                                 new OpenLayers.LonLat(long,lat),
                                 new OpenLayers.Size(120,50),
                                 add,
                                 true);

    map.addPopup(popup);
}

This will work in mobile only on marker tap event, not works in browser. Maybe this will help you.

Upvotes: 2

Related Questions