1

I'm rebuilding a working GoogleMaps Api v3 site to use Openlayers (3/4).

I want to make vector points (coming from a Postgis table) draggable by rightclicking them, so that they can be moved (translated) on the map to another position. The new position should then be updated in the database (by calling a php-script and passing the new position).

I want to use a rightclick instead of a singleclick or click to prevent users from changing positions accidentally while dragging around the map. As this could occur in the drag-features example. On our GoogleMaps site this works perfect and users feel fine with rightclicking to make features draggable.

I was looking around to find a solution, since Openlayers until now does not offer a rightclick event. The only good example for rightclicking that always appears is the ol3-contextmenu.

Is this really the only work around? I don't need and I don't want to use context menus.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.