Browse Source

드론 위치 조정

pull/2/head
sanguu516(박상현) 1 year ago
parent
commit
a84bcacc06
  1. 28
      src/components/map/nhn/NMapMarker.js

28
src/components/map/nhn/NMapMarker.js

@ -71,7 +71,33 @@ export const NMapMarker = props => {
props.marker.remove();
}
props.map.flyTo({ center: position, zoom: 14 });
const bounds = new mapboxgl.LngLatBounds(
props.data[0][0],
props.data[0][1]
);
// Extend the 'LngLatBounds' to include every coordinate in the bounds result.
// bounds.extend();
// props.map.fitBounds(bounds, {
// padding: {
// top: 0,
// right: 0,
// bottom: 400, // 하단에 패딩 추가
// left: 350
// },
// zoom: 13
// });
props.map.flyTo({
center: position,
zoom: 13,
padding: {
top: 0,
right: 0,
bottom: 400, // 하단에 패딩 추가
left: 350
}
});
const newMarker = new mapboxgl.Marker(el)
.setLngLat(position)

Loading…
Cancel
Save