我正在开发一个带有离子框架和angularjs的phoneGap应用程序,我想显示一个带有2个标记的地图和它们之间的路线,我试过谷歌地图api v3,但我在放大地图时遇到问题;路径消失,所以我测试使用基于谷歌地图api v3的angular google maps library,但我没有找到如何画2点之间的路径;
我还想知道这个插件在放大Android应用程序时是否也有问题,如果是这样,我问是否有一个解决方案,谷歌地图放大了phonegap应用程序,我也试过这个cordova插件google maps cordova plugin ,但它的开发者表示离子有问题。
我试过这段代码,
//this two lines below are responsible for the bug
var map = new google.maps.Map(document.getElementById("map1"),
mapOptions);
directionsDisplay = new google.maps.DirectionsRenderer();
directionsDisplay.setMap(map);
var request = {
origin: start,
destination: end,
travelMode: google.maps.TravelMode.DRIVING
};
directionsService.route(request, function(response, status) {
if (status == google.maps.DirectionsStatus.OK) {
directionsDisplay.setDirections(response);
}
});
我收到此错误
Error: [$compile:ctreq] Controller 'uiGmapGoogleMap', required by directive 'uiGmapWindow', can't be found!
http://errors.angularjs.org/1.2.17/$compile/ctreq?p0=uiGmapGoogleMap&p1=uiGmapWindow at file:///C:/cordovaprojets/guide_toulouse/platforms/android/assets/www/lib/ionic/js/ionic.bundle.js:76 49:12
at getControllers (file:///C:/cordovaprojets/guide_toulouse/platforms/android/assets/www/lib/ionic/js/ionic.bundle.js:14007:19)
at file:///C:/cordovaprojets/guide_toulouse/platforms/android/assets/www/lib/ionic/js/ionic.bundle.js:14015:24
at Array.forEach (native)
at forEach (file:///C:/cordovaprojets/guide_toulouse/platforms/android/assets/www/lib/ionic/js/ionic.bundle.js:7891:11)
at getControllers (file:///C:/cordovaprojets/guide_toulouse/platforms/android/assets/www/lib/ionic/js/ionic.bundle.js:14014:11)
at nodeLinkFn (file:///C:/cordovaprojets/guide_toulouse/platforms/android/assets/www/lib/ionic/js/ionic.bundle.js:14179:35)
at compositeLinkFn (file:///C:/cordovaprojets/guide_toulouse/platforms/android/assets/www/lib/ionic/js/ionic.bundle.js:13578:15)
at publicLinkFn (file:///C:/cordovaprojets/guide_toulouse/platforms/android/assets/www/lib/ionic/js/ionic.bundle.js:13487:30)
at boundTranscludeFn (file:///C:/cordovaprojets/guide_toulouse/platforms/android/assets/www/lib/ionic/js/ionic.bundle.js:13601:21) <span class="angular-google-maps-window" ng-transclude="" coords="map.infoWindowWithCustomClass.coords" isiconvisibleonclick="false" options="map.infoWindowWithCustomClass.options">
提前致谢并抱歉我的英文