기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.
물류 맵을 생성하는 방법
TravelModes 기능을 사용하면 Amazon Location Service를 사용하여 로지스틱 맵을 구축할 수 있습니다. TravelModes는 관련 도로 제한과 함께 트럭 탐색에 대한 관련 라우팅 정보를 표시합니다. Transit TravelMode를 사용하여 대중 교통 세부 정보를 표시합니다.
Truck TravelMode를 사용하여 맵 생성
이 예제에서는 로 로 로 로 로 맵TruckTravelMode을 생성하는 방법을 보여줍니다.
- index.html
-
<!DOCTYPE html>
<html lang="en">
<head>
<title>Truck Map</title>
<meta charset='utf-8'>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel='stylesheet' href='https://unpkg.com/maplibre-gl@5.x/dist/maplibre-gl.css' />
<script src='https://unpkg.com/maplibre-gl@5.x/dist/maplibre-gl.js'></script>
</head>
<body style="margin: 0; padding: 0;">
<div id="map" style="width: 100%; height: 100vh;"></div>
<script>
const apiKey = "Add Your Api Key";
const mapStyle = "Standard";
const awsRegion = "us-east-1";
const map = new maplibregl.Map({
container: 'map',
style: `https://maps.geo.${awsRegion}.amazonaws.com/v2/styles/${mapStyle}/descriptor?travel-modes=Truck&key=${apiKey}`,
center: [-74.0060 ,40.7128],
zoom: 12,
validateStyle: false, // Disable style validation for faster map load
});
</script>
</body>
</html>
- style.css
-
body {
margin: 0;
padding: 0;
}
#map {
width: 100%;
height: 100vh;
}