のイオンの現在の位置情報要求を表示していませんマップはうまくいきます、私はアンドロイドを使用しており、私は手動でステータスバーの 'ローカル'を有効にする必要があります。私は地図に入力するときにその要求を表示したい。ぼくは私のコードです、私はcordova geolocationプラグインを使用しています。マップは私のアプリでイオン性の
angular.module('myApp.controllers', ['ionic'])
.controller('NavCtrl', function($scope, $ionicLoading, $compile, $ionicModal, $timeout) {
var myLatLng;
var latCS;
function initialize() {
navigator.geolocation.getCurrentPosition(function(position) {
myLatLng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
\t \t latCS = new google.maps.LatLng(-27.465559, -48.378426);
\t \t
var mapOptions = {
center: myLatLng,
zoom: 10,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map"),mapOptions);
\t \t
var marker = new google.maps.Marker({
position: myLatLng,
map: map,
title: 'Your Pos'
});
\t \t
\t \t var marker2 = new google.maps.Marker({
position: latCS,
map: map,
title: 'Your Dest'
});
\t \t
\t \t var directionsDisplay = new google.maps.DirectionsRenderer();// also, constructor can get "DirectionsRendererOptions" object
\t \t directionsDisplay.setMap(map); // map should be already initialized.
\t \t var request = {
\t \t \t origin : myLatLng,
\t \t \t destination : latCS,
\t \t \t travelMode : google.maps.TravelMode.DRIVING
\t \t };
\t \t var directionsService = new google.maps.DirectionsService();
\t \t directionsService.route(request, function(response, status) {
\t \t \t if (status == google.maps.DirectionsStatus.OK) {
\t \t \t \t directionsDisplay.setDirections(response);
\t \t \t }
\t \t });
$scope.map = map;
});
}
ionic.Platform.ready(initialize)
});
誰かが私を助けることができますか? – Sobucki