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


## 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
			"user" : {
				"name" : "Firstname Surname",
				"id" : "k000000",
				"url" : "/demo"
			},
			"navigation": {
				"Link1" : "path",
				"Link2" : "path",
				"Link3" : "path"
			},
Tomas Pettersson's avatar
Tomas Pettersson committed
60
			"search" : true,
Tomas Pettersson's avatar
help    
Tomas Pettersson committed
61
			"help" : {
Tomas Pettersson's avatar
Tomas Pettersson committed
62
63
64
				"classic" : {
					"id" : "introduction"
				},
Tomas Pettersson's avatar
help    
Tomas Pettersson committed
65
				"guide" : false,
Tomas Pettersson's avatar
Tomas Pettersson committed
66
67
68
				"indepth" : {
					"id" : "kde" 
				}
Tomas Pettersson's avatar
help    
Tomas Pettersson committed
69
			},			
Tomas Pettersson's avatar
Tomas Pettersson committed
70
			"showLanguage" : true,
Tomas Pettersson's avatar
Tomas Pettersson committed
71
   			"lang" : language,
Tomas Pettersson's avatar
Tomas Pettersson committed
72
   			"langdata" : navLangData
Tomas Pettersson's avatar
Tomas Pettersson committed
73
        });
Tomas Pettersson's avatar
Tomas Pettersson committed
74

Tomas Pettersson's avatar
Tomas Pettersson committed
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95

### Options


## Copyright and License

## Contact information

Tomas Pettersson tomas.pettersson@smhi.se


## Credits and acknowledgements


## Known bugs

## Troubleshooting

## Changelog