Commit 6d8f59b5 authored by JOE XMG's avatar JOE XMG
Browse files

update

parent 22fcb4d1
Pipeline #6293 passed with stage
in 6 seconds
......@@ -45,7 +45,8 @@
<script src="./src/edit/EditToolbar.js"></script>
<script src="./src/edit/handler/EditToolbar.Edit.js"></script>
<script src="./src/edit/handler/EditToolbar.Delete.js"></script>
<link rel="stylesheet" href="libs/leaflet-control-geocoder-2.4.0/dist/Control.Geocoder.css" />
<script src="libs/leaflet-control-geocoder-2.4.0/dist/Control.Geocoder.js"></script>
<link rel="shortcut icon" href="joeicon.png" />
</head>
......@@ -108,6 +109,7 @@
zoom: 15
});
L.Control.geocoder().addTo(map);
var drawnItems = new L.FeatureGroup();
map.addLayer(drawnItems);
......@@ -183,7 +185,9 @@
<span id="conversion_result"></span>
`;
console.log(`WFS Request (31463): http://193.196.137.147:8080/wfs?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&typeNames=bldg:Building&bbox=${p_dest_min.x.toFixed(4)},${p_dest_min.y.toFixed(4)},${p_dest_max.x.toFixed(4)},${p_dest_max.y.toFixed(4)}&srsName=EPSG:31463`)
console.log(
`WFS Request (31463): http://193.196.137.147:8080/wfs?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&typeNames=bldg:Building&bbox=${p_dest_min.x.toFixed(4)},${p_dest_min.y.toFixed(4)},${p_dest_max.x.toFixed(4)},${p_dest_max.y.toFixed(4)}&srsName=EPSG:31463`
)
});
map.on(L.Draw.Event.EDITED, function (e) {
......@@ -228,7 +232,9 @@
<button class="badge bg-secondary" onclick="clickToCopy('31463')">click to copy</button>
`
$("#conversion_result").html(result)
console.log(`WFS Request (${input_epsg}): http://193.196.137.147:8080/wfs?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&typeNames=bldg:Building&bbox=${parseFloat(data[0]["x"]).toFixed(4)},${parseFloat(data[0]["y"]).toFixed(4)},${parseFloat(data[1]["x"]).toFixed(4)},${parseFloat(data[1]["y"]).toFixed(4)}&srsName=EPSG:${input_epsg}`)
console.log(
`WFS Request (${input_epsg}): http://193.196.137.147:8080/wfs?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&typeNames=bldg:Building&bbox=${parseFloat(data[0]["x"]).toFixed(4)},${parseFloat(data[0]["y"]).toFixed(4)},${parseFloat(data[1]["x"]).toFixed(4)},${parseFloat(data[1]["y"]).toFixed(4)}&srsName=EPSG:${input_epsg}`
)
}
});
}
......
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
bundle.js
dist/
node_modules/
spec/vendor/openlocationcode.js
{
"root": true,
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"plugins": ["@typescript-eslint", "prettier"],
"parser": "@typescript-eslint/parser",
"env": { "browser": true },
"rules": {
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-explicit-any": "off",
"prefer-arrow-callback": "warn",
"prettier/prettier": "warn"
}
}
name: Compressed Size
on: [pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: preactjs/compressed-size-action@v2
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
pattern: 'dist/*.{css,js}'
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Node.js CI
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x
- run: npm ci
- run: npm run build
- run: npm test
- run: npm run doc
- name: Deploy TypeDoc
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
destination_dir: docs
keep_files: true
enable_jekyll: true
bundle.js
demo-*/package-lock.json
demo-*/dist/
dist/*
!dist/Control.Geocoder.css
docs/
node_modules/
This diff is collapsed.
Copyright (c) 2012 sa3m (https://github.com/sa3m)
Copyright (c) 2013 Per Liedman
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are
permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of
conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list
of conditions and the following disclaimer in the documentation and/or other materials
provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
## A few words on diversity in tech
I need to take some of your time. I can't believe we let shit like [the Kathy Sierra incident](http://www.wired.com/2014/10/trolls-will-always-win/) or [what happened to Brianna Wu](https://twitter.com/Spacekatgal/status/520739878993420290) happen over and over again. I can't believe we, the open source community, let [sexist, misogynous shit happen over and over again](http://geekfeminism.wikia.com/wiki/Timeline_of_incidents).
I strongly believe that it is my &mdash; and your &mdash; duty to make the open source community, as well as the tech community at large, a community where everyone feel welcome and is accepted. At the very minimum, that means making sure the community and its forums both _are_ safe, and are perceived as safe. It means being friendly and inclusive, even when you disagree with people. It means not shrugging off discussions about sexism and inclusiveness with [handwaving about censorship and free speech](https://josm.openstreetmap.de/ticket/10568). For a more elaborate document on what that means, [the NPM Code of Conduct](http://www.npmjs.com/policies/conduct) is a good start, [Geek Feminism's resources for allies](http://geekfeminism.wikia.com/wiki/Resources_for_allies) contains much more.
While I can't force anyone to do anything, if you happen to disagree with this, I ask of you not to use any of the open source I have published. Nor am I interested in contributions from people who can't accept or act respectfully towards other humans regardless of gender identity, sexual orientation, disability, ethnicity, religion, age, physical appearance, body size, race, or similar personal characteristics. If you think feminism, anti-racism or the LGBT movement is somehow wrong, disturbing or irrelevant, I ask you to go elsewhere to find software.
# Leaflet Control Geocoder [![NPM version](https://img.shields.io/npm/v/leaflet-control-geocoder.svg)](https://www.npmjs.com/package/leaflet-control-geocoder) ![Leaflet 1.0.0 compatible!](https://img.shields.io/badge/Leaflet%201.0.0-%E2%9C%93-1EB300.svg?style=flat)
A simple geocoder for [Leaflet](https://leafletjs.com/) that by default uses [OSM](https://www.openstreetmap.org/)/[Nominatim](https://wiki.openstreetmap.org/wiki/Nominatim).
The plugin supports many different data providers:
- LatLng to parse basic latitude/longitude strings
- [OSM](https://www.openstreetmap.org/)/[Nominatim](https://wiki.openstreetmap.org/wiki/Nominatim)
- [Bing Locations API](http://msdn.microsoft.com/en-us/library/ff701715.aspx)
- [Google Geocoding API](https://developers.google.com/maps/documentation/geocoding/)
- [Mapbox Geocoding](https://www.mapbox.com/api-documentation/#geocoding)
- [MapQuest Geocoding API](http://developer.mapquest.com/web/products/dev-services/geocoding-ws)
- [What3Words](http://what3words.com/)
- [Photon](http://photon.komoot.de/)
- [Pelias](https://pelias.io/), [geocode.earth](https://geocode.earth/) (formerly Mapzen Search), [Openrouteservice](https://openrouteservice.org/dev/#/api-docs/geocode)
- [HERE Geocoder API](https://developer.here.com/documentation/geocoding-search-api/api-reference-swagger.html) ([legacy](https://developer.here.com/documentation/geocoder/topics/introduction.html))
- [Neutrino API](https://www.neutrinoapi.com/api/geocode-address/)
- [Plus codes](https://plus.codes/) (formerly OpenLocationCode) (requires [open-location-code](https://www.npmjs.com/package/open-location-code))
- [ArcGIS](https://developers.arcgis.com/features/geocoding/)
The plugin can easily be extended to support other providers. Current extensions:
- [DAWA Geocoder](https://github.com/kjoller/leaflet-control-geocoder-dawa/tree/new) - support for Danish Address Web API by [Niels Kjøller Hansen](https://github.com/kjoller)
# Demos
- [Leaflet Control Geocoder Demo](https://www.liedman.net/leaflet-control-geocoder/) hosted on liedman.net
- See [demo/](https://github.com/perliedman/leaflet-control-geocoder/tree/master/demo)
- See [demo-rollup/](https://github.com/perliedman/leaflet-control-geocoder/tree/master/demo-rollup) using the [rollup.js](https://rollupjs.org/) bundler
- See [demo-webpack/](https://github.com/perliedman/leaflet-control-geocoder/tree/master/demo-rollup) using the [webpack](https://webpack.js.org/) bundler
# Usage
[Download latest release](https://github.com/perliedman/leaflet-control-geocoder/releases), or obtain the latest release via [unpkg.com](https://unpkg.com/):
```HTML
<link rel="stylesheet" href="https://unpkg.com/leaflet-control-geocoder/dist/Control.Geocoder.css" />
<script src="https://unpkg.com/leaflet-control-geocoder/dist/Control.Geocoder.js"></script>
```
Add the control to a map instance:
```javascript
var map = L.map('map').setView([0, 0], 2);
L.tileLayer('https://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="https://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
L.Control.geocoder().addTo(map);
```
# Customizing
By default, when a geocoding result is found, the control will center the map on it and place
a marker at its location. This can be customized by listening to the control's `markgeocode`
event. To remove the control's default handler for marking a result, set the option
`defaultMarkGeocode` to `false`.
For example:
```javascript
var geocoder = L.Control.geocoder({
defaultMarkGeocode: false
})
.on('markgeocode', function(e) {
var bbox = e.geocode.bbox;
var poly = L.polygon([
bbox.getSouthEast(),
bbox.getNorthEast(),
bbox.getNorthWest(),
bbox.getSouthWest()
]).addTo(map);
map.fitBounds(poly.getBounds());
})
.addTo(map);
```
This will add a polygon representing the result's boundingbox when a result is selected.
# API
- latest → https://www.liedman.net/leaflet-control-geocoder/docs/
- version 1.13.0 → https://github.com/perliedman/leaflet-control-geocoder/tree/1.13.0#api
{
"name": "leaflet-control-geocoder",
"version": "1.5.5",
"homepage": "https://github.com/perliedman/leaflet-control-geocoder",
"authors": ["Per Liedman <per@liedman.net>"],
"description": "Extendable geocoder with builtin OSM/Nominatim support",
"main": ["dist/Control.Geocoder.js", "dist/Control.Geocoder.css"],
"moduleType": ["amd", "globals"],
"keywords": [
"leaflet",
"geocoder",
"locations",
"nominatim",
"bing",
"google",
"mapbox",
"photon",
"what3words",
"mapquest",
"mapzen",
"pluscodes",
"open location code",
"here"
],
"license": "BSD-2-Clause",
"ignore": ["**/.*", "node_modules", "bower_components", "test", "tests"]
}
# leaflet-control-geocoder-demo-esbuild
This demo demonstrates the usage of leaflet-control-geocoder using the [esbuild](https://github.com/evanw/esbuild) bundler.
1. `cd demo-esbuild/`
2. `npm install`
3. `npm run build`
4. `xdg-open index.html` or open `index.html` in your browser
<!DOCTYPE html>
<html>
<head>
<title>Leaflet Control Geocoder</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="./dist/main.css" />
</head>
<body>
<div id="map" style="width: 600px; height: 400px;"></div>
<script src="./dist/main.js"></script>
</body>
</html>
import L from 'leaflet';
import 'leaflet-control-geocoder';
import 'leaflet/dist/leaflet.css';
import 'leaflet-control-geocoder/dist/Control.Geocoder.css';
var map = L.map('map').setView([0, 0], 2);
L.tileLayer('https://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="https://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
L.Control.geocoder({
geocoder: L.Control.Geocoder.nominatim()
}).addTo(map);
{
"name": "leaflet-control-geocoder-demo-esbuild",
"private": true,
"scripts": {
"build": "esbuild --bundle --loader:.gif=file --loader:.png=file --outdir=dist/ main.js"
},
"dependencies": {
"leaflet": "^1.5.1",
"leaflet-control-geocoder": "^1.8.0"
},
"devDependencies": {
"esbuild": "^0.8.0"
}
}
# leaflet-control-geocoder-demo-rollup
This demo demonstrates the usage of leaflet-control-geocoder using the [rollup.js](https://rollupjs.org/) bundler.
1. `cd demo-rollup/`
2. `npm install`
3. `npm run build`
4. `xdg-open index.html` or open `index.html` in your browser
<!DOCTYPE html>
<html>
<head>
<title>Leaflet Control Geocoder</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="./node_modules/leaflet/dist/leaflet.css" />
<link
rel="stylesheet"
href="./node_modules/leaflet-control-geocoder/dist/Control.Geocoder.css"
/>
</head>
<body>
<div id="map" style="width: 600px; height: 400px;"></div>
<script src="./bundle.js"></script>
</body>
</html>
import L from 'leaflet';
import 'leaflet-control-geocoder';
var map = L.map('map').setView([0, 0], 2);
L.tileLayer('https://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="https://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
L.Control.geocoder({
geocoder: L.Control.Geocoder.nominatim()
}).addTo(map);
{
"name": "leaflet-control-geocoder-demo-rollup",
"private": true,
"scripts": {
"build": "rollup --config"
},
"dependencies": {
"leaflet": "^1.5.1",
"leaflet-control-geocoder": "^1.8.0"
},
"devDependencies": {
"rollup": "^1.14.4",
"rollup-plugin-commonjs": "^10.0.0",
"rollup-plugin-node-resolve": "^5.0.1"
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment