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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.