-
Zh OpenStreetMap
-
Plugin
-
Maps in tabs
Maps in tabs
-
esedic
-
Topic Author
-
Offline
-
New Member
-
Less
More
-
Posts: 7
-
Thank you received: 0
-
-
5 years 5 months ago #12000
by esedic
Hi!
I'm trying to load two different maps in Bootstrap 3 tabs with content plugin shortcode. When I switch to second tab, I get javascript error "Map container is already initialized".
I'm currently googling solution (it's a leaflet error with multiple maps), but so far I couldn't solve it (I'm not a javascript guru).
Any help would be appreciated.
Please Log in or Create an account to join the conversation.
Less
More
-
Posts: 4609
-
Thank you received: 460
-
-
-
-
-
5 years 5 months ago #12001
by Dima
Hi.
Do you use my modules on different tabs, or use some component call?
I think you need to use my plugin call
Like in my google's extension
wiki.zhuk.cc/index.php/Zh_GoogleMap_Plugin
But my docs for OSM not ready, I'm trying implement features first.
As for plugin call - you just use word "osm" instead of "google"
ie
{zhosmmap:1}
to show map with id=1
Sorry, I'll try to add plugin description at weekend
Please Log in or Create an account to join the conversation.
Less
More
-
Posts: 4609
-
Thank you received: 460
-
-
-
-
-
5 years 5 months ago #12002
by Dima
PS today plugin not well tested for all parameters, and parameters for OSM can be different. On next week (when I'll do new release to support ajax infowin content and ajax map object loading) I come back to plugin to fix parameters.
Please Log in or Create an account to join the conversation.
-
esedic
-
Topic Author
-
Offline
-
New Member
-
Less
More
-
Posts: 7
-
Thank you received: 0
-
-
5 years 5 months ago - 5 years 5 months ago #12003
by esedic
Hi!
I've managed to solve this like this:
jQuery(document).ready(function($) {
// initialize map in first tab - I don't know why I had to do this, I think it happened after I saved component options in administration
initializemod_custom_content__0_2_map();
// initialize map in second tab
$('.branches li a[data-toggle=\"tab\"]').one('shown.bs.tab', function () {
initializemod_custom_content__0_1_map();
});
});
There are still some errors in console though.
I have also some other maps on this page and there are a lot of problems, I think mostly coming from display_map_data.php.
Although I knew component is still in active development I needed to make a switch to Openstreet Maps because Google Maps stopped working because we exceeded monthly quota.
If you are interested I can make a list of bugs I encountered so far.
Last edit: 5 years 5 months ago by esedic. Reason: typo
Please Log in or Create an account to join the conversation.
Less
More
-
Posts: 4609
-
Thank you received: 460
-
-
-
-
-
5 years 5 months ago #12004
by Dima
File display_map_data.php. is main file to create page.
It gets all data and create page script.
Yes, you can post errors and bugs. More usefull if you create map page to produce this error, because I did lots of test before create release, and disabled features which is on development stage.
But of course, I can do some mistakes.
Please Log in or Create an account to join the conversation.
Less
More
-
Posts: 4609
-
Thank you received: 460
-
-
-
-
-
-
Zh OpenStreetMap
-
Plugin
-
Maps in tabs
Time to create page: 0.144 seconds