README.md 2.93 KB
Newer Older
Tomas Pettersson's avatar
Tomas Pettersson committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# leaflet-navigation-control


## Description
A leaflet control for used navigation. Built with uikit.

![](image.png)

Note that a component must be extending L.Control.

## Installation

You will need node.js, npm and bower for demo

### bower
`bower install https://git.smhi.se/stw/leaflet-navigation-control.git --save`

## Demo

Go to demo folder and install package.json

	> npm install

Start server in demo folder

	> node server.js
	Server started on http://localhost:8080...

Open browser on http://localhost:8080/demo

## Usage example


		var language = 'en';

        var navLangData = {
        	"tMarkerstart":   "Click map to place point.",
        	"tPolygonstart": "Hold left mouse button to draw polygon on map. Press escape to abort.",
        	"tPolygoncont":   "Hold left mouse button to draw polygon on map. Release button to finnish drawing. Press escape to abort.",
        	"tPolygonend":   "Release button to finnish drawing.",
        	"tPolylinestart":   "Hold left mouse button to draw line on map. Press escape to abort.",
        	"tPolylinecont":  "Hold left mouse button to draw line on map. Release button to finnish drawing. Press escape to abort.",
        	"tPolylineend":  "Release button to finnish drawing.",
        	"tDraw":    "Draw outlet on map. Use LEFT mouse button while drawing.",
        	"tEdit": "Edit outlet shape",
        	"tManual": "Enter coordinates manually",
        	"tImport": "Import outlet as geojson file",
        	"tClear": "Clear drawn shapes from map",
        	"bManual":  "Enter coordinates manually",
        	"bDraw":       "Free hand draw on map",
        	"bEdit":          "Edit polygon in map",
        	"bImport":    "Import GeoJson file",
        	"bClear":    "Clear map",
        	"btClear":    "Clear",
        	"sAreaPoint":	"Point",
        	"sAreaPolyline":	"Polyline",
        	"sAreaPolygon":	"Polygon",
        	"sAreaMultiPoint":	"MultiPoint",
        	"sAreaMultiPolyline":	"MultiPolyline",
        	"sAreaMultiPolygon":	"MultiPolygon",
        	"tArea":	"Select outlet type",
        	"sAreaPoint":	"Point",

        	"tLatitude":  "Latitude",
        	"tLatituderange":  "range [-90 to 90]",
        	"tLongitude":   "Longitude",
        	"tLongituderange": "range [-180 to 180]",
        	
        	"rDDM": "Degrees Decimal Minutes ",
        	"rDD": "Decimal Degrees",
        	"bAdd": "Add",
        	"bDel": "Del",
        	"bCreate": "Create",
        	"bEdit": "Edit",
        	"bCancel": "Cancel",
        	
        	"cCoordinates": "Coordinates"
        };

        var navControl = new L.Control.Navigation({
            position: 'topright',
   			"lang" : language,
   			"langdata" : navLangData,
   			"proxy" : 'proxy',
   			"url" : '/demo'
        });
        map.addControl(coordinatesControl); 

### Options


## Copyright and License

## Contact information

Tomas Pettersson tomas.pettersson@smhi.se


## Credits and acknowledgements


## Known bugs

## Troubleshooting

## Changelog