/* Copyright (C) 2018 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ /** @namespace GnuBoat JavaScript namespace */ var GnuBoat = GnuBoat || {}; /** @namespace GnuBoat Webserver JavaScript namespace */ GnuBoat.Webserver = GnuBoat.Webserver || {}; GnuBoat.Webserver.initialize = function() { GnuBoat.Webserver.private.mapSetup(); } GnuBoat.Webserver.private = { map: null, mapSetup: function () { GnuBoat.Webserver.private.map = L.map('mapViewport').setView([51.505, -0.09], 13); var layer_openstreetmap = L.tileLayer( 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { attribution: '© OpenStreetMap contributors'} ).addTo(GnuBoat.Webserver.private.map); var layer_openseamap = L.tileLayer( 'http://tiles.openseamap.org/seamark/{z}/{x}/{y}.png', {attribute: '© OpenSeaMap contributors'} ).addTo(GnuBoat.Webserver.private.map); // add layer control GnuBoat.Webserver.private.mapControl = L.control.layers( {"Map": layer_openstreetmap}, {"Seamarks": layer_openseamap}, {hideSingleBase: true, sortLayers: true, } ).addTo(GnuBoat.Webserver.private.map); // add scale L.control.scale().addTo(GnuBoat.Webserver.private.map); } }