- Posts: 7
- Thank you received: 0
Maps in tabs
- esedic
- Topic Author
- Offline
- New Member
Less
More
6 years 3 weeks ago #12000
by esedic
Maps in tabs was created 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.
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.
- Dima
- Offline
- Platinum Member
6 years 3 weeks ago #12001
by Dima
Don't forget support my developments: post review in JED , donate , help with translation
Replied by Dima on topic Maps in tabs
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
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
Don't forget support my developments: post review in JED , donate , help with translation
Please Log in or Create an account to join the conversation.
- Dima
- Offline
- Platinum Member
6 years 3 weeks ago #12002
by Dima
Don't forget support my developments: post review in JED , donate , help with translation
Replied by Dima on topic Maps in tabs
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.
Don't forget support my developments: post review in JED , donate , help with translation
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
6 years 3 weeks ago - 6 years 3 weeks ago #12003
by esedic
Replied by esedic on topic Maps in tabs
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.
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: 6 years 3 weeks ago by esedic. Reason: typo
Please Log in or Create an account to join the conversation.
- Dima
- Offline
- Platinum Member
6 years 3 weeks ago #12004
by Dima
Don't forget support my developments: post review in JED , donate , help with translation
Replied by Dima on topic Maps in tabs
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.
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.
Don't forget support my developments: post review in JED , donate , help with translation
Please Log in or Create an account to join the conversation.
- Dima
- Offline
- Platinum Member
6 years 3 weeks ago #12005
by Dima
Don't forget support my developments: post review in JED , donate , help with translation
Replied by Dima on topic Maps in tabs
And in this case you need to use the last release.
PS: today I did new one ;P
zhuk.cc/2018/11/08/zh-openstreetmap-new-features-and-bugfixes/
PS: today I did new one ;P
zhuk.cc/2018/11/08/zh-openstreetmap-new-features-and-bugfixes/
Don't forget support my developments: post review in JED , donate , help with translation
Please Log in or Create an account to join the conversation.
Time to create page: 0.229 seconds