L.mapquest.key = 'KEY';
var baseLayer = L.mapquest.tileLayer('dark');
L.mapquest.geocoding().geocode(['New York, NY'], showMap);
function showMap(err, data) {
var map = createMap();
map.addControl(L.mapquest.control());
addLayerControl(map);
}
function createMap() {
var map = L.mapquest.map('map', {
center: [40.7237, -73.9825],
zoom: 14,
layers: baseLayer
});
return map;
}
function addLayerControl(map) {
L.control.layers({
'Map': L.mapquest.tileLayer('map'),
'Satellite': L.mapquest.tileLayer('satellite'),
'Hybrid': L.mapquest.tileLayer('hybrid'),
'Light': L.mapquest.tileLayer('light'),
'Dark': baseLayer
}, {}, { position: 'topleft'}).addTo(map);
}
We give you the flexibility to use open source data or licensed data with most of our APIs and SDKs.