Skip to content

Commit

Permalink
Merge pull request #4 from jjimenezshaw/leaflet-1.6.0
Browse files Browse the repository at this point in the history
Leaflet 1.6.0
  • Loading branch information
jjimenezshaw authored Feb 9, 2020
2 parents 1801347 + db79726 commit 528933e
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 11 deletions.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![Leaflet 0.7 compatible!](https://img.shields.io/badge/Leaflet%200.7-%E2%9C%93-1EB300.svg?style=flat)](http://leafletjs.com/reference-0.7.7.html)
[![Leaflet 1.x compatible!](https://img.shields.io/badge/Leaflet%201.x-%E2%9C%93-1EB300.svg?style=flat)](http://leafletjs.com/reference.html)

Simple [UTM](https://en.wikipedia.org/wiki/Universal_Transverse_Mercator_coordinate_system) (WGS84) methods for L.LatLng. Tested with Leaflet 0.7, 1.0.3, 1.1.0, 1.2.0 and 1.3.1.
Simple [UTM](https://en.wikipedia.org/wiki/Universal_Transverse_Mercator_coordinate_system) (WGS84) methods for L.LatLng. Tested with Leaflet 0.7, 1.0.3, 1.1.0, 1.2.0, 1.3.1 and 1.6.0.

Based on javascript code from Chuck Taylor's [Toolbox](http://home.hiwaay.net/~taylorc/toolbox/geography/geoutm.html).

Expand All @@ -28,6 +28,15 @@ var txt = map.getCenter().utm().toString({decimals: 0, format: '{x} {y} {zone} {
```
that produces `467486 4101149 30 North`

You can also use the values of that `object` directly (like `c.utm().x`). Here is a dump in the Console:
```JavaScript
L.Utm {x: 467486.3402722592,
y: 4101149.337496558,
zone: 30,
band: "S",
southHemi: false}
```

### UTM -> LatLng
Just create an object with `L.utm(options)`, and call the method `latLng` like here:
```JavaScript
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "leaflet.utm",
"version": "0.0.5",
"version": "1.0.0",
"homepage": "https://github.com/jjimenezshaw/Leaflet.UTM",
"authors": [
"Javier Jimenez Shaw"
Expand Down
8 changes: 4 additions & 4 deletions examples/input.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Leaflet UTM Demo</title>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css"
crossorigin=""/>
<script src="https://unpkg.com/[email protected]/dist/leaflet-src.js"
crossorigin=""></script>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" />
<script src="https://unpkg.com/[email protected]/dist/leaflet-src.js"></script>

<style type="text/css">
html { font-family: Helvetica, Verdana, Arial, sans-serif; }
Expand Down
8 changes: 4 additions & 4 deletions examples/markers.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Leaflet UTM Demo</title>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css"
crossorigin=""/>
<script src="https://unpkg.com/[email protected]/dist/leaflet-src.js"
crossorigin=""></script>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" />
<script src="https://unpkg.com/[email protected]/dist/leaflet-src.js"></script>

<script src="https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.4.3/proj4.js"></script>

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "leaflet.utm",
"version": "0.0.5",
"version": "1.0.0",
"description": "Converts LatLng to UTM WGS84 in Leaflet",
"main": "L.LatLng.UTM.js",
"directories": {
Expand Down

0 comments on commit 528933e

Please sign in to comment.