매핑합니다. 가능 모두 중간막 대해 다르게 특정 이미지에 D * EFAULT 마커 *를 변경하는 난 "image2.jpeg을 나타내는"image1.jpeg "및 제 중간막을 나타내는 제 중간막을한다고 가정하자 ". 당신은 마커를로드해야하는 이미지를 결정하는 IF
문을 수행 할 것이 코드에 난 내 특정 이미지에 마커를 변경할 수 있습니다 는 사용자 입력 <strong>두 개의 좌표,</strong>, 그것은 설치 <strong>두 개의 마커</strong>과 라인 맵이 <strong>방향</strong>을 표시 할 때, 어떤이 코드가하는 API
<html>
<head>
<meta charset="utf-8">
<title>Google Maps JavaScript API v3 Example: Marker Animations</title>
<link href="/maps/documentation/javascript/examples/default.css" rel="stylesheet">
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
<script>
// var center = new google.maps.LatLng(52.12, -3.2); //center of the map
var center = new google.maps.LatLng(<?php echo $_Mylat?>, <?php echo $_Mylon?>);
var a = [
new google.maps.LatLng(<?php echo $_Mylat?>, <?php echo $_Mylon?>),
new google.maps.LatLng(<?php echo $_Mylat2?>, <?php echo $_Mylon2?>)
];
var marker;
var map;
function initialize() {
var mapOptions = {
zoom: 13,
mapTypeId: google.maps.MapTypeId.ROADMAP,
center: center
};
map = new google.maps.Map(document.getElementById('map_canvas'),
mapOptions);
for (var i=0; i<a.length;i++)
{
marker = new google.maps.Marker({
map:map,
draggable:true,
animation: google.maps.Animation.DROP,
position: a[i]
});
}
var flightPlanCoordinates = [
new google.maps.LatLng(<?php echo $_Mylat?>, <?php echo $_Mylon?>),
new google.maps.LatLng(<?php echo $_Mylat2?>, <?php echo $_Mylon2?>)
];
var flightPath = new google.maps.Polyline({
path: flightPlanCoordinates,
strokeColor: '#FF0000',
strokeOpacity: 1.0,
strokeWeight: 2
});
flightPath.setMap(map);
}
</script>
</head>
<body onload="initialize()">
<div id="map_canvas" style="width: 500px; height: 400px;">map div</div>
</body>
</html>
, 감사
https://developers.google.com/maps/documentation/javascript/overlays # Icons) – Rafe