离子 - Google地图拖动时显示灰色区域
问题描述:
我正在构建一个混合了Google地图的混合应用程序。所有加载都很好,但是当我拖动地图时,它会显示灰色区域,直到我释放拖动并加载地图的其余部分。离子 - Google地图拖动时显示灰色区域
有没有任何方法可以在不等待拖放的情况下加载外围区域,以便用户不必导航到灰色区域?
我正在使用Ionic和Angularjs构建应用程序。
在我controller.js我加载地图
var map = new google.maps.Map(document.getElementById("map"),
{
center : latLng,
zoom : 16,
mapTypeControl : false,
streetViewControl : false,
zoomControl : false,
mapTypeControl: false,
});
然后我展示它在我map.html
<div id="map"></div>
空闲:
拖动时:
在释放它加载:
答
混合应用的工作原理就像里面应用的Web浏览器。离子中的Google地图也是这样的。当您拖动地图时,它会显示与Web浏览器相同的部分显示它。这取决于您的手机的互联网速度和您的应用程序的性能。 您可以看看这个https://forum.ionicframework.com/t/improving-performance-of-google-maps/894/2以获得更好的性能,
+0
@Cláudio巴雷拉接受这个答案,并关闭这个问题,请 – Anuj
您可以尝试实施https://github.com/mapsplugin/cordova-plugin-googlemaps,以便利用本机处理能力。 – tothefux
你就是这么做的,现在导航非常棒!谢谢;) –