Google Maps API Mousemove on Touch Issue
Mousemove event is not triggering on Touch devices
by Abid Shaik
HTML
<script src="http://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&.js"></script>
<button id="clear">
Clear Log
</button>
<div id="console">
Log goes here
</div>
<div id="map_canvas" style="height:600px"></div>
CSS
#console {
width: 600px;
height: 200px;
background-color: blue;
color: #fff;
margin-bottom: 10px;
overflow: auto;
}
#clear {
margin-bottom: 10px;
}
JavaScript
function init() {
$("#clear").on("click", function() {
$("#console").html("Log goes here")
});
var mapOptions = {
zoom: 14,
center: new google.maps.LatLng(35.7803162, -78.639854),
mapTypeId: google.maps.MapTypeId.HYBRID,
draggable: false,
gestureHandling: "greedy"
};
var map = new google.maps.Map(document.getElementById('map_canvas'), mapOptions);
(function(map) {
var g = google.maps;
g.event.addListener(map, 'mousemove', function(e) {
//console.log("mouse Move");
$("#console").append("Mouse Move");
});
})(map)
}