Skip to content

Commit

Permalink
Upgraded to Leaflet 0.7, use Leaflet from CDN, some cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
perliedman committed Nov 19, 2013
1 parent 7f3bb76 commit a6c3b63
Show file tree
Hide file tree
Showing 14 changed files with 49 additions and 9,592 deletions.
10 changes: 5 additions & 5 deletions examples/geojson-crs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="style.css" />
<link rel="stylesheet" href="../../lib/leaflet.css" />
<!--[if lt IE 9]>
<link rel="stylesheet" href="../../lib/leaflet.ie.css"/>
<![endif]-->
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7/leaflet.css" />
</head>
<body>
<div id="map"></div>
<script src="../../lib/require.js" data-main="script"></script>
<script src="http://cdn.leafletjs.com/leaflet-0.7/leaflet.js"></script>
<script src="../../lib/proj4-compressed.js"></script>
<script src="../../src/proj4leaflet.js"></script>
<script src="script.js"></script>
</body>
</html>
15 changes: 0 additions & 15 deletions examples/geojson-crs/script.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
requirejs.config({
'baseUrl': '../../lib',

/* Note: would normally put proj4leaflet in lib/ to avoid paths config */
'paths': {
/* path is relative to baseUrl */
'proj4leaflet': '../src/proj4leaflet'
}
});

