html - Using jQuery to display multiple maps in an iframe -
i trying create contact page on bootstrap framework have row split 2 columns. on left hand side have column containing iframe loads google map. on right hand side have column containing 4 offices addresses. default iframe loads map of head office default.
i want able click on 1 of offices , iframe content change display relevant mapping information.
the html on page follows :-
<section id="contact-info"> <div class="center"> <h2>how reach us?</h2> <p class="lead">lorem ipsum dolor sit amet, consectetur adipisicing elit</p> </div> <div class="gmap-area"> <div class="container"> <div class="row"> <div class="col-sm-5 text-center"> <div class="gmap"> <iframe id="gmaps" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=joomshaper,+dhaka,+dhaka+division,+bangladesh&aq=0&oq=joomshaper&sll=37.0625,-95.677068&sspn=42.766543,80.332031&ie=utf8&hq=joomshaper,&hnear=dhaka,+dhaka+division,+bangladesh&ll=23.73854,90.385504&spn=0.001515,0.002452&t=m&z=14&iwloc=a&cid=1073661719450182870&output=embed"></iframe> </div> </div> <div class="col-sm-7 map-content"> <ul class="row"> <li class="col-sm-6"> <address> <h5 id="office_01">head office</h5> </address> <address> <h5 id="office_02">office 2</h5> </address> </li> <li class="col-sm-6"> <address> <h5 id="office_03">office 3</h5> </address> <address> <h5 id="office_04">office 4</h5> </address> </li> </ul> </div> </div> </div> </div> </section> <!--/gmap_area --> <script src="js/mapmover.js"></script>
the jquery follows :-
$(document).ready(function(){ $("#office02").click(function(){ $("#gmaps").attr("src","https://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=joomshaper,+dhaka,+dhaka+division,+bangladesh&aq=0&oq=joomshaper&sll=37.0625,-95.677068&sspn=42.766543,80.332031&ie=utf8&hq=joomshaper,&hnear=dhaka,+dhaka+division,+bangladesh&ll=23.73854,90.385504&spn=0.001515,0.002452&t=m&z=14&iwloc=a&cid=1073661719450182870&output=embed"); }); });
ideally active maps rather static images blank box. if substitute iframe 'src' normal webpage works. i'm guessing way google maps load page beyond normal scope have little knowledge of jquery.
i tried using .html instead of .attr in jquery doesn't seem "'s in source, makes sense...
anyone got ideas or examples at?
so far, it's impossible achieve trying using iframe embedding google maps. looking google maps javascript api v3. there function setcenter() looking if trying interact map setting on click listener element. hope helped!!!
Comments
Post a Comment