Maps are not displayed correctly

  • chidalgom
  • chidalgom's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
1 month 1 week ago #11419 by chidalgom
chidalgom replied the topic: Maps are not displayed correctly
Finally i came with a little bit dirty solution, and I got what I need to get.
Have to modified the file display_map_data.php and added this code at very bottom of the page:

//custom script
echo '<script type="text/javascript">
jQuery(document).ready(function($) {
$("a[data-toggle=\'tab\']").on(\'shown.bs.tab\', function(e) {
var map = map'.$mapDivSuffix.', infowindow'.$mapDivSuffix.';
var center = latlng'.$mapDivSuffix.', routeaddress'.$mapDivSuffix.';
google.maps.event.trigger(map, "resize");
map.setCenter(center);
});
});
</script>';

Basically this add a default bootstrap tab event that fires the resize map function when any tab target get active, specially for maps located in other tabs.
Its not the cleanest thing but it works for me... if someone have a cleaner solution, please share.

thanks

Please Log in or Create an account to join the conversation.

More
1 week 5 days ago #11431 by Dima
Dima replied the topic: Maps are not displayed correctly
OK. Thanks for sharing.
Probably someone will use it.

Don't forget support my developments: post review in JED, donate ;)

Post your sites as examples into my directory
Zh GoogleMap: forum.zhuk.cc/index.php/forum/gm-user-s-sites
Zh YandexMap: forum.zhuk.cc/index.php/forum/ym-user-s-sites

Please Log in or Create an account to join the conversation.

Time to create page: 0.056 seconds

Donate


Go to top