1
마커의 MVCArray에서 위도/경도를 가져 오는 함수를 만들고 있습니다. 이 기능은 다음과 같습니다. 그러나 mapData 배열의 각 객체에는 lat/lng와 함께 기본 객체의 프로토 타입이 포함됩니다. 나는 hasOwnProperty로 놀았지만 많은 행운이 없었다. 나는 여기서 분명히 잘못된 것을하고 있습니까?배열에 포함 된 객체 프로토 타입
function prepareMarkers() {
var mapData = [];
// All we need from our markers list is the coordinates of the marker and title if it has one
markers.forEach(function(elem, index) {
mapData.push({
lat: elem.getPosition().lat(),
lng: elem.getPosition().lng()
});
});
return mapData;
}
네를, 나는, 선명도 주셔서 감사합니다 걱정 무엇인지 확실하지. – Beor