Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

streamlines #19

Open
GeoTuxMan opened this issue Dec 10, 2024 · 0 comments
Open

streamlines #19

GeoTuxMan opened this issue Dec 10, 2024 · 0 comments

Comments

@GeoTuxMan
Copy link

I try to show currents from Black Sea on a map with streamlines (with leaflet-velocity).
But all streamlines are same color and the map looks very bad.
The map is here: https://syroco.rmri.ro/earth/index.html
I keep the original layer (Ocean Current -Great Barrier Reef) , to see the diference between layers.
I look forward to any suggestion, idea.
The code from demo.js:

                                          function initDemoMap() {
                      var Esri_WorldImagery = L.tileLayer(
                     "http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",
                     {
                   attribution:
                   "SYROCO 2024" +
                     "NIMRD 'Grigore Antipa'"
                    }
                   );

              var Esri_DarkGreyCanvas = L.tileLayer(
             "http://{s}.sm.mapstack.stamen.com/" +
             "(toner-lite,$fff[difference],$fff[@23],$fff[hsl-saturation@20])/" +
             "{z}/{x}/{y}.png",
            {
            attribution:
            "SYROCO 2024" +
            "NIMRD 'Grigore Antipa'"
             }
             );

            var baseLayers = {
             Satellite: Esri_WorldImagery,
            "Grey Canvas": Esri_DarkGreyCanvas
            };

          var map = L.map("map", {
         layers: [Esri_WorldImagery]
          });

         var layerControl = L.control.layers(baseLayers);
         layerControl.addTo(map);
         map.setView([43, 35], 7);

        return {
        map: map,
         layerControl: layerControl
         };
         }

        // demo map
        var mapStuff = initDemoMap();
        var map = mapStuff.map;
        var layerControl = mapStuff.layerControl;

         

                         $.getJSON("water-gbr.json", function(data) {
                          var velocityLayer = L.velocityLayer({
                         displayValues: true,
                         displayOptions: {
                         velocityType: "GBR Water",
                          position: "bottomleft",
                         emptyString: "No water data"
                            },
                         data: data,
                          maxVelocity: 0.6,
                         velocityScale: 0.1 // arbitrary default 0.005
                        });

                      layerControl.addOverlay(velocityLayer, "Ocean Current - Great Barrier Reef");
                       });

                        $.getJSON("currents_6Dec2024.json", function(data) {
                       var velocityLayer = L.velocityLayer({
                        displayValues: true,
                        displayOptions: {
                        velocityType: "GBR Water",
                        position: "bottomleft",
                        emptyString: "No water data"
                        },
                          data: data,
                         minVelocity: -0.5,
                         maxVelocity: 0.3,
                         velocityScale: 0.1 // arbitrary default 0.005
                       });

                         layerControl.addOverlay(velocityLayer, "Black Sea Current - Romania");
                           });`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant