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

No color on Black Sea map #114

Open
GeoTuxMan opened this issue Nov 7, 2024 · 0 comments
Open

No color on Black Sea map #114

GeoTuxMan opened this issue Nov 7, 2024 · 0 comments

Comments

@GeoTuxMan
Copy link

GeoTuxMan commented Nov 7, 2024

I try to show currents from Black Sea on a map with streamlines.
But all streamlines are same color.
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.

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");
                               });

`

My current dataset: (blacksea.json)
[{"header": {"parameterUnit":"m.s-1", "parameterNumber":2, "dx":1.0, "dy":1.0, "parameterNumberName":"U_component_of_current", "la1":80, "la2":-80, "parameterCategory":2, "lo2":379.66, "nx":83, "ny":141, "refTime":"2023-11-07 13:55:00", "lo1":20}, "data":[-0.04,-0.05,-0.05,.....] {"header": {"parameterUnit":"m.s-1", "parameterNumber":3, "dx":1.0, "dy":1.0, "parameterNumberName":"V_component_of_current", "la1":80, "la2":-80, "parameterCategory":2, "lo2":379.66, "nx":83, "ny":141, "refTime":"2023-11-07 13:55:00", "lo1":20}, "data":[....]

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