在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):pieterv/react-googlemaps开源软件地址(OpenSource Url):https://github.com/pieterv/react-googlemaps开源编程语言(OpenSource Language):JavaScript 100.0%开源软件介绍(OpenSource Introduction):React Google MapsA declarative React interface to Google Maps. Check it out: Important NotesThis is an alpha release. The API and organizational structure are subject to change. Comments and contributions are much appreciated. Installationnpm install react-googlemaps --save This library is written with CommonJS modules. If you are using browserify, webpack, or similar, you can consume it like anything else installed from npm. Usagevar React = require('react');
var ReactGoogleMaps = require('react-googlemaps');
var GoogleMapsAPI = window.google.maps;
var Map = ReactGoogleMaps.Map;
var Marker = ReactGoogleMaps.Marker;
var OverlayView = ReactGoogleMaps.OverlayView;
function handleClick(e) {
console.log('Clicked at position', e.latLng);
}
React.render(
<Map
initialZoom={10}
initialCenter={new GoogleMapsAPI.LatLng(-41.2864, 174.7762)}>
<Marker
onClick={handleClick}
position={new GoogleMapsAPI.LatLng(-41.2864, 174.7762)} />
<OverlayView
style={{backgroundColor: '#fff'}}
position={new GoogleMapsAPI.LatLng(-41.2864, 174.7762)}>
<p>Some content</p>
</OverlayView>
</Map>,
mountNode
); Checkout the API docs or the LicenseLicensed under MIT. Full license here » |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论