Changeset 883b4a5 for src/webapp


Ignore:
Timestamp:
Jan 13, 2019, 5:00:23 PM (8 years ago)
Author:
Joachim Langenbach <joachim.langenbach@…>
Branches:
debian/bullseye, master
Children:
26d66d8
Parents:
38a2121
Message:

Added GNUBoat tiles to leaflet map

Location:
src/webapp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/webapp/build.xml

    r38a2121 r883b4a5  
    11<?xml version="1.0" encoding="UTF-8"?>
     2<!--
     3        Copyright (C) 2017 - 2019 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
     4
     5    This program is free software: you can redistribute it and/or modify
     6    it under the terms of the GNU General Public License as published by
     7    the Free Software Foundation, either version 3 of the License, or
     8    (at your option) any later version.
     9
     10    This program 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
     13    GNU General Public License for more details.
     14
     15    You should have received a copy of the GNU General Public License
     16    along with this program.  If not, see <http://www.gnu.org/licenses/>.
     17-->
    218<project name="GNUBoatWebApp" default="dist">
    319
    … …  
    5571                </copy>
    5672        </target>
    57                 <target name="buildwebserver" depends="prepare">
     73        <target name="buildwebserver" depends="prepare">
    5874                <echo msg="Copying files to build directory"/>
    5975                <fileset dir="./webserver" id="filesWebserver">
    … …  
    7490                        <fileset refid="filesCommonJs"/>
    7591                </copy>
     92                <mkdir dir="${builddir}/webserver/tiles"/>
    7693        </target>
    7794
  • src/webapp/webserver/js/GnuBoat.Webserver.js

    r38a2121 r883b4a5  
    11/*
    22
    3     Copyright (C) 2018 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
     3    Copyright (C) 2018 - 2019 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
    44
    55    This library is free software; you can redistribute it and/or
    … …  
    3434        mapSetup: function ()
    3535        {
    36                 GnuBoat.Webserver.private.map = L.map('mapViewport').setView([51.505, -0.09], 13);
     36                GnuBoat.Webserver.private.map = L.map('mapViewport').setView([48.43, 10.04], 17);
    3737               
    3838                var layer_openstreetmap = L.tileLayer(
    … …  
    4545                ).addTo(GnuBoat.Webserver.private.map);
    4646               
     47                // add GNUBoat layers
     48                var layer_gnuboat_hillshade = L.tileLayer(
     49                        './tiles/hillshade/{z}/{x}/{y}.png',
     50                        {tms: true, opacity: 0.2, zIndex: 98, attribute: '&copy; <a href="http://gnuboat.engsas.de">GNUBoat</a> contributors'}
     51                );
     52                var layer_gnuboat_color_relief= L.tileLayer(
     53                        'tiles/color_relief/{z}/{x}/{y}.png',
     54                        {tms: true, opacity: 0.4, zIndex: 99, attribute: '&copy; <a href="http://gnuboat.engsas.de">GNUBoat</a> contributors'}
     55                );
     56                var layer_gnuboat_slopeshade = L.tileLayer(
     57                        'tiles/slopeshade/{z}/{x}/{y}.png',
     58                        {tms: true, opacity: 0.2, zIndex: 97, attribute: '&copy; <a href="http://gnuboat.engsas.de">GNUBoat</a> contributors'}
     59                );
     60                var layer_gnuboat_group = L.layerGroup([layer_gnuboat_color_relief, layer_gnuboat_hillshade, layer_gnuboat_slopeshade]).addTo(GnuBoat.Webserver.private.map);
    4761               
    4862                // add layer control
     63                var baselayers = {
     64                        "Map": layer_openstreetmap,
     65                };
     66                // overlays
     67                var overlays = {"Seamarks": layer_openseamap,
     68                        "GNUBoat": layer_gnuboat_group,
     69//                      "GNUBoat Hillshade": layer_gnuboat_hillshade,
     70//                      "GNUBoat Color Relief": layer_gnuboat_color_relief,
     71//                      "GNUBoat Slopeshade": layer_gnuboat_slopeshade,
     72                };
    4973                GnuBoat.Webserver.private.mapControl = L.control.layers(
    50                         {"Map": layer_openstreetmap},
    51                         {"Seamarks": layer_openseamap},
     74                        baselayers, overlays,
    5275                        {hideSingleBase: true, sortLayers: true, }
    5376                ).addTo(GnuBoat.Webserver.private.map);
Note: See TracChangeset for help on using the changeset viewer.