使用 apache cordova 2.1 构建 ios 应用程序。建筑和造型都很好,但地图却不行。
我找到了一个地图插件,但根本无法让它工作: https ://github.com/phonegap/phonegap-plugins/tree/master/iOS/MapKit
我还找到了一个示例 html 文件,但可以: https ://github.com/phonegap/phonegap-plugins/tree/master/iPhone/MapKitPlug/example
1 / 所以我将 MapKit 框架添加到 xcode 中,这非常简单: http ://blog.thinketg.com/blog/david-brainer-banker/xcode-4-tips-adding-frameworks-to-your-project
2/ 添加了 .m 和 .h 文件
3/ 添加 .js 文件并将其链接到我的 index.html
4/ 复制了上面的示例 html。
5/ 按照说明将 Mapkit 添加到 .plist 文件中
当我尝试运行地图时,出现以下错误:
2012-11-05 14:21:29.505 sawdaysApp[25398:c07] Multi-tasking -> Device: YES, App: YES
2012-11-05 14:21:30.895 sawdaysApp[25398:c07] CDVPlugin class MapKitView (pluginName: MapKitView) does not exist.
2012-11-05 14:21:30.895 sawdaysApp[25398:c07] ERROR: Plugin 'MapKitView' not found, or is not a CDVPlugin. Check your plugin mapping in Cordova.plist.
2012-11-05 14:21:30.896 sawdaysApp[25398:c07] FAILED pluginJSON = [null,"MapKitView","showMap",[]]
2012-11-05 14:21:30.896 sawdaysApp[25398:c07] CDVPlugin class MapKitView (pluginName: MapKitView) does not exist.
2012-11-05 14:21:30.896 sawdaysApp[25398:c07] ERROR: Plugin 'MapKitView' not found, or is not a CDVPlugin. Check your plugin mapping in Cordova.plist.
2012-11-05 14:21:30.897 sawdaysApp[25398:c07] FAILED pluginJSON = [null,"MapKitView","setMapData",[{"diameter":1000,"offsetTop":25,"lon":-123.104446,"buttonCallback":"cbMapCallback","lat":49.281467999999997,"height":360,"atBottom":true}]]
我假设错误出在 CDVPluggin 中的 MapKitView 上,但真的不确定。
有没有人有这方面的经验并成功了?