问题
Hi I have a problem using framework7 at first load the map is loading when I navigate to a different page then click back to the page with the google map the map doesn't load.
if (page.name === 'location') {
new GMaps({
div: '#map',
lat: -12.043333,
lng: -77.028333
});
}
回答1:
For Those using framework 7 and encounter this error Id like to post what I did to make it right just investigated that the elements in framework7's pages are cached when navigating to each pages thats why google maps can only appear on first navigation of the page with map the second time you navigate the page is duplicated from which the DOM your targeting is on the cache thats why its not appearing in the second time you navigate to the page with googlemap.
var mainView = myApp.addView('.view-main', {
domCache:false,
});
set the domcache to false; By default its true. You need to make it false to load your map properly.
来源:https://stackoverflow.com/questions/40542519/framework7-google-maps-not-loading-on-second-page-click