-
Notifications
You must be signed in to change notification settings - Fork 282
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
support for Google Maps #110
base: master
Are you sure you want to change the base?
Conversation
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 ! 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. |
@@ -116,6 +116,11 @@ L.Map.DjangoMap = L.Map.extend({ | |||
minZoom: this.options.minZoom, | |||
maxZoom: this.options.maxZoom | |||
}); | |||
// Google maps Plugin | |||
if (layer.url.substr(0,6) == 'GOOGLE') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems a bit fragile.
I would rather test with a regular expression : if (/^GOOGLE/.test(layer.url)) {
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:
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 |
96ea661
to
854ac59
Compare
f6487c7
to
0376c15
Compare
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