Reputation: 1189
Google Maps are blocked in china. So, we are looking for alternate solutions that have similar features like Google map. I found leafletjs for Map. but want to make sure that it works in china.
Upvotes: 3
Views: 1684
Reputation: 24
Yes, you can use many different maps with Leafletjs. I use Open Street maps in my app.
You can specify open street as your base map:
var openStreet = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
{
maxZoom: 18,
subdomains: ['a', 'b', 'c'],
attribution: 'Map data © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
});
You can add to leaflet with:
openStreet.addTo(map);
Upvotes: 0
Reputation: 2519
It should work. Leaflet as library should work without any restrictions I believe that tile maps should be the problem. Lucky, you have an extension to Leaflet that contains configurations for various Chinese tile providers.
But more about that on this site.
Hope it helps
Upvotes: 4