/
suhushinas
/
renderless-components-examples
Обзор
Документация
Войти
/
suhushinas
/
renderless-components-examples
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/modules/example-map/components/ExampleMapMain.jsx
22 строки
695 B
SuhushinAS
fix
24 апр 2019, 05:40
24 апр 2019, 05:40
4ed5197
Код
Авторство
О чём код?
import GeoJSON from 'modules/map/components/GeoJSON.jsx'; import Map from 'modules/map/components/Map.jsx'; import TileLayer from 'modules/map/components/TileLayer.jsx'; import View from 'modules/map/components/View.jsx'; import React from 'react'; class ExampleMapMain extends React.Component { render() { const {geoJSONList, onViewChange, tile} = this.props; return ( <Map> <TileLayer params={tile.params} url={tile.url} /> <View onViewChange={onViewChange} view={geoJSONList} /> {geoJSONList.map(this.renderGeoJSON)} </Map> ); } renderGeoJSON = (geoJSON, id) => <GeoJSON geoJSON={geoJSON} key={id} />; } export default ExampleMapMain;