Google지도 마커를 (dom-repeat에서) on-google-map-marker-dragend 이벤트와 함께 사용하고 있습니다.현재 Google지도 마커 위치가 올바르지 않습니다.
드래그가 완료된 후 마커의 현재 위치를 가져 오려고하지만 마커의 위치 만 가져옵니다. 현재 마커가 끌기 전에 드래그되어 이동되었습니다.
<google-map zoom="15" id="map" style="height: 20em" api-key="[[apiKey]]" fit-to-markers>
<template is="dom-repeat" items="[[markers]]" as="mapMarker">
<google-map-marker on-google-map-marker-click="inform" on-google-map-marker-dragend="inform" click-events="true" draggable="true" drag-events="true" latitude="{{mapMarker.latitude}}" longitude="{{mapMarker.longitude}}">
</google-map-marker>
</template>
</google-map>
방법은 더 나은 이해를위한
이inform: function(event){
// this is not the current position after drag end...
console.log(event.model.mapMarker.latitude);
console.log(event.target.latitude);
this.$.userInformationLatitude.innerHTML = event.model.mapMarker.latitude;
this.$.userInformationLongitude.innerHTML = event.model.mapMarker.longitude;
}
예 : 내가 위도에서 내 마커를 드래그 : 0 경도 : 끌기가 완료된 후 공 뉴욕, 내가 값을 얻을 위도 : 0 경도 : 0, 뉴욕의 경도 및 위도 아닙니다.
시도 항목 = "{{마커}}"당신이뿐만 = "mapMarker"사용 위도을 제거 할 때 또한 무슨 일이 일어나고 있는지 = "{{item.latitude}}". –