GoogleMaps機能をiOS、Androidに実装するメモです。
プラグイン追加
$ cd cordova
$ cordova plugin add plugin.google.maps --variable API_KEY_FOR_ANDROID="Android用キー" --variable API_KEY_FOR_IOS="iOS用キー"
$ cordova plugin add org.apache.cordova.geolocation
GoogleMapsを読み込む
<script type="text/javascript" charset="utf-8" src="https://maps.googleapis.com/maps/api/js"></script>
SenchaTouchのビュー
app/view/Map.js
// 地図
Ext.define('NearLife.view.Map', {
extend: 'Ext.Map',
id: 'id-view-map',
xtype: 'view-map',
requires: [
],
config: {
mapOptions: {
scrollwheel: false,
zoom: 12,
minZoom: 2
}
}
});