An
<Image/>
element with a url to Google Static Map
See Google Static Maps API.
npm install --save react-native-google-static-map-next
ou
yarn add react-native-google-static-map-next
import {GoogleStaticMapNext} from 'react-native-google-static-map-next'
function Example() {
return (
<GoogleStaticMapNext
style={styles.staticMap}
location={{
latitude: '-33.8688',
longitude: '151.2195',
}}
size={{ width: 400, height: 400 }}
apiKey="123456789-ABCDFGHIJK"
/>
);
}
Prop | Type | Description | Default |
---|---|---|---|
location |
Object |
the map location - { latitude: '-33.8688', longitude: '151.2195' } |
undefined |
size |
Object |
the image size - { width: 300, height: 550 } |
undefined |
zoom |
Number |
defines the zoom level of the map. | 15 |
scale |
Number |
scale=2 returns twice as many pixels as scale=1. | 1 |
format |
String |
'png', 'gif', 'jpg' | png |
mapType |
String |
'roadmap', 'satellite', 'terrain', 'hybrid'. | roadmap |
hasCenterMarker |
Boolean |
add a marker on the center. | true |
apiKey |
String |
Google API Key | undefined |
customMarkerUrl |
String |
Custom marker url | undefined |
Feel free to file a new issue with a respective title and description on the the react-native-google-static-map-next repository. If you already found a solution to your problem, i would love to review your pull request! Have a look at our contribution guidelines to find out about the coding standards.
Check out the contributing page to see the best places to file issues, start discussions and begin contributing.
This project is under the MIT license.
Wanderson Alves |