// Setup map
var polymap = L.map('map').setView([51.932994, 4.509373], 14);
// Setup tilelayer
var mapquestUrl = 'http://{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.png',
subDomains = ['otile1', 'otile2', 'otile3', 'otile4'],
mapquestAttrib = 'Data, imagery and map information provided by <a href="http://open.mapquest.co.uk" target="_blank">MapQuest</a>,'
+ '<a href="http://www.openstreetmap.org/" target="_blank">OpenStreetMap</a> and contributors.';
var osm = L.tileLayer(mapquestUrl, {
attribution: mapquestAttrib,
subdomains: subDomains
});
polymap.addLayer(osm);
polymap.on('mousedown touchstart', function onMouseDown(event) {
alert("start");
});
傳單通常應火Touchstart事件,因爲它與MouseDown事件一樣。但使用手機,我沒有發生任何事件。
有人可以告訴我,如果在代碼中有任何錯誤,可以防止touchevent被解僱嗎?
在此先感謝。
所以,這似乎是關於MultipolygonField小部件的答案是[我的問題](http://stackoverflow.com/questions/37896208/leaflet-multipolygonfield-widget-not-receiving-touch-events),其中一個無法在手機上創建點? – raratiru 2016-06-18 11:40:24