Framework7谷歌地图不加载第二页点击 [英] Framework7 google maps not loading on second page click

查看:344
本文介绍了Framework7谷歌地图不加载第二页点击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我在使用framework7时遇到问题,首先加载导航到不同页面时加载的地图,然后单击回到带有谷歌地图的页面,地图不加载。



$ $ p $ if(page.name ==='location'){
new GMaps({
div :'#map',
lat:-12.043333,
lng:-77.028333
});


code $

解决方案

使用框架7,并遇到此错误Id喜欢张贴我做了正确的只是调查,在浏览到每个页面时,framework7的页面中的元素缓存为什么谷歌地图只能出现在页面的第一次导航与地图第二您浏览页面的时间会被复制,而您的定位DOM所在的DOM将被复制到第二次使用googlemap导航到页面时不显示的原因。

  var mainView = myApp.addView('。view-main',{
domCache:false,
});

将domcache设置为false;默认情况下它是真的。您需要将其设置为false才能正确加载您的地图。


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
        });

}

解决方案

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.

这篇关于Framework7谷歌地图不加载第二页点击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