Giter Club home page Giter Club logo

Comments (3)

elesdoar avatar elesdoar commented on August 11, 2024

Could you provide more info. An example jsfiddle or plunk?

from leaflet-control-orderlayers.

pawaelus avatar pawaelus commented on August 11, 2024

I would like to add a few geojson layers and OSM buildings (with geojson file prepered by me) orderlayers control.
code:

            var test = {
                        "type": "FeatureCollection",
                        "crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },

                        "features": [
                        { "type": "Feature", "properties": { "id": 1 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 19.372517706874817, 51.870462293195203 ], [ 19.383449140566622, 51.875994346866371 ], [ 19.383449140566622, 51.875994346866371 ], [ 19.393753360849885, 51.874002885944066 ], [ 19.393753360849885, 51.874002885944066 ], [ 19.40629762902082, 51.870849559104272 ], [ 19.401907135160997, 51.852035647775509 ], [ 19.37153208580424, 51.855743717478589 ], [ 19.365259951718777, 51.862992941183535 ], [ 19.372517706874817, 51.870462293195203 ] ] ] } },
                        { "type": "Feature", "properties": { "id": 3 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 19.434791038151932, 51.868249281169724 ], [ 19.430042136630082, 51.848659378281077 ], [ 19.414899412909456, 51.850098474938363 ], [ 19.414451403331928, 51.865261542203768 ], [ 19.434791038151932, 51.868249281169724 ] ] ] } }
                        ]
                        };

            var myStyle = {
                            "color": "#ff7800",
                            "weight": 5,
                            "opacity": 0.65
                        };

            var json = new L.geoJson(test, {style: myStyle});   


            var osmb = new OSMBuildings(map).set(geoJSON).style({wallColor:'#815f33', roofColor:'#9f6a39'});

            L.control.orderlayers(baseLayers, {"ZGR_hybryda": ZH, "Budynki 3D": osmb, "json": json},{collapsed: false, order: 'qgis', title: 'Warstwy'}).addTo(map);
            L.control.layers(baseLayers, {"ZGR_hybryda": ZH, "Budynki 3D": osmb, "json": json, },{collapsed: false, opacity: true}).addTo(map);          

and pics:
orderlayer

from leaflet-control-orderlayers.

LovisaSandrine avatar LovisaSandrine commented on August 11, 2024

I have the same problem with GeoJson that pawaelus. Can you tell me if you have solved the issue in the pluggin or which solution is used to solved it.

from leaflet-control-orderlayers.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.