1.0.3 • Published 7 years ago

react-primitives-mapquest-static-map v1.0.3

Weekly downloads
6
License
MIT
Repository
github
Last release
7 years ago

react-primitives-mapquest-static-map

A simple wrapper for an <Image /> element with a url for MapQuest's Static Map API: https://developer.mapquest.com/documentation/static-map-api/v5/getting-started/

Installation

npm install --save react-primitives-mapquest-static-map

Usage

var MapQuestStaticMap = require('react-primitives-mapquest-static-map');

class MapExample extends Component {
  render() {
    return (
        <MapQuestStaticMap
            style={styles.map} {...locationProps}
            latitude={'37.7749'}
            longitude={'-122.4194'}
            zoom={11}
            size={{ width: 300, height: 550 }}
        />
    );
  }
}

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.
formatstring'png', 'jpg', 'jpg70', 'jpg80', 'jpg90', 'gif'. Use the MapQuestStaticMap.ImageFormats enum. default is jpg.
markersarrayarray of { latitude, longitude } markers to render
mapTypestring'map', 'satellite', 'hybrid', 'light', 'dark'. Use the MapQuestStaticMap.MapTypes enum. default is map.
hasCenterMarkerbooladd a marker on the center. default is false.

and also any Image.propTypes.

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

Example

See the example in the Example folder.

Props

Inspired by https://github.com/jongold/react-primitives-google-static-map (https://github.com/jongold) and his fork of https://github.com/yelled3/react-native-google-static-map (https://github.com/yelled3)