Hi,
I use https://docs.expo.io/versions/latest/sdk/map-view.html in my app.
On ios the map is a static screen, the user cannot navigate in it. Tooltips works…
No problem on android
Any ideas to help me ?
app.json
,
"ios": {
"bundleIdentifier": "***************",
"icon": "./pages/images/theme/icon-ios.png",
"config": {
"googleMapsApiKey": "************************"
}
}
carte.js
import React from 'react';
import {Platform, View, Text, Image} from 'react-native'
import MapView from 'react-native-maps';
import {Constants, Location, Permissions} from 'expo';
export default class Stations extends React.Component {
state = {
location: null,
};
static navigationOptions = {
tabBarIcon: () => {
return <Image source={require('./images/boutons/bouton3.png')} style={{width: 25, height: 25}}/>
}
};
constructor(props) {
super(props);
this.state = {
region: {
latitude: -21.053875,
longitude: 55.228683,
latitudeDelta: 0.0922,
longitudeDelta: 0.0421,
}
};
}
componentWillMount() {
this._getLocationAsync();
}
_getLocationAsync = async () => {
let {status} = await Permissions.askAsync(Permissions.LOCATION);
if (status == 'granted') {
let location = await Location.getCurrentPositionAsync({enableHighAccuracy: true});
let region = {
longitude: location.coords.latitude,
latitude: location.coords.longitude,
latitudeDelta: 0.0922,
longitudeDelta: 0.0421,
};
this.setState({region});
}
};
render() {
let text = 'Waiting..';
if (this.state.errorMessage) {
text = this.state.errorMessage;
} else if (this.state.location) {
text = JSON.stringify(this.state.location);
}
return (
<MapView
style={{flex: 1}}
initialRegion={this.state.region}
showsUserLocation={true}
userLocationAnnotationTitle="Vous êtes ici"
showsMyLocationButton={true}
cacheEnabled={true}
loadingEnabled={true}
showsTraffic={true}
showsCompass={true}
showsPointsOfInterest={true}
>
<MapView.Marker
coordinate={{
latitude: -21.077056,
longitude: 55.222172
}}
title="Station"
description=""
image={require('./images/map-marker.png')}
/>
</MapView>
);
}
}