Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@ example/gdal2tiles.py
tmp/
*.log
*.tgz
.DS_Store
package-lock.json
pnpm-lock.yaml
yarn.lock

2 changes: 1 addition & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
package-lock=false
ignore-scripts=true
64 changes: 30 additions & 34 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,52 +1,48 @@
## <small>1.0.6 (2023-09-25)</small>
# 2.0.0-1 (2025-09-29)

* chore: bump dependencies ([1fff169](https://github.com/commenthol/leaflet-rastercoords/commit/1fff169))
- feat!: upgrade to leaflet@2 (#db9e5b2)
- chore: deprecate bower and component.json (#c165c04)
- chore: npm lock (#04a807f)

## <small>1.0.5 (2022-11-02)</small>
# 1.0.6 (2023-09-25)

* FIX: setting the max boundaries of map is optional now ([fd57cb6](https://github.com/commenthol/leaflet-rastercoords/commit/fd57cb6))
- chore: bump dependencies (#1fff169)

# 1.0.5 (2022-11-02)

## <small>1.0.4 (2021-11-03)</small>
- FIX: setting the max boundaries of map is optional now (#fd57cb6)

* add bounds to docs ([ed0a051](https://github.com/commenthol/leaflet-rastercoords/commit/ed0a051))
* add method to get bounds ([6543678](https://github.com/commenthol/leaflet-rastercoords/commit/6543678))
* remove trailing comma ([1f4ac11](https://github.com/commenthol/leaflet-rastercoords/commit/1f4ac11))
* fix: linter ([bdee88f](https://github.com/commenthol/leaflet-rastercoords/commit/bdee88f))
* chore: bump dependencies ([18f26ff](https://github.com/commenthol/leaflet-rastercoords/commit/18f26ff))
* chore: update example with circles ([618cae4](https://github.com/commenthol/leaflet-rastercoords/commit/618cae4))
* chore: update gh-pages ([1bd7b1c](https://github.com/commenthol/leaflet-rastercoords/commit/1bd7b1c))
* chore(example): fix unpkg version and featureGroup ([adcc57f](https://github.com/commenthol/leaflet-rastercoords/commit/adcc57f))
# 1.0.4 (2021-11-03)

- fix: linter (#bdee88f)
- chore: bump dependencies (#18f26ff)
- remove trailing comma (#1f4ac11)
- add bounds to docs (#ed0a051)
- add method to get bounds (#6543678)
- chore(example): fix unpkg version and featureGroup (#adcc57f)
- chore: update gh-pages (#1bd7b1c)
- chore: update example with circles (#618cae4)

# 1.0.3 (2018-08-14)

## <small>1.0.3 (2018-08-14)</small>

* add semicolon at end for bower ([cbb8bd9](https://github.com/commenthol/leaflet-rastercoords/commit/cbb8bd9))
* version ([fb9295e](https://github.com/commenthol/leaflet-rastercoords/commit/fb9295e))
# 1.0.3 (2018-08-14)

- add semicolon at end for bower (#cbb8bd9)

# 1.0.2 (2017-02-07)

## <small>1.0.2 (2017-02-07)</small>
- fix documentation (#7d16aaa)

* fix documentation ([7d16aaa](https://github.com/commenthol/leaflet-rastercoords/commit/7d16aaa))
# 1.0.1 (2016-10-26)

- update .json files (#57d22b1)
- using cdn (#3eb73fc)
- fix usage with browserify/webpack (#412a767)
- update link (#01a4a4c)
- fix badge (#7cd1d4a)

# 1.0.0 (2016-10-22)

## <small>1.0.1 (2016-10-26)</small>

* fix badge ([7cd1d4a](https://github.com/commenthol/leaflet-rastercoords/commit/7cd1d4a))
* fix usage with browserify/webpack ([412a767](https://github.com/commenthol/leaflet-rastercoords/commit/412a767))
* update .json files ([57d22b1](https://github.com/commenthol/leaflet-rastercoords/commit/57d22b1))
* update link ([01a4a4c](https://github.com/commenthol/leaflet-rastercoords/commit/01a4a4c))
* using cdn ([3eb73fc](https://github.com/commenthol/leaflet-rastercoords/commit/3eb73fc))



## 1.0.0 (2016-10-22)

* Initial commit ([f8d05db](https://github.com/commenthol/leaflet-rastercoords/commit/f8d05db))
* packaged ([d9f2ddf](https://github.com/commenthol/leaflet-rastercoords/commit/d9f2ddf))


- Initial commit (#f8d05db)

39 changes: 0 additions & 39 deletions bower.json

This file was deleted.

19 changes: 0 additions & 19 deletions component.json

This file was deleted.

6 changes: 3 additions & 3 deletions example/index.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<title>example for leaflet-rastercoords</title>
<title>Example for leaflet-rastercoords (leaflet@2)</title>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"/>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1/dist/leaflet.css" />
<link rel="stylesheet" href="https://unpkg.com/leaflet@2.0.0-alpha.1/dist/leaflet.css" />
<style>
html, body, #map {
width:100%;
Expand All @@ -17,7 +17,7 @@
</head>
<body>
<div id="map"></div>
<script src="https://unpkg.com/leaflet@1/dist/leaflet.js"></script>
<script src="https://unpkg.com/leaflet@2.0.0-alpha.1/dist/leaflet-global.js"></script>
<script src="../rastercoords.js"></script>
<script src="geojson.js"></script>
<script src="index.js"></script>
Expand Down
30 changes: 16 additions & 14 deletions example/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/*
* @copyright 2015 commenthol
* @copyright 2015-present commenthol
* @license MIT
*
* uses leaflet@2
*/

/* global L */
Expand All @@ -15,7 +17,7 @@
]

// create the map
const map = L.map(mapid, {
const map = new L.Map(mapid, {
crs: L.CRS.Simple,
minZoom,
maxZoom
Expand All @@ -28,7 +30,7 @@
map.setView(rc.unproject([1589, 1447]), 4)

// add layer control object
L.control.layers({}, {
new L.Control.Layers({}, {
Polygon: layerPolygon(map, rc),
Countries: layerCountries(map, rc),
Bounds: layerBounds(map, rc, img),
Expand All @@ -37,7 +39,7 @@
}).addTo(map)

// the tile layer containing the image generated with gdal2tiles --leaflet ...
L.tileLayer('./tiles/{z}/{x}/{y}.png', {
new L.TileLayer('./tiles/{z}/{x}/{y}.png', {
noWrap: true,
bounds: rc.getMaxBounds(),
maxNativeZoom: rc.zoomLevel(),
Expand All @@ -53,9 +55,9 @@
*/
function layerBounds (map, rc, img) {
// set marker at the image bound edges
const layerBounds = L.layerGroup([
L.marker(rc.unproject([0, 0])).bindPopup('[0,0]'),
L.marker(rc.unproject(img)).bindPopup(JSON.stringify(img))
const layerBounds = new L.LayerGroup([
new L.Marker(rc.unproject([0, 0])).bindPopup('[0,0]'),
new L.Marker(rc.unproject(img)).bindPopup(JSON.stringify(img))
])
map.addLayer(layerBounds)

Expand All @@ -77,7 +79,7 @@
* layer using geoJson data for countries adding a circle marker
*/
function layerCountries (map, rc) {
const layerCountries = L.geoJson(window.countries, {
const layerCountries = new L.GeoJSON(window.countries, {
// correctly map the geojson coordinates on the image
coordsToLatLng: function (coords) {
return rc.unproject(coords)
Expand All @@ -89,7 +91,7 @@
}
},
pointToLayer: function (feature, latlng) {
return L.circleMarker(latlng, {
return new L.CircleMarker(latlng, {
radius: 8,
fillColor: '#800080',
color: '#D107D1',
Expand All @@ -108,7 +110,7 @@
*/
function layerGeo (map, rc) {
const imgDir = 'images/'
const redMarker = L.icon({
const redMarker = new L.Icon({
iconUrl: imgDir + 'marker-icon-red.png',
iconRetinaUrl: imgDir + 'marker-icon-red-2x.png',
iconSize: [25, 41],
Expand All @@ -118,7 +120,7 @@
shadowSize: [41, 41],
shadowAnchor: [14, 41]
})
const layerGeo = L.geoJson(window.geoInfo, {
const layerGeo = new L.GeoJSON(window.geoInfo, {
// correctly map the geojson coordinates on the image
coordsToLatLng: function (coords) {
return rc.unproject(coords)
Expand All @@ -130,7 +132,7 @@
}
},
pointToLayer: function (feature, latlng) {
return L.marker(latlng, {
return new L.Marker(latlng, {
icon: redMarker
})
}
Expand All @@ -146,7 +148,7 @@
const points = window.polygon.map(function (point) {
return rc.unproject([point.x, point.y])
})
const layerPolygon = L.polygon([points])
const layerPolygon = new L.Polygon([points])
map.addLayer(layerPolygon)
return layerPolygon
}
Expand Down Expand Up @@ -198,7 +200,7 @@
color: '#fbff2c'
})

const layer = L.featureGroup([custom])
const layer = new L.FeatureGroup([custom])
map.addLayer(layer)
return layer
}
Expand Down
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "leaflet-rastercoords",
"version": "1.0.6",
"version": "2.0.0-1",
"description": "Leaflet plugin for plain image map projection to display large images using tiles generated with gdal2tiles-leaflet",
"keywords": [
"Leaflet",
Expand All @@ -21,16 +21,20 @@
"directories": {
"example": "example"
},
"files": [
"rastercoords.js"
],
"scripts": {
"changelog": "conv-changelog -o",
"example": "http-server . -a localhost -c-1 -o",
"lint": "standard -v ./*.js",
"test": "echo \"Error: no test specified - run example/index.html instead\" && exit 1"
},
"dependencies": {
"leaflet": "^1.9.4"
"leaflet": "^2.0.0-alpha.1"
},
"devDependencies": {
"http-server": "^14.1.1",
"standard": "^17.1.0"
"standard": "^17.1.2"
}
}