map_wrapper_react
v1.2.5
Published
yandex map react
Downloads
4
Readme
map_wrapper_react
Install
npm install --save map_wrapper_react
import React from "react";
import { Map } from "map_wrapper_react";
const App = () => (
<Map mapKey={"yandex_map_key"}/>
)
Map Props
| name | type | default | description | |---|---|---|---| | mapKey | string | "" | key for card | | control | array | [ ] | list of controls yandex map | | width | string | 100% | | | height | string | 100vh | | | zoom | number | 9 | |
Additional controls
- MapListBox
import React from "react";
import { Map, MapListBox } from "map_wrapper_react";
const App = () => (
<Map mapKey={"yandex_map_key"}>
<MapListBox
label={"list"}
list={[
{name: "item1", uuid: "1"},
{name: "item2", uuid: "2"}
]}
onClick={(value) => {console.log(value)}}
/>
</Map>
)
MapListBox Props
| name | type | default | description | |---|---|---|---| | label | string | "" | | | list | array | [ ] | | | onClick | function | | | | config | object | null | null | |
- ObjectManager
import React from "react";
import { Map, ObjectManager } from "map_wrapper_react";
const data = {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"id": 0,
"geometry":
{
"type": "Point",
"coordinates": [55.831903, 37.411961]
},
"properties": {}
},
]
}
const App = () => (
<Map mapKey={"yandex_map_key"}>
<ObjectManager
config={{
geoObjectOpenBalloonOnClick: false
}}
onClick={( objectManager, objectId ) => {}}
data={ data }
hidden={ false }
filter={ null }
/>
</Map>
)
ObjectManager Props
| name | type | default | description | |---------|--------------------------------------------------------|-----------|----------------------------| | config | object | null | null | | | onClick | func | | function({ objectManager: string, objectId: string }) | | data | FeatureCollection | | | | hidden | boolean | false | shows hide or show points of the objectManager | | filter | object | null | null | { propertiesName: string, propertiesValue: string } the name and value of the property by which the filtering occurs |
License
MIT © esseregin