django-leaflet icon indicating copy to clipboard operation
django-leaflet copied to clipboard

support for Google Maps

Open Formatc1 opened this issue 10 years ago • 3 comments

It's required following Plugin for Leaflet: https://github.com/shramov/leaflet-plugins/blob/master/layer/tile/Google.js

In settings.py shows up new additional options: 'TILES': [('Google Roadmap', 'GOOGLE-ROADMAP', {'attribution': '© Google'}), ('Google Terrain', 'GOOGLE-TERRAIN', {'attribution': '© Google'}), ('Google Satellite', 'GOOGLE-SATELLITE', {'attribution': '© Google'})]

And it's possible to use maps from Google like other Leaflet Tiles Maps.

More info about this plugin on author's page: https://github.com/shramov/leaflet-plugins

Formatc1 avatar Aug 05 '15 16:08 Formatc1

Thanks for this contribution !

As you can see from the delay in responding you, this library is not receiving as much love and care as it deserves :)

I would prefer to let the guyz at Makina Corpus merge the pull requests. But meanwhile, I'll give a small code review ! Thanks again for taking the time to improve django-leaflet !


We would welcome any help for maintaining this library. If you use it and find it useful, please Watch it on Github, help us review contributions or comment issues :) Thousand thanks in advance.

leplatrem avatar Sep 06 '15 22:09 leplatrem

If we are going to have multiple layer types, we'd need the default Leaflet WMS layer as well.

dyve avatar Sep 07 '15 08:09 dyve

About google layer and tile layer:

'TILES': [
    ('Google Roadmap', ('Google', 'ROADMAP'), {'attribution': '© Google'}),
    (_('OSM'), ('TileLayer', '//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'), {'attribution': ''© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'}),
]

in l2d function add check for typeof l[1] === 'string' for adding backward compatibility, add returning layerClass and arg. Then you can create layer by new L[layer.layerClass](layer.arg, layer.options)

kosmos342 avatar Jan 27 '16 20:01 kosmos342