Mapbox지도에서 전단지의 라이브러리를 사용하면서 발견 한 문제를 해결하는 데 어려움을 겪고 있습니다. 특히, 팝업이 맵의 각 아이콘/마커에 바인딩되도록 코드를 작성했습니다. 각 팝업 안에는 다른 웹 사이트로 연결되는 이미지가 있습니다.리플 렛 (Cloudmade) 팝업의 이미지 크기가 팝업 크기를 결정하지 못하는 것 같습니다.
- 이미지가 팝업 (http://postimage.org/image/c7u0n5sx3/)
- 자동 이동 옵션보다 훨씬 더 큰 : 불행하게도이 이미지의 크기는 다음 consecuences을 가지고, 실제 팝업의 크기의 계산에 포함되지 않는 것 같다 당신은이에 대한 가능한 해결책의
<?php // Retrieves info from all correct rows in database to further input in javascript while ($row = mysql_fetch_assoc($get_info)){ $name = $row ['nombre']; $lat = $row ['lat']; $long = $row ['long']; echo "<script type=\"text/javascript\"> var latlng = new L.LatLng(".$row ['lat'].", ".$row ['long']."); var flyer = \"<a href='boliches/pdnws/".$row ['nombre'].".php'><img src='boliches/flyers/".$day."/".$row ['nombre'].".jpg'/></a>\"; var MyIcon = L.Icon.extend({ iconUrl: 'boliches/icons/".$row ['nombre'].".png', shadowUrl: null, iconSize: new L.Point(50, 50), shadowSize: null, iconAnchor: new L.Point(25, 25), popupAnchor: new L.Point(1, 1) }); var icon = new MyIcon(); var marker = new L.Marker(latlng, {icon: icon}); map.addLayer(marker); marker.bindPopup(flyer, {maxWidth:800, autoPan:true}); </script>"; } ?>
생각할 수 :
내 코드는 다음과 같다 작업 does't? 프로그래밍에 관해서는 초보자 인 것 같지만, 너무 길어서이 코드를 해독 할 수 없었습니다. 도와 주셔서 정말 고맙습니다. 정말 고맙습니다!
그래서,이 솔루션은 다음과 같습니다 (또는 이미지와 폭을 지정 youtube iframe) 그리고 bindPopup의 maxWidth를 충분히 높은 값으로 설정하십시오. – erik
마커입니다 ._popup.update(); – JRT