6

Si è verificato un problema relativo a API di Google Maps V3. Il problema è che mentre trasciniamo il marker, anche la mappa inizia a trascinare.Internet Explorer + Windows8 Problemi relativi al touchscreen

Stiamo riscontrando questo problema SOLO su schermi tattili in Ambiente Windows 8 + Internet Explorer, relativo a schermi NORMAL/Schermi mobili - IPaid/altri browser (Safari e FireFox).

Abbiamo usato sotto soluzione, ma genera un errore (eval javascript error) in Internet Explorer9 e 10:

google.maps.event.addListener(marker, 'dragstart', function(){ 
    mapObject.setOptions({ draggable: false }); 
}); 
google.maps.event.addListener(marker, 'dragend', function(){ 
    mapObject.setOptions({ draggable: true }); 
}); 

Sample code is here.

abbiamo anche segnalato questo problema qui: gmaps-api-issues

EDIT:

Abbiamo un inviato un related question anche qui.

risposta

4

Un po 'di successo Ultimo (la mappa si muove ancora un po' ma può essere ignorata al momento)!

dichiarata due variabili:

var isAnyMarkerIsInDraggingState = false;// if a marker is in drag state this value will be TRUE otherwise FALSE 
var mapCenterPositionAtTheTimeWhenMarkerWasDragged;// Map Center Position 

Quando marcatore viene trascinato:

google.maps.event.addListener(objMarker, 'dragstart', function() { 
     // Store map center position when a marker is dragged 
     mapCenterPositionAtTheTimeWhenMarkerWasDragged = mapObject.getCenter(); 
     isAnyMarkerIsInDraggingState = true; 
    }); 

Quando Marker viene interrotta (trascina le estremità):

google.maps.event.addListener(objMarker, 'dragend', function() { 
    // Make Map draggable 
    // Set isAnyMarkerIsInDraggingState = false. Because no marker is in drag state 
    mapObject.setOptions({ draggable: true }); 
    isAnyMarkerIsInDraggingState = false; 
}); 
.210

quando la mappa trascinamento inizia:

google.maps.event.addListener(mapObject, 'dragstart', function() { 
    // isAnyMarkerIsInDraggingState = true: means the user is dragging a marker. 
    // If the user is dragging the Marker then don't allow the Map to be Dragged 
    if (isAnyMarkerIsInDraggingState) { 
     mapObject.setOptions({ draggable: false }); 
    } 
}); 

Quando Map è in stato di trascinamento:

google.maps.event.addListener(mapObject, 'drag', function() { 
    // isAnyMarkerIsInDraggingState = true: means the user is dragging a marker. 
    // If the user is dragging the Marker then don't allow the Map to be Dragged and set its CenterPosition 
    // to mapCenterPositionAtTheTimeWhenMarkerWasDragged 

    if (isAnyMarkerIsInDraggingState) { 
     mapObject.setCenter(mapCenterPositionAtTheTimeWhenMarkerWasDragged); 
    } 
}); 

Complete sample code is here.