Is there a way to embed <iframe> Google Maps into the most current version of DNN (07.02.02) without an iframe module?

StackOverflow https://stackoverflow.com/questions/22821285

  •  26-06-2023
  •  | 
  •  

質問

<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d43867.046029057456!2d- 112.01569394999997!3d46.59335794999998!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x0%3A0x8837f86ba6483c4e!2sSpring+Meadow+Lake+State+Park!5e0!3m2!1sen!2sus!4v1396467122025" width="600" height="450" frameborder="0" style="border:0"></iframe>

This is the code, not the exact address but either way it will not embed correctly, it embeds and it shows the map, but it is zoomed out and has no coordinates plotted at all or the address of where it is supposed to be pointing at. Any help is appreciated, i need this inside of a tab in DNN so i cant use the iframe module.

役に立ちましたか?

解決

  • Edit your page and add text/html module to your page with a <div id="map_canvas"></div>
  • Go to page settings > Advance > Header section and add fpllowing script:
 <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false">
    <script>
      var map;
      function initialize() {
        var mapOptions = {
          zoom: 8,
          center: new google.maps.LatLng(-34.397, 150.644),//set you long lat here
          mapTypeId: google.maps.MapTypeId.ROADMAP
        };
        map = new google.maps.Map(document.getElementById('map_canvas'),
            mapOptions);
      }

      google.maps.event.addDomListener(window, 'load', initialize);
    

this should work

他のヒント

  1. Select HTML Mode in HTML Editor
  2. Use "Raw" mode to pervent tag encoding.
  3. Enjoy
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top