require(['leaflet', 'proj4', 'proj4leaflet'],
function(L, proj4) {

var map = L.map('map').setView([44.97,-93.24], 11);

// MapQuest OSM Tiles
Expand Down Expand Up @@ -52,5 +39,3 @@ L.Proj.geoJson(geojson, {
return L.marker(latlng).bindPopup(feature.properties.name);
}
}).addTo(map);

});
9 changes: 2 additions & 7 deletions examples/local-projections/nz/index_auckland.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,13 @@
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="style.css" />
<link rel="stylesheet" href="../../../lib/leaflet.css" />
<!--[if lt IE 9]>
<link rel="stylesheet" href="../../../lib/leaflet.ie.css"/>
<![endif]-->
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7/leaflet.css" />
</head>
<body>
<div id="map"></div>
<script src="../../../lib/leaflet-src.js"></script>
<script src="http://cdn.leafletjs.com/leaflet-0.7/leaflet.js"></script>
<script src="../../../lib/proj4-compressed.js"></script>
<script src="../../../src/proj4leaflet.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="http://www.mapuse.com/billing/Client/v1/Leaflet.js"></script>
<script src="script_auckland.js"></script>
</body>
</html>
9 changes: 2 additions & 7 deletions examples/local-projections/nz/index_wellington.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,13 @@
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="style.css" />
<link rel="stylesheet" href="../../../lib/leaflet.css" />
<!--[if lt IE 9]>
<link rel="stylesheet" href="../../../lib/leaflet.ie.css"/>
<![endif]-->
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7/leaflet.css" />
</head>
<body>
<div id="map"></div>
<script src="../../../lib/leaflet-src.js"></script>
<script src="http://cdn.leafletjs.com/leaflet-0.7/leaflet.js"></script>
<script src="../../../lib/proj4-compressed.js"></script>
<script src="../../../src/proj4leaflet.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="http://www.mapuse.com/billing/Client/v1/Leaflet.js"></script>
<script src="script_wellington.js"></script>
</body>
</html>
9 changes: 2 additions & 7 deletions examples/osm-tiled/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,13 @@
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="style.css" />
<link rel="stylesheet" href="../../lib/leaflet.css" />
<!--[if lt IE 9]>
<link rel="stylesheet" href="../../lib/leaflet.ie.css"/>
<![endif]-->
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7/leaflet.css" />
</head>
<body>
<div id="map"></div>
<script src="../../lib/leaflet-src.js"></script>
<script src="http://cdn.leafletjs.com/leaflet-0.7/leaflet.js"></script>
<script src="../../lib/proj4-compressed.js"></script>
<script src="../../src/proj4leaflet.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="http://www.mapuse.com/billing/Client/v1/Leaflet.js"></script>
<script src="script.js"></script>
</body>
</html>
39 changes: 13 additions & 26 deletions examples/osm-tiled/script.js
Original file line number Diff line number Diff line change
@@ -1,36 +1,23 @@
var crs = new L.Proj.CRS('EPSG:2400',
'+lon_0=15.808277777799999 +lat_0=0.0 +k=1.0 '
+ '+x_0=1500000.0 +y_0=0.0 +proj=tmerc +ellps=bessel '
+ '+units=m '
+ '+towgs84=414.1,41.3,603.1,-0.855,2.141,-7.023,0 +no_defs',
var crs = new L.Proj.CRS('EPSG:3006',
'+proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs',
{
resolutions: [
8192, 4096, 2048, 1024, 512, 256, 128,
64, 32, 16, 8, 4, 2, 1, 0.5
],
origin: [0, 0]
}),
map = new L.Map('map', {
crs: crs,
continuousWorld: true,
worldCopyJump: false
});

var map = new L.Map('map', {
crs: crs,
continuousWorld: true,
worldCopyJump: false
});
L.tileLayer('http://api.geosition.com/tile/osm-bright-3006/{z}/{x}/{y}.png', {
maxZoom: 14
,minZoom: 0
,continuousWorld: true
,attribution: 'Map data &copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap contributors</a>, Imagery &copy; 2013 <a href="http://www.kartena.se/">Kartena</a>'
}).addTo(map);

var mapUrl = 'http://api.geosition.com/tile/lmv/{z}/{x}/{y}.png',
attrib = 'Map data &copy; 2011 Lantmäteriet, Imagery &copy; 2011 Kartena',
tilelayer = new L.TileLayer(mapUrl, {
maxZoom: 14
,minZoom: 0
,continuousWorld: true
,attribution: attrib
});

var b = new Billing.Leaflet(map,
"github-demo",
"lmv",
parseInt(Math.random() * 10000000),
window.location.hostname,
window.location.href);
map.addLayer(tilelayer);
map.setView([57.704, 11.965], 13);
9 changes: 2 additions & 7 deletions examples/tms-tiled/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,13 @@
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="style.css" />
<link rel="stylesheet" href="../../lib/leaflet.css" />
<!--[if lt IE 9]>
<link rel="stylesheet" href="../../lib/leaflet.ie.css"/>
<![endif]-->
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7/leaflet.css" />
</head>
<body>
<div id="map"></div>
<script src="../../lib/leaflet-src.js"></script>
<script src="http://cdn.leafletjs.com/leaflet-0.7/leaflet.js"></script>
<script src="../../lib/proj4-compressed.js"></script>
<script src="../../src/proj4leaflet.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="http://www.mapuse.com/billing/Client/v1/Leaflet.js"></script>
<script src="script.js"></script>
</body>
</html>
67 changes: 22 additions & 45 deletions examples/tms-tiled/script.js
Original file line number Diff line number Diff line change
@@ -1,48 +1,25 @@
var crs = new L.Proj.CRS.TMS('EPSG:102012',
'+proj=lcc +lat_1=30 +lat_2=62 +lat_0=0 +lon_0=105 +x_0=0 +y_0=0 '
+ '+ellps=WGS84 +datum=WGS84 +units=m +no_defs',
[-5401501.0, 4065283.0, 4402101.0, 39905283.0],
{
resolutions: [
140000.0000000000,
70000.0000000000,
35000.0000000000,
17500.0000000000,
8750.0000000000,
4375.0000000000,
2187.5000000000,
1093.7500000000,
546.8750000000,
273.4375000000,
136.7187500000,
68.3593750000,
34.1796875000,
17.0898437500,
8.5449218750,
4.2724609375,
2.1362304688,
1.0681152344
]
var crs = new L.Proj.CRS.TMS(
'EPSG:5181',
'+proj=tmerc +lat_0=38 +lon_0=127 +k=1 +x_0=200000 +y_0=500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs',
[-30000, -60000, 494288, 464288],
{
resolutions: [2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, 0.5, 0.25]
}
),
map = L.map('map', {
crs: crs,
continuousWorld: true,
worldCopyJump: false,
zoomControl: true
});

var map = new L.Map('map', {
crs: crs,
continuousWorld: true,
worldCopyJump: false
});
new L.Proj.TileLayer.TMS("http://i{s}.maps.daum-img.net/map/image/G03/i/1.20/L{z}/{y}/{x}.png", crs, {
maxZoom: 14,
minZoom: 0,
zoomReverse: true,
subdomains: '0123',
continuousWorld: true,
attribution: 'ⓒ 2012 Daum'
}).addTo(map);

/*
This tile layer is provided by basemap.ru /
Nikolai Lebedev (https://github.com/nlebedev)
*/
var tileUrl = 'http://basemap.ru/service/tms/1.0.0/ooptrf_EPSG102012/{z}/{x}/{y}.png',
attrib = '&copy; 2012 OpenStreetMap contributors, USGS',
tilelayer = new L.Proj.TileLayer.TMS(tileUrl, crs, {
maxZoom: 17
,minZoom: 0
,continuousWorld: true
,attribution: attrib
});

map.addLayer(tilelayer);
map.setView([70.568, 122.871], 4);
map.setView([40.0, 127.0], 0);
Loading

0 comments on commit a6c3b63

Please sign in to comment.