나는 다음과 같은 자바 스크립트가 다음 생산이 Google지도 정보창의 스타일을 지정하려면 어떻게해야합니까?
<!--Google Maps Script-->
<script type="text/javascript">
var locations = [
["1 Severn", 45.489886, -73.595116],
["16 Grenville", 45.486391, -73.607096],
["17 Winchester", 45.477646, -73.603917],
["19 Winchester", 45.477607, -73.603962],
["52 Brookfield", 45.514604, -73.632722],
["317 Chemin du Golf", 45.467418, -73.548665],
["319 Chemin du Golf", 45.467418, -73.548665],
["447 Mt. Stephen", 45.483900, -73.600203],
["449 Mt. Stephen", 45.483933, -73.600179],
["603 Lansdowne", 45.484876, -73.609120],
["649 Belmont", 45.485654, -73.609270],
["652 Roslyn", 45.484788, -73.611407],
["1235 Bishop", 45.496458, -73.575373],
["1355 Scarboro", 45.523431, -73.639453],
["2184 De Cologne", 45.515823, -73.704550],
["2302 Brookfield", 45.514738, -73.632688],
["3013 De Breslay", 45.492288, -73.590195],
["3019 De Breslay", 45.492092, -73.590437],
["3021 Jean Girard", 45.493183, -73.590212],
["3025 De Breslay", 45.492075, -73.590771],
["4389 Decarie", 45.480705, -73.620274]
];
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 12,
center: new google.maps.LatLng(45.484876, -73.609120),
mapTypeId: google.maps.MapTypeId.ROADMAP,
scrollwheel: false
});
var infowindow = new google.maps.InfoWindow();
var marker, i;
for (i = 0; i < locations.length; i++) {
marker = new google.maps.Marker({
position: new google.maps.LatLng(locations[i][1], locations[i][2]),
map: map
});
google.maps.event.addListener(marker, 'click', (function(marker, i) {
return function() {
infowindow.setContent(locations[i][0]);
infowindow.open(map, marker);
}
})(marker, i));
}
</script>
<!--End Google Maps Script-->
: http://lexis250.github.io/groupecopley/map/
내 정보 창 (핀을 클릭하면 팝업 창을) 스타일 싶습니다 그렇게 제목, 이미지 및 링크가 있음을 나타냅니다. 어떻게이 일을 할 수 있습니까? 당신이
이 필요하지만이 같은 코드이 줄을 HTML 태그를 추가 할 수 있습니다 어떤 스타일
그냥 – charlietfl
귀하의 코드가 작동하지 않는 텍스트를 넣는 대신에 (: 예기치 않은 토큰 <''catch되지 않은 구문 에러를) HTML 문자열을 만듭니다. 제목, 이미지 및 링크의 출처는 어디입니까? 각 점의 데이터에는 세 개의 항목 만 있고 그 중 두 개는 좌표입니다. 그들은 모두 같은가요? – geocodezip