Remove cloudmade tilesets
This commit is contained in:
parent
c3129a02ea
commit
28c56c4bb0
@ -25,18 +25,16 @@
|
|||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
var cloudmade = L.tileLayer('http://{s}.tile.cloudmade.com/{key}/997/256/{z}/{x}/{y}.png', {
|
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
||||||
maxZoom: 18,
|
osmAttrib = '© <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
|
||||||
attribution: 'Map data © 2011 OpenStreetMap contributors, Imagery © 2011 CloudMade',
|
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib});
|
||||||
key: 'd4fc77ea4a63471cab2423e66626cbb6'
|
|
||||||
});
|
|
||||||
|
|
||||||
//Disable the hack fix
|
//Disable the hack fix
|
||||||
L.Browser.chrome = true;
|
L.Browser.chrome = true;
|
||||||
|
|
||||||
var map = L.map('map')
|
var map = L.map('map')
|
||||||
.setView([50.5, 30.51], 15)
|
.setView([50.5, 30.51], 15)
|
||||||
.addLayer(cloudmade);
|
.addLayer(osm);
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -16,15 +16,12 @@
|
|||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
function getCloudMadeUrl(styleId) {
|
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
||||||
return 'http://{s}.tile.cloudmade.com/d4fc77ea4a63471cab2423e66626cbb6/' + styleId + '/256/{z}/{x}/{y}.png';
|
osmAttrib = '© <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
|
||||||
}
|
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib}),
|
||||||
|
osm2 = new L.TileLayer(osmUrl, {attribution: 'Hello world'});
|
||||||
|
|
||||||
var cloudmadeAttribution = 'Map data © 2011 OpenStreetMap contributors, Imagery © 2011 CloudMade',
|
var map = new L.Map('map').addLayer(osm).setView(new L.LatLng(50.5, 30.512), 15);
|
||||||
cloudmade = new L.TileLayer(getCloudMadeUrl(997), {attribution: cloudmadeAttribution}),
|
|
||||||
cloudmade2 = new L.TileLayer(getCloudMadeUrl(998), {attribution: 'Hello world'});
|
|
||||||
|
|
||||||
var map = new L.Map('map').addLayer(cloudmade).setView(new L.LatLng(50.5, 30.512), 15);
|
|
||||||
|
|
||||||
var marker = new L.Marker(new L.LatLng(50.5, 30.505), {color: 'red'});
|
var marker = new L.Marker(new L.LatLng(50.5, 30.505), {color: 'red'});
|
||||||
map.addLayer(marker);
|
map.addLayer(marker);
|
||||||
@ -34,8 +31,8 @@
|
|||||||
map.addLayer(marker2);
|
map.addLayer(marker2);
|
||||||
|
|
||||||
var layersControl = new L.Control.Layers({
|
var layersControl = new L.Control.Layers({
|
||||||
'CloudMade Fresh': cloudmade,
|
'OSM': osm,
|
||||||
'CloudMade Pale Dawn': cloudmade2
|
'OSM2': osm2
|
||||||
}, {
|
}, {
|
||||||
'Some marker': marker,
|
'Some marker': marker,
|
||||||
'Another marker': marker2
|
'Another marker': marker2
|
||||||
|
@ -17,11 +17,11 @@
|
|||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/d4fc77ea4a63471cab2423e66626cbb6/997/256/{z}/{x}/{y}.png',
|
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
||||||
cloudmadeAttribution = 'Map data © 2011 OpenStreetMap contributors, Imagery © 2011 CloudMade',
|
osmAttrib = '© <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
|
||||||
cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 18, attribution: cloudmadeAttribution});
|
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib});
|
||||||
|
|
||||||
var map = new L.Map('map', {zoom: 15, layers: [cloudmade]});
|
var map = new L.Map('map', {zoom: 15, layers: [osm]});
|
||||||
|
|
||||||
function logEvent(e) { console.log(e.type); }
|
function logEvent(e) { console.log(e.type); }
|
||||||
map.on('locationerror', logEvent);
|
map.on('locationerror', logEvent);
|
||||||
|
@ -19,13 +19,13 @@
|
|||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/d4fc77ea4a63471cab2423e66626cbb6/997/256/{z}/{x}/{y}.png',
|
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
||||||
cloudmadeAttribution = 'Map data © 2011 OpenStreetMap contributors, Imagery © 2011 CloudMade',
|
osmAttrib = '© <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
|
||||||
cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 18, attribution: cloudmadeAttribution}),
|
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib});
|
||||||
latlng = new L.LatLng(50.5, 30.51);
|
latlng = new L.LatLng(50.5, 30.51);
|
||||||
|
|
||||||
var map = new L.Map('map');
|
var map = new L.Map('map');
|
||||||
map.addLayer(cloudmade);
|
map.addLayer(osm);
|
||||||
|
|
||||||
var bounds = new L.LatLngBounds(
|
var bounds = new L.LatLngBounds(
|
||||||
new L.LatLng(40.71222,-74.22655),
|
new L.LatLng(40.71222,-74.22655),
|
||||||
|
@ -18,12 +18,12 @@
|
|||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/d4fc77ea4a63471cab2423e66626cbb6/997/256/{z}/{x}/{y}.png',
|
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
||||||
cloudmadeAttribution = 'Map data © 2011 OpenStreetMap contributors, Imagery © 2011 CloudMade',
|
osmAttrib = '© <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
|
||||||
cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 18, attribution: cloudmadeAttribution}),
|
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib}),
|
||||||
latlng = new L.LatLng(50.5, 30.51);
|
latlng = new L.LatLng(50.5, 30.51);
|
||||||
|
|
||||||
var map = new L.Map('map', {center: latlng, zoom: 15, layers: [cloudmade]});
|
var map = new L.Map('map', {center: latlng, zoom: 15, layers: [osm]});
|
||||||
|
|
||||||
var marker = new L.Marker(latlng);
|
var marker = new L.Marker(latlng);
|
||||||
map.addLayer(marker);
|
map.addLayer(marker);
|
||||||
|
@ -19,15 +19,13 @@
|
|||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
var cloudmade = L.tileLayer('http://{s}.tile.cloudmade.com/{key}/997/256/{z}/{x}/{y}.png', {
|
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
||||||
maxZoom: 18,
|
osmAttrib = '© <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
|
||||||
attribution: 'Map data © 2011 <a href="#">OpenStreetMap</a> contributors, Imagery © 2011 <a href="#">CloudMade</a>',
|
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib});
|
||||||
key: 'd4fc77ea4a63471cab2423e66626cbb6'
|
|
||||||
});
|
|
||||||
|
|
||||||
var map = L.map('map')
|
var map = L.map('map')
|
||||||
.setView([50.5, 30.51], 15)
|
.setView([50.5, 30.51], 15)
|
||||||
.addLayer(cloudmade);
|
.addLayer(osm);
|
||||||
|
|
||||||
var markers = new L.FeatureGroup();
|
var markers = new L.FeatureGroup();
|
||||||
|
|
||||||
|
@ -18,15 +18,15 @@
|
|||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/d4fc77ea4a63471cab2423e66626cbb6/997/256/{z}/{x}/{y}.png',
|
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
||||||
cloudmadeAttribution = 'Map data © 2011 OpenStreetMap contributors, Imagery © 2011 CloudMade',
|
osmAttrib = '© <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
|
||||||
cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 18, attribution: cloudmadeAttribution}),
|
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib}),
|
||||||
bounds = new L.LatLngBounds(new L.LatLng(49.5, -11.3), new L.LatLng(61.2, 2.5));
|
bounds = new L.LatLngBounds(new L.LatLng(49.5, -11.3), new L.LatLng(61.2, 2.5));
|
||||||
|
|
||||||
var map = new L.Map('map', {
|
var map = new L.Map('map', {
|
||||||
center: bounds.getCenter(),
|
center: bounds.getCenter(),
|
||||||
zoom: 7,
|
zoom: 7,
|
||||||
layers: [cloudmade],
|
layers: [osm],
|
||||||
maxBounds: bounds
|
maxBounds: bounds
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -82,11 +82,9 @@
|
|||||||
CASE 1: no opacity set on any layers
|
CASE 1: no opacity set on any layers
|
||||||
**********/
|
**********/
|
||||||
// OSM Basemap
|
// OSM Basemap
|
||||||
var osm1 = L.tileLayer('http://{s}.tile.cloudmade.com/{key}/{styleId}/256/{z}/{x}/{y}.png?v=1', {
|
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
||||||
attribution: '',
|
|
||||||
key: 'BC9A493B41014CAABB98F0471D759707',
|
var osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: ''}).addTo(map1);
|
||||||
styleId: 97941
|
|
||||||
}).addTo(map1);
|
|
||||||
|
|
||||||
// EEZs / Nations
|
// EEZs / Nations
|
||||||
var eez1 = new L.tileLayer('http://tile1.mpatlas.org/tilecache/eezs/{z}/{x}/{y}.png', {
|
var eez1 = new L.tileLayer('http://tile1.mpatlas.org/tilecache/eezs/{z}/{x}/{y}.png', {
|
||||||
@ -103,11 +101,7 @@
|
|||||||
CASE 2: opacity set on overlays but not on basemap
|
CASE 2: opacity set on overlays but not on basemap
|
||||||
**********/
|
**********/
|
||||||
// OSM Basemap
|
// OSM Basemap
|
||||||
var osm2 = L.tileLayer('http://{s}.tile.cloudmade.com/{key}/{styleId}/256/{z}/{x}/{y}.png?v=1', {
|
var osm2 = L.tileLayer(osmUrl, {maxZoom: 18, attribution: ''}).addTo(map2);
|
||||||
attribution: '',
|
|
||||||
key: 'BC9A493B41014CAABB98F0471D759707',
|
|
||||||
styleId: 97941
|
|
||||||
}).addTo(map2);
|
|
||||||
|
|
||||||
// EEZs / Nations
|
// EEZs / Nations
|
||||||
var eez2 = new L.tileLayer('http://tile1.mpatlas.org/tilecache/eezs/{z}/{x}/{y}.png', {
|
var eez2 = new L.tileLayer('http://tile1.mpatlas.org/tilecache/eezs/{z}/{x}/{y}.png', {
|
||||||
@ -126,12 +120,7 @@
|
|||||||
CASE 3: opacity set on overlays but not on basemap, zIndex option set to 0 on basemap
|
CASE 3: opacity set on overlays but not on basemap, zIndex option set to 0 on basemap
|
||||||
**********/
|
**********/
|
||||||
// OSM Basemap
|
// OSM Basemap
|
||||||
var osm3 = L.tileLayer('http://{s}.tile.cloudmade.com/{key}/{styleId}/256/{z}/{x}/{y}.png?v=1', {
|
var osm3 = L.tileLayer(osmUrl, {maxZoom: 18, attribution: '', zIndex: 0}).addTo(map3);
|
||||||
attribution: '',
|
|
||||||
key: 'BC9A493B41014CAABB98F0471D759707',
|
|
||||||
styleId: 97941,
|
|
||||||
zIndex: 0
|
|
||||||
}).addTo(map3);
|
|
||||||
|
|
||||||
// EEZs / Nations
|
// EEZs / Nations
|
||||||
var eez3 = new L.tileLayer('http://tile1.mpatlas.org/tilecache/eezs/{z}/{x}/{y}.png', {
|
var eez3 = new L.tileLayer('http://tile1.mpatlas.org/tilecache/eezs/{z}/{x}/{y}.png', {
|
||||||
@ -150,12 +139,7 @@
|
|||||||
CASE 4: opacity set on overlays but set to 1 on basemap
|
CASE 4: opacity set on overlays but set to 1 on basemap
|
||||||
**********/
|
**********/
|
||||||
// OSM Basemap
|
// OSM Basemap
|
||||||
var osm4 = L.tileLayer('http://{s}.tile.cloudmade.com/{key}/{styleId}/256/{z}/{x}/{y}.png?v=1', {
|
var osm4 = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib}).addTo(map4);
|
||||||
attribution: '',
|
|
||||||
key: 'BC9A493B41014CAABB98F0471D759707',
|
|
||||||
styleId: 97941,
|
|
||||||
opacity: 1
|
|
||||||
}).addTo(map4);
|
|
||||||
|
|
||||||
// EEZs / Nations
|
// EEZs / Nations
|
||||||
var eez4 = new L.tileLayer('http://tile1.mpatlas.org/tilecache/eezs/{z}/{x}/{y}.png', {
|
var eez4 = new L.tileLayer('http://tile1.mpatlas.org/tilecache/eezs/{z}/{x}/{y}.png', {
|
||||||
@ -174,12 +158,7 @@
|
|||||||
CASE 5: opacity set to .5 on all layers
|
CASE 5: opacity set to .5 on all layers
|
||||||
**********/
|
**********/
|
||||||
// OSM Basemap
|
// OSM Basemap
|
||||||
var osm5 = L.tileLayer('http://{s}.tile.cloudmade.com/{key}/{styleId}/256/{z}/{x}/{y}.png?v=1', {
|
var osm5 = L.tileLayer(osmUrl, {maxZoom: 18, attribution: '', opacity: 0.99}).addTo(map5);
|
||||||
attribution: '',
|
|
||||||
key: 'BC9A493B41014CAABB98F0471D759707',
|
|
||||||
styleId: 97941,
|
|
||||||
opacity: 0.99
|
|
||||||
}).addTo(map5);
|
|
||||||
|
|
||||||
// EEZs / Nations
|
// EEZs / Nations
|
||||||
var eez5 = new L.tileLayer('http://tile1.mpatlas.org/tilecache/eezs/{z}/{x}/{y}.png', {
|
var eez5 = new L.tileLayer('http://tile1.mpatlas.org/tilecache/eezs/{z}/{x}/{y}.png', {
|
||||||
@ -198,12 +177,7 @@
|
|||||||
CASE 6: opacity set to .5 on 1st and 3rd layers and 1 on middle layer
|
CASE 6: opacity set to .5 on 1st and 3rd layers and 1 on middle layer
|
||||||
**********/
|
**********/
|
||||||
// OSM Basemap
|
// OSM Basemap
|
||||||
var osm6 = L.tileLayer('http://{s}.tile.cloudmade.com/{key}/{styleId}/256/{z}/{x}/{y}.png?v=1', {
|
var osm6 = L.tileLayer(osmUrl, {maxZoom: 18, attribution: '', opacity: 0.99}).addTo(map6);
|
||||||
attribution: '',
|
|
||||||
key: 'BC9A493B41014CAABB98F0471D759707',
|
|
||||||
styleId: 97941,
|
|
||||||
opacity: 0.99
|
|
||||||
}).addTo(map6);
|
|
||||||
|
|
||||||
// EEZs / Nations
|
// EEZs / Nations
|
||||||
var eez6 = new L.tileLayer('http://tile1.mpatlas.org/tilecache/eezs/{z}/{x}/{y}.png', {
|
var eez6 = new L.tileLayer('http://tile1.mpatlas.org/tilecache/eezs/{z}/{x}/{y}.png', {
|
||||||
|
@ -22,12 +22,12 @@
|
|||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/d4fc77ea4a63471cab2423e66626cbb6/997/256/{z}/{x}/{y}.png',
|
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
||||||
cloudmadeAttribution = 'Map data © 2011 OpenStreetMap contributors, Imagery © 2011 CloudMade',
|
osmAttrib = '© <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
|
||||||
cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 18, attribution: cloudmadeAttribution}),
|
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib}),
|
||||||
latlng = new L.LatLng(50.5, 30.51);
|
latlng = new L.LatLng(50.5, 30.51);
|
||||||
|
|
||||||
var map = new L.Map('map', {center: latlng, zoom: 15, layers: [cloudmade]});
|
var map = new L.Map('map', {center: latlng, zoom: 15, layers: [osm]});
|
||||||
|
|
||||||
var s = '';
|
var s = '';
|
||||||
for (var i = 0; i < 100; i++) s += 'Test<br>';
|
for (var i = 0; i < 100; i++) s += 'Test<br>';
|
||||||
|
@ -17,10 +17,10 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var map = new L.Map('map');
|
var map = new L.Map('map');
|
||||||
|
|
||||||
var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/d4fc77ea4a63471cab2423e66626cbb6/{styleId}/256/{z}/{x}/{y}.png',
|
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
||||||
cloudmadeAttribution = 'Map data © 2011 OpenStreetMap contributors, Imagery © 2011 CloudMade',
|
osmAttrib = '© <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
|
||||||
cloudmade = new L.TileLayer(cloudmadeUrl, {styleId: 997, attribution: cloudmadeAttribution}),
|
osm = L.tileLayer(osmUrl, {attribution: osmAttrib}),
|
||||||
cloudmade2 = new L.TileLayer(cloudmadeUrl, {styleId: 998, attribution: cloudmadeAttribution});
|
osm2 = L.tileLayer(osmUrl, {attribution: osmAttrib});
|
||||||
|
|
||||||
var nexrad = new L.TileLayer.WMS("http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi", {
|
var nexrad = new L.TileLayer.WMS("http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi", {
|
||||||
layers: 'nexrad-n0r-900913',
|
layers: 'nexrad-n0r-900913',
|
||||||
@ -32,9 +32,9 @@
|
|||||||
|
|
||||||
var bounds = new L.LatLngBounds(new L.LatLng(32, -126), new L.LatLng(50, -64));
|
var bounds = new L.LatLngBounds(new L.LatLng(32, -126), new L.LatLng(50, -64));
|
||||||
|
|
||||||
map.addLayer(cloudmade).addLayer(nexrad).fitBounds(bounds);
|
map.addLayer(osm).addLayer(nexrad).fitBounds(bounds);
|
||||||
|
|
||||||
L.control.layers({"CM": cloudmade, "CM2": cloudmade2}, {"NexRad": nexrad}).addTo(map);
|
L.control.layers({"CM": osm, "CM2": osm2}, {"NexRad": nexrad}).addTo(map);
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -18,19 +18,15 @@
|
|||||||
// Test that changing between layers with differing zoomlevels also updates
|
// Test that changing between layers with differing zoomlevels also updates
|
||||||
// the zoomlevels in the map + also
|
// the zoomlevels in the map + also
|
||||||
|
|
||||||
function getCloudMadeUrl(styleId) {
|
|
||||||
return 'http://{s}.tile.cloudmade.com/d4fc77ea4a63471cab2423e66626cbb6/' + styleId + '/256/{z}/{x}/{y}.png';
|
|
||||||
}
|
|
||||||
|
|
||||||
var map = L.map('map').setView(L.latLng(50.5, 30.51), 0);
|
var map = L.map('map').setView(L.latLng(50.5, 30.51), 0);
|
||||||
|
|
||||||
var cloudmadeAttribution = 'Map data © 2011 OpenStreetMap contributors, Imagery © 2011 CloudMade',
|
var osmAttrib = '© <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
|
||||||
cloudmade = L.tileLayer(getCloudMadeUrl(997), {attribution: cloudmadeAttribution, minZoom: 0, maxZoom: 10}).addTo(map),
|
osm = L.tileLayer("http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {attribution: osmAttrib, minZoom: 0, maxZoom: 10}).addTo(map),
|
||||||
cloudmade2 = L.tileLayer(getCloudMadeUrl(998), {attribution: 'Hello world', minZoom: 5, maxZoom: 18});
|
osm2 = L.tileLayer("http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {attribution: 'Hello world', minZoom: 5, maxZoom: 18});
|
||||||
|
|
||||||
L.control.layers({
|
L.control.layers({
|
||||||
'CloudMade Pale Dawn (5-18)': cloudmade2,
|
'OSM (5-18)': osm2,
|
||||||
'CloudMade Fresh (0-10)': cloudmade
|
'OSM (0-10)': osm
|
||||||
}).addTo(map);
|
}).addTo(map);
|
||||||
|
|
||||||
L.control.scale().addTo(map);
|
L.control.scale().addTo(map);
|
||||||
|
@ -13,16 +13,16 @@
|
|||||||
<script>
|
<script>
|
||||||
L_PREFER_CANVAS = true;
|
L_PREFER_CANVAS = true;
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/d4fc77ea4a63471cab2423e66626cbb6/997/256/{z}/{x}/{y}.png',
|
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
||||||
cloudmadeAttribution = 'Map data © 2011 OpenStreetMap contributors, Imagery © 2011 CloudMade',
|
osmAttrib = '© <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
|
||||||
cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 18, attribution: cloudmadeAttribution});
|
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib});
|
||||||
|
|
||||||
var map = L.map('map', {
|
var map = L.map('map', {
|
||||||
minZoom: 1,
|
minZoom: 1,
|
||||||
maxZoom: 19,
|
maxZoom: 19,
|
||||||
center: [51.505, -0.09],
|
center: [51.505, -0.09],
|
||||||
zoom: 9,
|
zoom: 9,
|
||||||
layers: [cloudmade]
|
layers: [osm]
|
||||||
});
|
});
|
||||||
|
|
||||||
var polygons = new L.FeatureGroup();
|
var polygons = new L.FeatureGroup();
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function addLayerAndMarker(map) {
|
function addLayerAndMarker(map) {
|
||||||
var layer = new L.TileLayer('http://{s}.tile.cloudmade.com/d4fc77ea4a63471cab2423e66626cbb6/997/256/{z}/{x}/{y}.png', {
|
var layer = new L.TileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
|
||||||
maxZoom : 18
|
maxZoom : 18
|
||||||
}).addTo(map);
|
}).addTo(map);
|
||||||
|
|
||||||
|
@ -23,12 +23,12 @@
|
|||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/d4fc77ea4a63471cab2423e66626cbb6/997/256/{z}/{x}/{y}.png',
|
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
||||||
cloudmadeAttribution = 'Map data © 2011 OpenStreetMap contributors, Imagery © 2011 CloudMade',
|
osmAttrib = '© <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
|
||||||
cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 18, attribution: cloudmadeAttribution}),
|
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib}),
|
||||||
latlng = new L.LatLng(50.5, 30.51);
|
latlng = new L.LatLng(50.5, 30.51);
|
||||||
|
|
||||||
var map = new L.Map('map', {center: latlng, zoom: 15, layers: [cloudmade]});
|
var map = new L.Map('map', {center: latlng, zoom: 15, layers: [osm]});
|
||||||
|
|
||||||
//Create a marker, clicking it toggles opacity
|
//Create a marker, clicking it toggles opacity
|
||||||
var marker = new L.Marker(latlng, { icon: new L.DivIcon({ className: 'mybox', iconSize: new L.Point(100,100), html: 'opaque. click to toggle' }) });
|
var marker = new L.Marker(latlng, { icon: new L.DivIcon({ className: 'mybox', iconSize: new L.Point(100,100), html: 'opaque. click to toggle' }) });
|
||||||
|
@ -24,8 +24,7 @@ map.on('contextmenu', function (e) {
|
|||||||
alert('The map has been right-clicked');
|
alert('The map has been right-clicked');
|
||||||
});
|
});
|
||||||
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
|
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
|
||||||
attribution: 'Map data © 2011 OpenStreetMap contributors, Imagery © 2011 CloudMade',
|
attribution: '© <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
|
||||||
key: 'BC9A493B41014CAABB98F0471D759707'
|
|
||||||
}).addTo(map);
|
}).addTo(map);
|
||||||
|
|
||||||
|
|
||||||
|
@ -25,11 +25,8 @@
|
|||||||
|
|
||||||
map.setView([51.505, -0.09], 13);
|
map.setView([51.505, -0.09], 13);
|
||||||
|
|
||||||
var cloudmade = L.tileLayer('http://{s}.tile.cloudmade.com/{key}/{styleId}/256/{z}/{x}/{y}.png', {
|
var osm = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
|
||||||
attribution: 'Map data © 2011 OpenStreetMap contributors, Imagery © 2011 CloudMade',
|
attribution: '© <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
|
||||||
maxZoom: 18,
|
|
||||||
key: 'd4fc77ea4a63471cab2423e66626cbb6',
|
|
||||||
styleId: 997
|
|
||||||
}).addTo(map);
|
}).addTo(map);
|
||||||
|
|
||||||
var a_popup = L.popup().setContent('Previously created')
|
var a_popup = L.popup().setContent('Previously created')
|
||||||
|
@ -24,15 +24,13 @@
|
|||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
var cloudmade = L.tileLayer('http://{s}.tile.cloudmade.com/{key}/997/256/{z}/{x}/{y}.png', {
|
var osm = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
|
||||||
maxZoom: 18,
|
attribution: '© <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
|
||||||
attribution: 'Map data © 2011 OpenStreetMap contributors, Imagery © 2011 CloudMade',
|
|
||||||
key: 'd4fc77ea4a63471cab2423e66626cbb6'
|
|
||||||
});
|
});
|
||||||
|
|
||||||
var map = L.map('map')
|
var map = L.map('map')
|
||||||
.setView([50.5, 30.51], 15)
|
.setView([50.5, 30.51], 15)
|
||||||
.addLayer(cloudmade);
|
.addLayer(osm);
|
||||||
|
|
||||||
map.on('click', function(e) {
|
map.on('click', function(e) {
|
||||||
L.popup().setLatLng(e.latlng).setContent('Hello').openOn(map);
|
L.popup().setLatLng(e.latlng).setContent('Hello').openOn(map);
|
||||||
|
@ -16,8 +16,8 @@
|
|||||||
<button onclick="boundsExtendLatLng()">Extend the bounds of the center rectangle with the lower left marker</button>
|
<button onclick="boundsExtendLatLng()">Extend the bounds of the center rectangle with the lower left marker</button>
|
||||||
<script src="route.js"></script>
|
<script src="route.js"></script>
|
||||||
<script>
|
<script>
|
||||||
var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/d4fc77ea4a63471cab2423e66626cbb6/997/256/{z}/{x}/{y}.png',
|
var osmUrl = 'http://{s}.tile.osm.org/{z}/{x}/{y}.png',
|
||||||
cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 18});
|
osm = new L.TileLayer(osmUrl, {maxZoom: 18});
|
||||||
|
|
||||||
var latLng = new L.LatLng(54.18815548107151, -7.657470703124999);
|
var latLng = new L.LatLng(54.18815548107151, -7.657470703124999);
|
||||||
|
|
||||||
@ -26,7 +26,7 @@
|
|||||||
var bounds3;
|
var bounds3;
|
||||||
|
|
||||||
var map = new L.Map('map', {
|
var map = new L.Map('map', {
|
||||||
layers: [cloudmade],
|
layers: [osm],
|
||||||
center: bounds1.getCenter(),
|
center: bounds1.getCenter(),
|
||||||
zoom: 7
|
zoom: 7
|
||||||
});
|
});
|
||||||
|
@ -19,16 +19,16 @@
|
|||||||
<script type="text/javascript" src="geojson-sample.js"></script>
|
<script type="text/javascript" src="geojson-sample.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/d4fc77ea4a63471cab2423e66626cbb6/997/256/{z}/{x}/{y}.png',
|
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
||||||
cloudmadeAttribution = 'Map data © 2011 OpenStreetMap contributors, Imagery © 2011 CloudMade',
|
osmAttrib = '© <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
|
||||||
cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 18, attribution: cloudmadeAttribution}),
|
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib}),
|
||||||
rectangle,
|
rectangle,
|
||||||
featureGroup;
|
featureGroup;
|
||||||
|
|
||||||
var map = new L.Map('map', {
|
var map = new L.Map('map', {
|
||||||
center: new L.LatLng(0.78, 102.37),
|
center: new L.LatLng(0.78, 102.37),
|
||||||
zoom: 7,
|
zoom: 7,
|
||||||
layers: [cloudmade]
|
layers: [osm]
|
||||||
});
|
});
|
||||||
|
|
||||||
var geojson = L.geoJson(geojsonSample, {
|
var geojson = L.geoJson(geojsonSample, {
|
||||||
|
@ -52,10 +52,8 @@
|
|||||||
|
|
||||||
var map = L.map('map').setView([37.8, -96], 4);
|
var map = L.map('map').setView([37.8, -96], 4);
|
||||||
|
|
||||||
var cloudmade = L.tileLayer('http://{s}.tile.cloudmade.com/{key}/{styleId}/256/{z}/{x}/{y}.png', {
|
var osm = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
|
||||||
attribution: 'Map data © 2011 OpenStreetMap contributors, Imagery © 2011 CloudMade',
|
attribution: '© <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
|
||||||
key: 'd4fc77ea4a63471cab2423e66626cbb6',
|
|
||||||
styleId: 998
|
|
||||||
}).addTo(map);
|
}).addTo(map);
|
||||||
|
|
||||||
|
|
||||||
|
@ -17,9 +17,9 @@
|
|||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/d4fc77ea4a63471cab2423e66626cbb6/997/256/{z}/{x}/{y}.png',
|
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
||||||
cloudmadeAttribution = 'Map data © 2011 OpenStreetMap contributors, Imagery © 2011 CloudMade',
|
osmAttrib = '© <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
|
||||||
cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 18, attribution: cloudmadeAttribution});;
|
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib});
|
||||||
|
|
||||||
var bounds = new L.LatLngBounds(new L.LatLng(54.559322, -5.767822), new L.LatLng(56.1210604, -3.021240));
|
var bounds = new L.LatLngBounds(new L.LatLng(54.559322, -5.767822), new L.LatLng(56.1210604, -3.021240));
|
||||||
var bounds2 = new L.LatLngBounds(new L.LatLng(56.2124322195806, -3.427734375), new L.LatLng(56.307776937156945, -3.2560729980468746));
|
var bounds2 = new L.LatLngBounds(new L.LatLng(56.2124322195806, -3.427734375), new L.LatLng(56.307776937156945, -3.2560729980468746));
|
||||||
@ -39,7 +39,7 @@
|
|||||||
var map = new L.Map('map', {
|
var map = new L.Map('map', {
|
||||||
center: bounds.getCenter(),
|
center: bounds.getCenter(),
|
||||||
zoom: 7,
|
zoom: 7,
|
||||||
layers: [cloudmade]
|
layers: [osm]
|
||||||
});
|
});
|
||||||
|
|
||||||
map.addLayer(rectangle).addLayer(styledRectangle);
|
map.addLayer(rectangle).addLayer(styledRectangle);
|
||||||
|
@ -24,9 +24,9 @@
|
|||||||
// buffer += text + "\r\n";
|
// buffer += text + "\r\n";
|
||||||
//}
|
//}
|
||||||
|
|
||||||
var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/d4fc77ea4a63471cab2423e66626cbb6/997/256/{z}/{x}/{y}.png',
|
var osmUrl = 'http://{s}.tile.osm.org/{z}/{x}/{y}.png',
|
||||||
cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 18}),
|
osm = new L.TileLayer(osmUrl, {maxZoom: 18}),
|
||||||
map = new L.Map('map', {layers: [cloudmade], center: new L.LatLng(51.505, -0.04), zoom: 13});
|
map = new L.Map('map', {layers: [osm], center: new L.LatLng(51.505, -0.04), zoom: 13});
|
||||||
|
|
||||||
|
|
||||||
var polygon = new L.Polygon([
|
var polygon = new L.Polygon([
|
||||||
|
@ -16,8 +16,9 @@
|
|||||||
<button onclick="map.fitBounds(poly.getBounds())">Zoom to polygon</button>
|
<button onclick="map.fitBounds(poly.getBounds())">Zoom to polygon</button>
|
||||||
<script src="route.js"></script>
|
<script src="route.js"></script>
|
||||||
<script>
|
<script>
|
||||||
var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/d4fc77ea4a63471cab2423e66626cbb6/997/256/{z}/{x}/{y}.png',
|
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
||||||
cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 18});
|
osmAttrib = '© <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
|
||||||
|
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib});
|
||||||
|
|
||||||
var poly_points = [
|
var poly_points = [
|
||||||
[39.70348880963439, -104.98603820800781],
|
[39.70348880963439, -104.98603820800781],
|
||||||
@ -50,7 +51,7 @@
|
|||||||
var poly = new L.Polygon(latlngs2);
|
var poly = new L.Polygon(latlngs2);
|
||||||
|
|
||||||
var map = new L.Map('map', {
|
var map = new L.Map('map', {
|
||||||
layers: [cloudmade],
|
layers: [osm],
|
||||||
center: new L.LatLng(39.69596043694606, -104.95084762573242),
|
center: new L.LatLng(39.69596043694606, -104.95084762573242),
|
||||||
zoom: 12
|
zoom: 12
|
||||||
});
|
});
|
||||||
|
@ -22,15 +22,16 @@
|
|||||||
|
|
||||||
<script src="route.js"></script>
|
<script src="route.js"></script>
|
||||||
<script>
|
<script>
|
||||||
var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/d4fc77ea4a63471cab2423e66626cbb6/997/256/{z}/{x}/{y}.png',
|
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
||||||
cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 18});
|
osmAttrib = '© <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
|
||||||
|
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib});
|
||||||
|
|
||||||
for (var i = 0, latlngs = [], len = route.length; i < len; i++) {
|
for (var i = 0, latlngs = [], len = route.length; i < len; i++) {
|
||||||
latlngs.push(new L.LatLng(route[i][0], route[i][1]));
|
latlngs.push(new L.LatLng(route[i][0], route[i][1]));
|
||||||
}
|
}
|
||||||
var path = new L.Polyline(latlngs);
|
var path = new L.Polyline(latlngs);
|
||||||
|
|
||||||
var map = new L.Map('map', {layers: [cloudmade]});
|
var map = new L.Map('map', {layers: [osm]});
|
||||||
|
|
||||||
var group = new L.LayerGroup();
|
var group = new L.LayerGroup();
|
||||||
|
|
||||||
|
@ -17,15 +17,16 @@
|
|||||||
|
|
||||||
<script src="route.js"></script>
|
<script src="route.js"></script>
|
||||||
<script>
|
<script>
|
||||||
var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/d4fc77ea4a63471cab2423e66626cbb6/997/256/{z}/{x}/{y}.png',
|
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
||||||
cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 18});
|
osmAttrib = '© <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
|
||||||
|
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib});
|
||||||
|
|
||||||
for (var i = 0, latlngs = [], len = route.length; i < len; i++) {
|
for (var i = 0, latlngs = [], len = route.length; i < len; i++) {
|
||||||
latlngs.push(new L.LatLng(route[i][0], route[i][1]));
|
latlngs.push(new L.LatLng(route[i][0], route[i][1]));
|
||||||
}
|
}
|
||||||
var path = new L.Polyline(latlngs, {smoothFactor: 1});
|
var path = new L.Polyline(latlngs, {smoothFactor: 1});
|
||||||
|
|
||||||
var map = new L.Map('map', {layers: [cloudmade]});
|
var map = new L.Map('map', {layers: [osm]});
|
||||||
|
|
||||||
map.fitBounds(new L.LatLngBounds(latlngs));
|
map.fitBounds(new L.LatLngBounds(latlngs));
|
||||||
|
|
||||||
|
@ -35,12 +35,9 @@
|
|||||||
|
|
||||||
map.setView([51.505, -0.09], 13);
|
map.setView([51.505, -0.09], 13);
|
||||||
|
|
||||||
var cloudmade = L.tileLayer('http://{s}.tile.cloudmade.com/{key}/{styleId}/256/{z}/{x}/{y}.png', {
|
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
||||||
attribution: 'Map data © 2011 OpenStreetMap contributors, Imagery © 2011 CloudMade',
|
osmAttrib = '© <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors';
|
||||||
maxZoom: 18,
|
var osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib});.addTo(map);
|
||||||
key: 'd4fc77ea4a63471cab2423e66626cbb6',
|
|
||||||
styleId: 997
|
|
||||||
}).addTo(map);
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
@ -14,15 +14,16 @@
|
|||||||
|
|
||||||
<script src="route.js"></script>
|
<script src="route.js"></script>
|
||||||
<script>
|
<script>
|
||||||
var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/d4fc77ea4a63471cab2423e66626cbb6/997/256/{z}/{x}/{y}.png',
|
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
||||||
cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 18});
|
osmAttrib = '© <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
|
||||||
|
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib});
|
||||||
|
|
||||||
for (var i = 0, latlngs = [], len = route.length; i < len; i++) {
|
for (var i = 0, latlngs = [], len = route.length; i < len; i++) {
|
||||||
latlngs.push(new L.LatLng(route[i][0], route[i][1]));
|
latlngs.push(new L.LatLng(route[i][0], route[i][1]));
|
||||||
}
|
}
|
||||||
var path = new L.Polyline(latlngs);
|
var path = new L.Polyline(latlngs);
|
||||||
|
|
||||||
var map = new L.Map('map', {layers: [cloudmade]});
|
var map = new L.Map('map', {layers: [osm]});
|
||||||
|
|
||||||
map.fitBounds(new L.LatLngBounds(latlngs));
|
map.fitBounds(new L.LatLngBounds(latlngs));
|
||||||
|
|
||||||
|
@ -14,10 +14,11 @@
|
|||||||
|
|
||||||
<script src="route.js"></script>
|
<script src="route.js"></script>
|
||||||
<script>
|
<script>
|
||||||
var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/d4fc77ea4a63471cab2423e66626cbb6/997/256/{z}/{x}/{y}.png',
|
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
||||||
cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 18});
|
osmAttrib = '© <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
|
||||||
|
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib});
|
||||||
|
|
||||||
var map = new L.Map('map', {layers: [cloudmade]});
|
var map = new L.Map('map', {layers: [osm]});
|
||||||
|
|
||||||
map.addLayer(L.marker(route[0]));
|
map.addLayer(L.marker(route[0]));
|
||||||
map.addLayer(L.marker(route[route.length - 1]));
|
map.addLayer(L.marker(route[route.length - 1]));
|
||||||
|
Loading…
Reference in New Issue
Block a user