0.1.17 • Published 1 month ago

damap v0.1.17

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

Digital Arz Map

A react component for visualizing and analysis data from DigitalArzNode Developed on top of Openlayers.

after installation using npm i damap create .env file and add following lines

REACT_APP_MAP_URL="http://127.0.0.1:8887"
REACT_APP_OPENWEATHER_KEY=***************
REACT_APP_BING_KEY=**************

To add a Map panel on any page use following component

import MapComponent from "damap/lib/ol-map/containers/MapComponent"
const mapRef = React.createRef()
const mapUUID ="........."
<MapComponent ref={mapViewRef} uuid={mapUUID} title='Flood Forecast'>
    <button>Test</button>
</MapComponent>

where

uuid is unique identifier for getting Map from DigitalArzNode

Map View Model

To get Map View Model use

        const mapVM = mapRef.current?.getMapVM();

This View Model can be used for calling different functionalities like To add Digital Arz MVT Layer use

mapVM.addDALayer({uuid: selectedOption})

where

uuid is a Layer info uuid

To open Layer Switcher use

setTimout(()=>mapVM.openLayerSwitcher(),3000)

it better to use setTimout so layout get adjust before open layer switcher

To open Attribute table use

openAttributeTable(columns: Column[], rows: Row[], pkCols: string[], tableHeight: number = 300, daGridRef: RefObject, pivotTableSrc:string=null)

where

columns are of format
{
    disablePadding: boolean;
    id: string;
    label: string;
    // isNumeric: boolean;
    type: "string" | "number" | "date"
}

rows are of format
{
    rowId: number
    [key: string]: any
}

pkCols are an array of primary key column id
tableHeight ref to the height of the table
daGridRef is React RefObject to have control on AttributeGrid functions and
pivotTableSrc is the url of data for pivot Table if data is separate from the table data i.e. rows

Attribute Table

JqxGrid

using openAttributeTable and passing daGridRef you can access JqxGrid

const gridRef = daGridRef?.current?.getJqxGridRef()

you can use all the function mentioned in following Api Reference https://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/index.htm#demos/jqxgrid/defaultfunctionality.htm like

gridRef?.current?.pinColumns(['division'])

Grid Toolbar

Toolbar can access using

const toolbarRef = daGridRef?.current?.getToolbarRef()

we can add Button on toolbar using following function

addButton(newButton: IToolbarButton[])
where IToolbarButton is 
{
    id: string
    title: string
    onClick: (e?: Event) => void
    imgSrc: any
}

example

const zoomBtn = require("../../static/img/search.png")
toolbarRef.addButton([{
    id: "zoomButton",
    title: "Zoom To Selection",
    imgSrc: zoomBtn,
    onClick: (e) => {
        mapVM.selectionLayer.zoomToSelection()
    }
}])

we can add any other Element on toolbar using

const elem = <>
            <select>
                <option>1</option>
                <option>2</option>
            </select></>
toolbarRef?.current?.addToolbarElements(elem);

Map Admin

for Managing Layer in DigitalArz Node use following component

import LayerInfo from "damap/lib/admin/containers/LayerInfo"
<LayerInfo/>

for Managing Map in DigitalArzNode

import LayerInfo from "damap/lib/admin/containers/MapInfo"
<MapInfo/>

author : Ather Ashraf

0.1.17

1 month ago

0.1.16

1 month ago

0.1.14

1 month ago

0.1.15

1 month ago

0.0.85

9 months ago

0.0.86

9 months ago

0.0.87

9 months ago

0.0.88

8 months ago

0.1.10

7 months ago

0.1.11

7 months ago

0.1.12

7 months ago

0.1.13

7 months ago

0.1.0

7 months ago

0.1.2

7 months ago

0.1.1

7 months ago

0.1.8

7 months ago

0.1.7

7 months ago

0.1.9

7 months ago

0.1.4

7 months ago

0.1.3

7 months ago

0.1.6

7 months ago

0.1.5

7 months ago

0.0.95

7 months ago

0.0.96

7 months ago

0.0.97

7 months ago

0.0.98

7 months ago

0.0.90

8 months ago

0.0.91

8 months ago

0.0.92

7 months ago

0.0.93

7 months ago

0.0.94

7 months ago

0.0.84

11 months ago

0.0.80

11 months ago

0.0.81

11 months ago

0.0.82

11 months ago

0.0.83

11 months ago

0.0.73

11 months ago

0.0.74

11 months ago

0.0.75

11 months ago

0.0.76

11 months ago

0.0.77

11 months ago

0.0.78

11 months ago

0.0.79

11 months ago

0.0.70

11 months ago

0.0.72

11 months ago

0.0.62

11 months ago

0.0.63

11 months ago

0.0.64

11 months ago

0.0.65

11 months ago

0.0.66

11 months ago

0.0.67

11 months ago

0.0.68

11 months ago

0.0.69

11 months ago

0.0.60

11 months ago

0.0.61

11 months ago

0.0.59

11 months ago

0.0.57

12 months ago

0.0.58

12 months ago

0.0.51

1 year ago

0.0.52

1 year ago

0.0.53

1 year ago

0.0.54

12 months ago

0.0.55

12 months ago

0.0.56

12 months ago

0.0.50

1 year ago

0.0.48

1 year ago

0.0.49

1 year ago

0.0.40

1 year ago

0.0.41

1 year ago

0.0.42

1 year ago

0.0.43

1 year ago

0.0.44

1 year ago

0.0.45

1 year ago

0.0.46

1 year ago

0.0.47

1 year ago

0.0.38

1 year ago

0.0.39

1 year ago

0.0.22

1 year ago

0.0.23

1 year ago

0.0.24

1 year ago

0.0.25

1 year ago

0.0.37

1 year ago

0.0.30

1 year ago

0.0.31

1 year ago

0.0.32

1 year ago

0.0.33

1 year ago

0.0.34

1 year ago

0.0.35

1 year ago

0.0.36

1 year ago

0.0.26

1 year ago

0.0.27

1 year ago

0.0.28

1 year ago

0.0.29

1 year ago

0.0.21

1 year ago

0.0.20

1 year ago

0.0.19

1 year ago

0.0.18

1 year ago

0.0.17

1 year ago

0.0.16

1 year ago

0.0.15

1 year ago

0.0.14

1 year ago

0.0.13

1 year ago

0.0.12

1 year ago

0.0.11

1 year ago

0.0.10

1 year ago

0.0.1

1 year ago

1.0.0

1 year ago