source: src/webapp/webserver/js/GnuBoat.Webserver.js@ 38a2121

debian/bullseye
Last change on this file since 38a2121 was 2fa2ef8, checked in by Joachim Langenbach <joachim.langenbach@…>, 8 years ago

First version of webserver (HTML Frontend)

  • Property mode set to 100644
File size: 2.0 KB
RevLine 
[2fa2ef8]1/*
2
3 Copyright (C) 2018 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18 MA 02110-1301 USA.
19
20*/
21
22/** @namespace GnuBoat JavaScript namespace */
23var GnuBoat = GnuBoat || {};
24/** @namespace GnuBoat Webserver JavaScript namespace */
25GnuBoat.Webserver = GnuBoat.Webserver || {};
26
27GnuBoat.Webserver.initialize = function()
28{
29 GnuBoat.Webserver.private.mapSetup();
30}
31
32GnuBoat.Webserver.private = {
33 map: null,
34 mapSetup: function ()
35 {
36 GnuBoat.Webserver.private.map = L.map('mapViewport').setView([51.505, -0.09], 13);
37
38 var layer_openstreetmap = L.tileLayer(
39 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
40 { attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'}
41 ).addTo(GnuBoat.Webserver.private.map);
42 var layer_openseamap = L.tileLayer(
43 'http://tiles.openseamap.org/seamark/{z}/{x}/{y}.png',
44 {attribute: '&copy; <a href="http://www.openseamap.org">OpenSeaMap</a> contributors'}
45 ).addTo(GnuBoat.Webserver.private.map);
46
47
48 // add layer control
49 GnuBoat.Webserver.private.mapControl = L.control.layers(
50 {"Map": layer_openstreetmap},
51 {"Seamarks": layer_openseamap},
52 {hideSingleBase: true, sortLayers: true, }
53 ).addTo(GnuBoat.Webserver.private.map);
54
55 // add scale
56 L.control.scale().addTo(GnuBoat.Webserver.private.map);
57 }
58}
Note: See TracBrowser for help on using the repository browser.