django-leaflet
django-leaflet copied to clipboard
support for Google Maps
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
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.
If we are going to have multiple layer types, we'd need the default Leaflet WMS layer as well.
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)