Coder Social home page Coder Social logo

humangeo / leaflet-tilefilter Goto Github PK

View Code? Open in Web Editor NEW
96.0 96.0 19.0 1.31 MB

Change the appearance of Leaflet map tiles on the fly using a variety of canvas or CSS3 image filters. It's like Instagram for Leaflet map tiles.

License: MIT License

JavaScript 79.61% HTML 20.39%
geospatial mapping maps

leaflet-tilefilter's People

Contributors

sfairgrieve avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

leaflet-tilefilter's Issues

Highest compatible version

Hi,

What is the highest compatible leaflet version that works with your filter plugin? 0.7 seems fine, 1.3 doesn't work.

Thanks

options not defined

I don't get the example code to run because of an console error:

            var map = L.map("map-canvas", {
                attributionControl: false,
                zoomControl: false
            }).setView(L.latLng(47.491695, 11.095498), 12);




            var baseLayer = new L.TileLayer('http://otile1.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpg', {
                filter: function () {
                    new L.CSSFilter(this, {
                        filters: ['saturate(200%)']
                    }).render();
                }
            });
            map.addLayer(baseLayer);

throws an error

Uncaught ReferenceError: options is not definedL.ChannelFilters.Matrix.L.ChannelFilter.extend.initialize @ leaflet-tilefilter.self.js?body=1:657e @ leaflet.js:6(anonymous function) @ leaflet-tilefilter.self.js?body=1:1044
scaffold.self.js?body=1:3 5

with leaflet version: http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js

Help would be appreciated

How to use Canvas Filter on leaflet map

Hi and congrats for your great work .

I would like to ask you how can I use Canvas Filter eg WaterTransparent on a simple leaflet map as mentioned in code below ?Note that I have already included the required Javascript file .
I am using leaflet v1.0.3 .

require('leaflet-tilefilter/master/src/leaflet-tilefilter.js');
const map = L.map('map', {
      center: [30, 25],
      zoom: 2,
      minZoom: 2,
      maxZoom: 4
    });

Thank you in advance .

bower info

bower.json and package.json has a reference to "dist/TileLayer.Filter.min.js" and should be "dist/leaflet-tilefilter.min.js"

Use with Webpack?

Probably a dumb question, but what is the most appropriate way to integrate this with a Webpack project?

I am working on a project built with Vue, Leaflet, and Webpack. Could you provide some guidance on this? Thanks.

ctx.drawImage is not a function

    var map = L.map('map').setView([51.505, -0.09], 15);


    var tilelayer = new L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
        attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
        filter: function (image, ctx) {
            new L.CanvasFilter({
                channelFilter: function (imageData) {
                    return new L.ChannelFilters.Sepia().render(imageData);
                }
            }).render(this, image, ctx);
        }
    });

    map.addLayer(tilelayer); 

The above code gives:

Uncaught TypeError: ctx.drawImage is not a function
at i.render (leaflet-tilefilter.js:381)
at i.filter (london_map.html:33)
at i._tileOnLoad (leaflet-tilefilter.js:1160)
at HTMLImageElement.s (leaflet.js:5)

in console.

So far I can only get the filter to work with CSS filter written in the simplified style:

var tilelayer = new L.tileLayer('https://wmts20.geo.admin.ch/1.0.0/ch.swisstopo.vec25-gebaeude/default/20090401/3857/{z}/{x}/{y}.png', { minZoom: 13, maxZoom: 15, cssFilter: L.ImageFilters.GenerateCSSFilter(['contrast(160%)', 'saturate(0%)', 'brightness(94%)']), detectRetina: true });

But I really need the Canvas filter.

I am using leaflet 1.5.1 and leaflet-tilefilter 1.0dev

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.