Note that there are some explanatory texts on larger screens.

plurals
  1. POgoogle map not working correctly
    primarykey
    data
    text
    <p>i am facing the problem in google maps, i am using google api V3 and using multiple maps on a page, all the maps works fine on a seperate page but when i use in my website it looks like image below</p> <p><img src="https://i.stack.imgur.com/VJszw.png" alt="enter image description here"></p> <p>Actually the map is by default hide when user click on more info link then the maps slide down (using slideToggle());</p> <pre><code>$(document).ready(function() { $maps = $('.map_canvas'); $maps.each(function(index, Element) { $infotext = $(Element).children('.infotext'); var myOptions = { 'zoom': parseInt($infotext.children('.zoom').text()), 'mapTypeId': google.maps.MapTypeId.ROADMAP }; var map; var geocoder; var marker; var infowindow; var address = $infotext.children('.address').text() + ', ' + $infotext.children('.city').text() + ', ' + $infotext.children('.state').text() + ' ' + $infotext.children('.zip').text() + ', ' + $infotext.children('.country').text() ; var content = '&lt;strong&gt;' + $infotext.children('.location').text() + '&lt;/strong&gt;&lt;br /&gt;' + $infotext.children('.address').text() + '&lt;br /&gt;' + $infotext.children('.city').text() + ', ' + $infotext.children('.state').text() + ' ' + $infotext.children('.zip').text() ; if (0 &lt; $infotext.children('.phone').text().length) { content += '&lt;br /&gt;' + $infotext.children('.phone').text(); } geocoder = new google.maps.Geocoder(); geocoder.geocode({'address': address}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { myOptions.center = results[0].geometry.location; map = new google.maps.Map(Element, myOptions); marker = new google.maps.Marker({ map: map, position: results[0].geometry.location, title: $infotext.children('.location').text() }); infowindow = new google.maps.InfoWindow({'content': content}); google.maps.event.addListener(map, 'tilesloaded', function(event) { infowindow.open(map, marker); }); google.maps.event.addListener(marker, 'click', function() { infowindow.open(map, marker); }); } else { alert('The address could not be found for the following reason: ' + status); } }); }); }); </code></pre> <p>here is html markeup but the data in the divs comes dynamically from database</p> <pre><code>&lt;div class="map_canvas"&gt; &lt;div class="infotext"&gt; &lt;div class="location"&gt;Chácara do João&lt;/div&gt; &lt;div class="address"&gt;Av andrade neves, 2333&lt;/div&gt; &lt;div class="city"&gt;Campinas&lt;/div&gt; &lt;div class="state"&gt;SP&lt;/div&gt; &lt;div class="zip"&gt;33401-3995&lt;/div&gt; &lt;div class="country"&gt;USA&lt;/div&gt; &lt;div class="phone"&gt;(561) 659-4050&lt;/div&gt; &lt;div class="zoom"&gt;1&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload