2012-06-22 3 views
1

~ ~부터 prettyPhoto까지의 경로를 표시 할 방법을 찾고 있었거나 다른 사람이 알고 있다면 뭔가 중요하지 않습니다.prettyPhoto에서 Google지도 경로를 삽입하십시오.

prettyPhoto에서 당신은 표시하고 싶은 장소의 위도 (Lng)를 삽입하는 것으로 제한됩니다. 그러나 제 경우에는 한 곳에서 다른 곳으로가는 경로가 있습니다. 어떻게 수정할 수 있습니까?

<html> 
     <head> 
      <script src="http://www.google.com/jsapi" type="text/javascript"></script> 
      <script type="text/javascript" charset="utf-8"> 
       google.load("jquery", "1.4.2"); 
      </script> 
      <link rel="stylesheet" href="css/prettyPhoto.css" type="text/css" media="screen" title="prettyPhoto main stylesheet" charset="utf-8" /> 
      <script src="js/jquery.prettyPhoto.js" type="text/javascript" charset="utf-8"></script> 

      <!-- Google Maps Code --> 
      <script type="text/javascript" 
       src="http://maps.google.com/maps/api/js?sensor=true"> 
      </script> 
      <script type="text/javascript"> 
       function initialize() { 
       var latlng = new google.maps.LatLng(-34.397, 150.644); 
       var myOptions = { 
        zoom: 8, 
        center: latlng, 
        mapTypeId: google.maps.MapTypeId.ROADMAP 
       }; 
       var map = new google.maps.Map(document.getElementById("map_canvas"), 
        myOptions); 
       } 

      </script> 
      <!-- END Google Maps Code --> 
     </head> 
     <body> 
      <p><a href="#?custom=true&width=260&height=270" rel="prettyPhoto">Open a Google Map</a></p> 

      <script type="text/javascript" charset="utf-8"> 
      $(document).ready(function(){   
       $("a[rel^='prettyPhoto']").prettyPhoto({ 
        custom_markup: '<div id="map_canvas" style="width:260px; height:265px"></div>', 
        changepicturecallback: function(){ initialize(); } 
       }); 
      }); 
      </script> 
     </body> 
    </html> 

답변

1

비트 답장을 늦게, 그러나 나는 비슷한 요청을했고,이 솔루션을 발견 :

기본적으로 http://mysitemyway.com/support/topic/possible-to-use-built-in-prettyphoto-to-call-up-google-maps

, 그냥 링크의 전체 구글지도 URL을 추가하고하지 추가하는 것을 잊지 마세요. (URL 끝에 있음) &output=embed?iframe=true&width=640&height=480

잘 작동하고 다른 해킹이 필요하지 않으므로 평소대로 preetyPhoto 코드를 삽입하십시오.

이 솔루션은 위도/경도를 지정할 필요가 없습니다. Google지도에 표시되는 전체 URL + 추가 코드 (preetyPhoto에 표시하도록 링크 만 표시하면됩니다. iframe으로), 그게 전부입니다.

+0

hehe, 예 조금 조금 늦었지만 어쨌든. 이 솔루션을 염두에 두겠습니다. –