0.2.5 • Published 5 months ago

oz-map-tool-menu v0.2.5

Weekly downloads
-
License
-
Repository
-
Last release
5 months ago

react oz-map tool menu module

install

install using npm install oz-map-tool-menu

usage

in a react app, use the ToolMenu component:

  1. import
import { ToolMenu } from "oz-map-tool-menu"
import { Map } from "oz-map";
  1. for fonts
import 'semantic-ui-css/semantic.min.css'

or

<link async
    rel="stylesheet"
    href="https://cdn.jsdelivr.net/npm/semantic-ui@2/dist/semantic.min.css"
  />
  1. component
let mapRef = React.createRef()

return <div>
    <Map ref={mapRef}
        view={{
            projection: 'EPSG:3857',
            center: [4000000, 4700000],
            zoom: 8,
        }}
        handleInfo={(event) => {

            alert(event.feature.getGeometry().getCoordinates());
        }}
    />
    <ToolMenu map={mapRef} />
</div>
  1. also remove

<React.StrictMode>

css

#tool-menu {
    position: absolute;
    top: 0;
    right: 150px;
}
0.2.5

5 months ago

0.2.4

5 months ago

0.2.3

5 months ago

0.2.2

6 months ago

0.2.1

6 months ago