As geocodezip pointed out, the standard drag events still work on mobile. However, I prefer a different approach. Using drag events on touch devices feels counter intuitive. The users thumb is on the pointer and they cannot see where they drop it. Users need to drag the map, and also drag the pointer, which is a hassle on a small screen.
I've found a solution with a centered image overlay, without using images.
The HTML of my map is as follows:
<div id="map"> <div id="map_canvas" style="width:100%; height:400px"></div> <div id="cross"></div> </div>
Then I place the cross div over the map like so:
#map { position: relative; } #cross { z-index: 9999 !important; position: absolute; top: 50%; width: 100px; height: 100px; left: 50%; margin-left: -50px; margin-top: -50px; display: block; }
Then I create a crosshair with some CSS-magic:
#cross:before, #cross:after { content: ""; position: absolute; z-index: -1; background: #d00; opacity: .5; } #cross:before { left: 50%; width: 30%; margin-left: -15%; height: 100%; opacity: .5; } #cross:after { top: 50%; height: 30%; margin-top: -15%; width: 100%; opacity: .5; }
By using ´pointer-events:none´ in CSS, any mouse or touch events should pass right through. Haven't tested in legacy browsers though.
#cross, #cross:before, #cross:after { pointer-events: none; }
Please find my complete solution here: http://jsfiddle.net/4vrzgrx1/2/
My answer builds on this related question: Google Maps transparent image overlay
Hope this can be useful for some people.