0.1.13 • Published 6 years ago

react-native-google-static-map v0.1.13

Weekly downloads
277
License
-
Repository
github
Last release
6 years ago

npm version

react-native-google-static-map

A simple wrapper for an <Image /> element with a url for Google's Static Maps: https://developers.google.com/maps/documentation/staticmaps/intro#quick_example

Try out the API with: http://staticmapmaker.com/google/

Installation

npm install --save react-native-google-static-map

Usage

var GoogleStaticMap = require('react-native-google-static-map');

class MapExample extends Component {
  render() {
    return (
        <GoogleStaticMap
            style={styles.map} {...locationProps}
            latitude={'32.064171'}
            longitude={'34.7748068'}
            zoom={13}
            size={{ width: 300, height: 550 }}
            apiKey={'YOUR-KEY-HERE'}
        />
    );
  }
}

Props

PropTypeDescription
latitudestringlatitude point.
longitudestringlongitude point.
sizeobjectthe image size - { width: 300, height: 550 }
zoomnumberdefines the zoom level of the map.
scalenumberscale=2 returns twice as many pixels as scale=1. The default value is calculated from the screen PixelRatio.
formatstring'png', 'png32', 'jpg', 'gif', 'jpg-baseline'. use the GoogleStaticMap.ImageFormats enum. default is png.
mapTypestring'roadmap', 'satellite', 'terrain', 'hybrid'. use the GoogleStaticMap.MapTypes enum. default is roadmap.
hasCenterMarkerbooladd a marker on the center. default is true.
apiKeystringGoogle API Key
onLoadfunctionA function for handling image loading success
onErrorfunctionA function for handling image loading error

and also any Image.propTypes.

see: http://facebook.github.io/react-native/docs/image.html#props

Demo

Demo

Example

See the example in the Example folder.

0.1.13

6 years ago

0.1.12

6 years ago

0.1.11

7 years ago

0.1.10

7 years ago

0.1.8

8 years ago

0.1.7

8 years ago

0.1.6

8 years ago

0.1.5

8 years ago

0.1.4

9 years ago

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago