I am using the google map (javascript sdk) in ionic V3 and I created 2 pages in ionic with map view. In the first page the map works well however once i open the second page the map appears with grey lines, no markers, street cuts in the middle ... does anyone experience this issue? is it possible to have many maps in different pages in the same ionic application ?? many thanks for the help and recommandation
我在离子V3中使用谷歌地图(javascript sdk),我在离子地图视图中创建了2页。在第一页中,地图效果很好,但是一旦打开第二页,地图就会显示灰线,没有标记,中间有街道切割......是否有人遇到此问题?是否有可能在同一离子应用中的不同页面中有许多地图?非常感谢您的帮助和推荐
1 个解决方案
#1
0
Yes I've encountered that once, A way around it and to make your application performance better, is to create a service: ionic g provider mapService
是的,我曾经遇到过这种情况,一种解决方案并使您的应用程序性能更好的方法是创建一个服务:ionic g provider mapService
And then create there general variables that gonna hold the map (so you'll have a singleton) then it will be centralized and not loading different map on, and you can store each specific thing (markers, clusters...etc)
然后创建那些将持有地图的一般变量(所以你将有一个单身)然后它将集中而不加载不同的地图,你可以存储每个特定的东西(标记,集群......等)
#1
0
Yes I've encountered that once, A way around it and to make your application performance better, is to create a service: ionic g provider mapService
是的,我曾经遇到过这种情况,一种解决方案并使您的应用程序性能更好的方法是创建一个服务:ionic g provider mapService
And then create there general variables that gonna hold the map (so you'll have a singleton) then it will be centralized and not loading different map on, and you can store each specific thing (markers, clusters...etc)
然后创建那些将持有地图的一般变量(所以你将有一个单身)然后它将集中而不加载不同的地图,你可以存储每个特定的东西(标记,集群......等)