README.md 1.58 KB
Newer Older
Tomas Pettersson's avatar
Tomas Pettersson committed
1
2
3
4
# leaflet-navigation-control


## Description
Tomas Pettersson's avatar
Tomas Pettersson committed
5
A component used for navigation. Built with uikit.
Tomas Pettersson's avatar
Tomas Pettersson committed
6
7
8
9
10
11
12
13
14

![](image.png)


## Installation

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

### bower
Tomas Pettersson's avatar
Tomas Pettersson committed
15
`bower install https://git.smhi.se/stw/leaflet-navigation.git --save`
Tomas Pettersson's avatar
Tomas Pettersson committed
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32

## 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


Tomas Pettersson's avatar
Tomas Pettersson committed
33
34
35
36
37
38
39
40
		var map = L.map('map').setView([ 58.5, 19.0 ], 5);
		L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
			maxZoom : 18,
			attribution : '&copy; <a href="http://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors</a>'
		}).addTo(map);

		var hash = new L.Hash(map);

Tomas Pettersson's avatar
Tomas Pettersson committed
41
42
43
		var language = 'en';

        var navLangData = {
Tomas Pettersson's avatar
Tomas Pettersson committed
44
45
46
        	"tTitle": "Navigation",
					"tLogin" : "Login",
					"tLogout" : "Logout"
Tomas Pettersson's avatar
Tomas Pettersson committed
47
48
        };

Pettersson Tomas's avatar
help    
Pettersson Tomas committed
49
        var navControl = new Navigation("navigation", {
Tomas Pettersson's avatar
Tomas Pettersson committed
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
			"user" : {
				"name" : "Firstname Surname",
				"id" : "k000000",
				"url" : "/demo"
			},
			"navigation": {
				"Link1" : "path",
				"Link2" : "path",
				"Link3" : "path"
			},
			"showSearch" : true,
			"showNavigation" : true,
			"showHelp" : true,
			"showUser" : true,
			"showLanguage" : true,
Tomas Pettersson's avatar
Tomas Pettersson committed
65
66
67
68
69
   			"lang" : language,
   			"langdata" : navLangData,
   			"proxy" : 'proxy',
   			"url" : '/demo'
        });
Tomas Pettersson's avatar
Tomas Pettersson committed
70

Tomas Pettersson's avatar
Tomas Pettersson committed
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91

### Options


## Copyright and License

## Contact information

Tomas Pettersson tomas.pettersson@smhi.se


## Credits and acknowledgements


## Known bugs

## Troubleshooting

## Changelog