Skip to content

Commit

Permalink
Merge pull request #91 from semone/leaflet-proj-refactor
Browse files Browse the repository at this point in the history
Leaflet proj refactor (Leaflet beta 1.0.0)
  • Loading branch information
semone committed Sep 2, 2015
2 parents e086dde + 7cb6e72 commit a12660e
Show file tree
Hide file tree
Showing 14 changed files with 5,151 additions and 5,348 deletions.
4 changes: 2 additions & 2 deletions examples/geojson-crs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="style.css" />
<link rel="stylesheet" href="../../lib/leaflet/leaflet.css" />
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-1.0.0-b1/leaflet.css" />
</head>
<body>
<div id="map"></div>
<script src="../../lib/leaflet/leaflet-src.js"></script>
<script src="http://cdn.leafletjs.com/leaflet-1.0.0-b1/leaflet.js"></script>
<script src="../../lib/proj4-compressed.js"></script>
<script src="../../src/proj4leaflet.js"></script>
<script src="script.js"></script>
Expand Down
15 changes: 15 additions & 0 deletions examples/local-projections/europe/index_austria.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="../style.css" />
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-1.0.0-b1/leaflet.css" />
</head>
<body>
<div id="map"></div>
<script src="http://cdn.leafletjs.com/leaflet-1.0.0-b1/leaflet.js"></script>
<script src="../../../lib/proj4-compressed.js"></script>
<script src="../../../src/proj4leaflet.js"></script>
<script src="script_austria.js"></script>
</body>
</html>
36 changes: 36 additions & 0 deletions examples/local-projections/europe/script_austria.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
var crs31258 = new L.Proj.CRS('EPSG::31258',
"+proj=tmerc +lat_0=0 +lon_0=13.33333333333333 +k=1 +x_0=450000 +y_0=-5000000 +ellps=bessel +towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232 +units=m +no_defs",
{
origin: [-5172500.0, 5001000.0],
resolutions: [
400.00079375158754,
200.000529167725,
100.0002645838625,
50,
25,
15.000052916772502,
9.9999470832275,
5.000105833545001,
3.0001164168995005,
2.5000529167725003,
1.9999894166455001,
1.4999259165184997,
1.0001270002540006,
0.5000635001270003,
0.25003175006350015],
});

var map = L.map('map', {
crs: crs31258,
});
var attrib = "&copy KAGIS http://www.kagis.ktn.gv.at";
var basemap = new L.TileLayer("http://gis.ktn.gv.at/arcgis/rest/services/tilecache/Ortho_2010_2012/MapServer/tile/{z}/{y}/{x}", {
tileSize: 512,
maxZoom: 14,
minZoom: 0,
attribution: attrib
});

map.addLayer(basemap);
map.setView([46.66411, 14.63602], 12);

6 changes: 3 additions & 3 deletions examples/local-projections/nz/index_auckland.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<html>
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="style.css" />
<link rel="stylesheet" href="../../../lib/leaflet/leaflet.css" />
<link rel="stylesheet" href="../style.css" />
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-1.0.0-b1/leaflet.css" />
</head>
<body>
<div id="map"></div>
<script src="../../../lib/leaflet/leaflet-src.js"></script>
<script src="http://cdn.leafletjs.com/leaflet-1.0.0-b1/leaflet.js"></script>
<script src="../../../lib/proj4-compressed.js"></script>
<script src="../../../src/proj4leaflet.js"></script>
<script src="script_auckland.js"></script>
Expand Down
15 changes: 0 additions & 15 deletions examples/local-projections/nz/index_wellington.html

This file was deleted.

42 changes: 0 additions & 42 deletions examples/local-projections/nz/script_wellington.js

This file was deleted.

File renamed without changes.
4 changes: 2 additions & 2 deletions examples/osm-tiled/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="style.css" />
<link rel="stylesheet" href="../../lib/leaflet/leaflet.css" />
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-1.0.0-b1/leaflet.css" />
</head>
<body>
<div id="map"></div>
<script src="../../lib/leaflet/leaflet-src.js"></script>
<script src="http://cdn.leafletjs.com/leaflet-1.0.0-b1/leaflet.js"></script>
<script src="../../lib/proj4-compressed.js"></script>
<script src="../../src/proj4leaflet.js"></script>
<script src="script.js"></script>
Expand Down
4 changes: 2 additions & 2 deletions examples/tms-tiled/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="style.css" />
<link rel="stylesheet" href="../../lib/leaflet/leaflet.css" />
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-1.0.0-b1/leaflet.css" />
</head>
<body>
<div id="map"></div>
<script src="../../lib/leaflet/leaflet-src.js"></script>
<script src="http://cdn.leafletjs.com/leaflet-1.0.0-b1/leaflet.js"></script>
<script src="../../lib/proj4-compressed.js"></script>
<script src="../../src/proj4leaflet.js"></script>
<script src="script.js"></script>
Expand Down
30 changes: 14 additions & 16 deletions examples/tms-tiled/script.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,27 @@
var crs = new L.Proj.CRS(
'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',
{
resolutions: [2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, 0.5, 0.25],
origin: [-30000, -60000],
bounds: L.bounds([-30000, -60000], [494288, 464288])
}
),
var crs = new L.Proj.CRS('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',
{
resolutions: [2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, 0.5, 0.25],
origin: [-30000, -60000],
bounds: L.bounds([-30000, -60000], [494288, 464288])
}),
map = L.map('map', {
crs: crs
crs: crs,
continuousWorld: true,
worldCopyJump: false,
});

// This tileset uses negative tiles, i.e. some tiles are south
// of the bounds.
crs.infinite = true;

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

new L.marker([38.0, 127.0]).addTo(map);
//Gunsan Airport
new L.marker([35.925937, 126.615810]).addTo(map);

map.setView([38.0, 127.0], 0);
map.setView([36.0, 127.0], 0);
2 changes: 1 addition & 1 deletion examples/wms/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var crs = new L.Proj.CRS('EPSG:3006',
});

L.tileLayer.wms('http://geodatatest.havochvatten.se/geoservices/ows', {
layers: 'hav-fisketsgeografier:havet-ostersjons-delomraden',
layers: 'hav-bakgrundskartor:hav-grundkarta',
format: 'image/png',
maxZoom: 14,
minZoom: 0,
Expand Down
6 changes: 3 additions & 3 deletions lib/proj4-compressed.js
100644 → 100755

Large diffs are not rendered by default.

Loading

0 comments on commit a12660e

Please sign in to comment.