First commit

master
Skylar Ittner 3 years ago
commit 04f4c94789

File diff suppressed because it is too large Load Diff

@ -0,0 +1,105 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>FixPhrase</title>
<link rel="stylesheet" href="js/maplibre-gl/dist/mapbox-gl.css" />
<script src="https://static.netsyms.net/jquery/jquery.min.js"></script>
<script src="js/maplibre-gl/dist/mapbox-gl.js"></script>
<script src="js/map_maplibre.js"></script>
<script src="js/map.js"></script>
<style>
body {
height: 100vh;
width: 100vw;
padding: 0;
margin: 0;
}
#mapbox {
width: 100vw;
flex-grow: 9999;
}
#mapbox .mapboxgl-user-location-dot, #mapbox .mapboxgl-user-location-accuracy-circle {
pointer-events: none;
}
#wordbox {
width: 500px;
max-width: 75vw;
font-size: 110%;
}
#header {
display: flex;
justify-content: space-between;
align-items: center;
flex-grow: 1;
padding: 1em;
flex-wrap: wrap;
}
#header h1 {
padding: 0;
margin: 0;
margin-right: 1em;
}
#page-container {
height: 100%;
width: 100%;
display: flex;
flex-direction: column;
align-items: stretch;
}
.clicktext {
display: none;
}
@media (pointer:fine) {
.taptext {
display: none;
}
.clicktext {
display: initial;
}
}
</style>
</head>
<body>
<div id="page-container">
<div id="header">
<h1>FixPhrase</h1>
<div><input type="text" placeholder="FixPhrase Words" id="wordbox"/> <button onclick="dolookup();">Find</button></div>
<div>Locate any place on Earth with just four words.
<span class="taptext">Tap</span><span class="clicktext">Click</span> the map to
get the unique phrase for that spot. Type a phrase into the search box to
pinpoint it on the map.</div>
</div>
<div id="mapbox"></div>
</div>
<script>
window.onload = function () {
createMap();
};
function dolookup() {
$.getJSON("lookup.php", {
words: $("#wordbox").val()
}, function (resp) {
if (resp.status == "OK") {
new mapboxgl.Popup()
.setLngLat({lat: resp.coords[0], lng: resp.coords[1]})
.setHTML("<b>" + resp.words + "</b><br>" + resp.coords[0] + ", " + resp.coords[1])
.addTo(map);
map.animateMapIn(resp.coords[0], resp.coords[1], 18);
} else {
alert(resp.msg);
}
});
}
</script>
</body>
</html>

@ -0,0 +1,65 @@
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
var map = null;
function createMap() {
if (mapboxgl.supported()) {
$("#mapbox").css("display", "");
map = maplibreMap();
} else {
console.log("maplibre-gl not supported, disabling map");
$("#mapbox").css("display", "none");
}
}
function centerMapOnLocation(latitude, longitude) {
map.removeMarkers();
map.addMarker(latitude, longitude);
map.animateMapIn(latitude, longitude, 16);
}
/**
* Destroy and re-create the map.
* @returns {undefined}
*/
function reloadMap() {
try {
if (map != null && typeof map != 'undefined') {
map.off();
map.remove();
map = null;
createMap();
} else {
createMap();
}
} catch (ex) {
// oh well ¯\(°_o)/¯
console.log(ex);
$("#mapbox").css("display", "none");
}
}
function setMapLocation(latitude, longitude) {
if (map == null) {
return;
}
map.setMapLocation(latitude, longitude);
}
function animateMapIn(latitude, longitude, zoom, heading) {
if (map == null) {
return;
}
if (typeof zoom == 'undefined') {
zoom = 1;
}
if (typeof heading == 'undefined') {
heading = 0;
}
map.animateMapIn(latitude, longitude, zoom, heading);
}

@ -0,0 +1,115 @@
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
function maplibreMap() {
var theme = "liberty";
$("#mapbox").css("background-color", "#EFEFEF");
var map = new mapboxgl.Map({
container: 'mapbox',
style: "https://maps.netsyms.net/styles/osm-liberty/style.json",
//attributionControl: false,
interactive: true,
pitch: 0,
zoom: 1,
maxZoom: 20,
center: [-97, 38]
});
map.on('click', function (e) {
var coordinates = e.lngLat;
$.getJSON("lookup.php", {
latitude: coordinates.lat,
longitude: coordinates.lng
}, function (resp) {
new mapboxgl.Popup()
.setLngLat(coordinates)
.setHTML("<b>" + resp.words + "</b><br>" + resp.coords[0] + ", " + resp.coords[1])
.addTo(map);
});
});
map.addControl(new mapboxgl.NavigationControl({
visualizePitch: true
}), 'top-left');
map.addControl(new mapboxgl.GeolocateControl({
positionOptions: {
enableHighAccuracy: true,
timeout: 10 * 1000
},
fitBoundsOptions: {
maxZoom: 16
},
trackUserLocation: true
}), 'top-left');
map.addControl(new mapboxgl.ScaleControl({
unit: "imperial"
}));
map.mapEasing = function (t) {
return t * (2 - t);
};
map.setMapHeading = function (heading) {
if (typeof heading == 'number') {
map.easeTo({
bearing: heading,
easing: map.mapEasing
});
}
};
map.setMapLocation = function (latitude, longitude) {
map.easeTo({
center: [
longitude,
latitude
]
});
};
map.animateMapIn = function (latitude, longitude, zoom, heading) {
if (typeof zoom == 'undefined') {
zoom = 10;
}
if (typeof heading == 'undefined') {
heading = 0;
}
map.flyTo({
center: [
longitude,
latitude
],
speed: 1,
zoom: zoom,
heading: heading,
pitch: 0
});
};
map.addMarker = function (latitude, longitude) {
var el = document.createElement("div");
el.className = "map-marker";
new mapboxgl.Marker(el).setLngLat([longitude, latitude]).addTo(map);
};
map.removeMarkers = function () {
var oldmarkers = document.getElementsByClassName("map-marker");
if (oldmarkers.length > 0) {
markerparent = oldmarkers[0].parentNode;
while (oldmarkers.length > 0) {
markerparent.removeChild(oldmarkers[0]);
}
}
}
return map;
}

@ -0,0 +1,61 @@
[ignore]
.*\.svg
.*\.png
.*/\.nyc_output/.*
.*/docs/.*
.*/node_modules/.cache/.*
.*/node_modules/.*/tests?/.*
.*/node_modules/@mapbox/jsonlint-lines-primitives/.*
.*/node_modules/@mapbox/mvt-fixtures/.*
.*/node_modules/@mapbox/geojson-types/fixtures/.*
.*/node_modules/@mapbox/mr-ui/.*
.*/node_modules/@mapbox/dr-ui/.*
.*/node_modules/@mapbox/batfish/.*
.*/node_modules/browserify/.*
.*/node_modules/browser-sync.*/.*
.*/node_modules/nyc/.*
.*/node_modules/fbjs/.*
.*/node_modules/es5-ext/.*
.*/node_modules/jsdom/.*
.*/node_modules/eslint.*/.*
.*/node_modules/highlight.*/.*
.*/node_modules/rxjs/.*
.*/node_modules/@?babel.*/.*
.*/node_modules/react.*/.*
.*/node_modules/svgo/.*
.*/node_modules/moment/.*
.*/node_modules/regenerate-unicode-properties/.*
.*/node_modules/remark.*/.*
.*/node_modules/webpack/.*
.*/node_modules/caniuse-lite/.*
.*/node_modules/d3.*/.*
.*/node_modules/css-tree/.*
.*/node_modules/lodash/.*
.*/node_modules/fsevents/.*
.*/node_modules/browser-sync-client/.*
.*/node_modules/core-js.*/.*
.*/node_modules/stylelint/.*
.*/node_modules/postcss.*/.*
.*/node_modules/prismjs.*/.*
.*/node_modules/documentation/.*
.*/node_modules/module-deps/.*
.*/test/unit/style-spec/fixture/invalidjson.input.json
.*/render-tests/.*
.*/query-tests/.*
.*/expression-tests/.*
.*/test/build/downstream-flow-fixture/.*
.*/_batfish_tmp/.*
.*/_site/.*
[version]
0.100.0
[options]
server.max_workers=4
[strict]
nonstrict-import
unclear-type
untyped-import
untyped-type-import
sketchy-null

File diff suppressed because it is too large Load Diff

@ -0,0 +1,84 @@
Copyright (c) 2020, Mapbox
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* 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.
* Neither the name of Mapbox GL JS nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
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 OWNER 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.
-------------------------------------------------------------------------------
Contains code from glfx.js
Copyright (C) 2011 by Evan Wallace
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
--------------------------------------------------------------------------------
Contains a portion of d3-color https://github.com/d3/d3-color
Copyright 2010-2016 Mike Bostock
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* 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.
* Neither the name of the author nor the names of contributors may be used to
endorse or promote products derived from this software without specific prior
written permission.
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 OWNER 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.

@ -0,0 +1,39 @@
# MapLibre GL
**MapLibre GL** is a community led fork derived from [mapbox-gl-js](https://github.com/mapbox/mapbox-gl-js) prior to their switch to a non-OSS license.
[<img width="200" alt="MapLibre" src="https://user-images.githubusercontent.com/223277/101580282-7534f700-397e-11eb-8b58-687f52e2a8cf.png">](http://maplibre.org)
### Migrating from mapbox-gl
If you depend on mapbox-gl directly, simply replace `mapbox-gl` with `maplibre-gl` in `package.json`:
```diff
"dependencies": {
- "mapbox-gl": "^1.13.0"
+ "maplibre-gl": ">=1.13.0-rc.1"
}
```
Want an example? [Try out MapLibre GL on CodePen](https://codepen.io/snickell/pen/dypOWzj)
If you use mapbox-gl via bindings (react, vue, etc), you may need to wait a little longer as we develop an easy migration path for each binding. Contributions welcome!
### Roadmap
This project's initial plans are outlined in the [Roadmap](https://github.com/maplibre/maplibre-gl-js/projects/2) project. The primary goal is consistency and backwards-compatability with previous releases and continued bug-fixes and maintenance going forward.
### Getting Involved
Join the #maplibre slack channel at OSMUS: get an invite at https://osmus-slack.herokuapp.com/
### Avoid Fragmentation
If you depend on a free software alternative to `mapbox-gl-js`, please consider joining our effort! Anyone with a stake in a healthy community led fork is welcome to help us figure out our next steps. We welcome contributors and leaders! MapLibre GL already represents the combined efforts of a few early fork efforts, and we all benefit from "one project" rather than "our way". If you know of other forks, please reach out to them and direct them here.
### Thank you Mapbox 🙏🏽
We'd like to acknowledge the amazing work Mapbox has contributed to open source. The open source community is sad to part ways with them, but we simultaneously feel grateful for everything they already contributed. `mapbox-gl-js` 1.x is an open source achievment which now lives on as `maplibre-gl`. We're proud to develop on the shoulders of giants, thank you Mapbox 🙇🏽‍♀️
## License
MapLibre GL is licensed under the [3-Clause BSD license](./LICENSE.txt).

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -0,0 +1,205 @@
{
"_args": [
[
"maplibre-gl@1.13.0-rc.4",
"/home/skylar/Documents/Projects/Sources/Apps/Native/HelenaExpress/www"
]
],
"_from": "maplibre-gl@1.13.0-rc.4",
"_id": "maplibre-gl@1.13.0-rc.4",
"_inBundle": false,
"_integrity": "sha512-QQ4b0fjGxXTGdS/sTKaXp8kyL/DsC93zAm2zGkhyExywvvsduFup9GTzCDas7g4VljYGgTsNhaWkxWewu0gG9A==",
"_location": "/maplibre-gl",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "maplibre-gl@1.13.0-rc.4",
"name": "maplibre-gl",
"escapedName": "maplibre-gl",
"rawSpec": "1.13.0-rc.4",
"saveSpec": null,
"fetchSpec": "1.13.0-rc.4"
},
"_requiredBy": [
"/"
],
"_resolved": "https://registry.npmjs.org/maplibre-gl/-/maplibre-gl-1.13.0-rc.4.tgz",
"_spec": "1.13.0-rc.4",
"_where": "/home/skylar/Documents/Projects/Sources/Apps/Native/HelenaExpress/www",
"browser": {
"./src/shaders/index.js": "./src/shaders/shaders.js",
"./src/util/window.js": "./src/util/browser/window.js",
"./src/util/web_worker.js": "./src/util/browser/web_worker.js"
},
"bugs": {
"url": "https://github.com/maplibre/maplibre-gl-js/issues"
},
"dependencies": {
"@mapbox/geojson-rewind": "^0.5.0",
"@mapbox/geojson-types": "^1.0.2",
"@mapbox/jsonlint-lines-primitives": "^2.0.2",
"@mapbox/mapbox-gl-supported": "^1.5.0",
"@mapbox/point-geometry": "^0.1.0",
"@mapbox/tiny-sdf": "^1.1.1",
"@mapbox/unitbezier": "^0.0.0",
"@mapbox/vector-tile": "^1.3.1",
"@mapbox/whoots-js": "^3.1.0",
"csscolorparser": "~1.0.3",
"earcut": "^2.2.2",
"geojson-vt": "^3.2.1",
"gl-matrix": "^3.2.1",
"grid-index": "^1.1.0",
"minimist": "^1.2.5",
"murmurhash-js": "^1.0.0",
"pbf": "^3.2.1",
"potpack": "^1.0.1",
"quickselect": "^2.0.0",
"rw": "^1.3.3",
"supercluster": "^7.1.0",
"tinyqueue": "^2.0.3",
"vt-pbf": "^3.1.1"
},
"description": "BSD licensed community fork of mapbox-gl, a WebGL interactive maps library",
"devDependencies": {
"@babel/core": "^7.9.0",
"@mapbox/flow-remove-types": "^1.3.0-await.upstream.2",
"@mapbox/gazetteer": "^4.0.4",
"@mapbox/mapbox-gl-rtl-text": "^0.2.1",
"@mapbox/mvt-fixtures": "^3.6.0",
"@octokit/rest": "^16.30.1",
"@rollup/plugin-strip": "^1.3.1",
"address": "^1.1.2",
"babel-eslint": "^10.0.1",
"babelify": "^10.0.0",
"benchmark": "^2.1.4",
"browserify": "^16.5.0",
"canvas": "^2.6.1",
"chalk": "^3.0.0",
"chokidar": "^3.0.2",
"cssnano": "^4.1.10",
"d3": "^4.12.0",
"diff": "^4.0.1",
"documentation": "~12.1.1",
"ejs": "^2.5.7",
"eslint": "^5.15.3",
"eslint-config-mourner": "^3.0.0",
"eslint-plugin-flowtype": "^3.9.1",
"eslint-plugin-html": "^5.0.5",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-jsdoc": "^17.1.2",
"eslint-plugin-react": "^7.12.4",
"esm": "~3.0.84",
"flow-bin": "^0.100.0",
"gl": "^4.5.3",
"glob": "^7.1.4",
"is-builtin-module": "^3.0.0",
"jsdom": "^13.0.0",
"json-stringify-pretty-compact": "^2.0.0",
"jsonwebtoken": "^8.3.0",
"list-npm-contents": "^1.0.2",
"lodash.template": "^4.5.0",
"mapbox-gl-styles": "^2.0.2",
"mock-geolocation": "^1.0.11",
"node-notifier": "^5.4.3",
"npm-font-open-sans": "^1.1.0",
"npm-packlist": "^2.1.1",
"npm-run-all": "^4.1.5",
"nyc": "^13.3.0",
"pirates": "^4.0.1",
"pixelmatch": "^5.1.0",
"pngjs": "^3.4.0",
"postcss-cli": "^6.1.2",
"postcss-inline-svg": "^3.1.1",
"pretty-bytes": "^5.1.0",
"puppeteer": "^1.18.0",
"qrcode-terminal": "^0.12.0",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"request": "^2.88.0",
"rollup": "^1.23.1",
"rollup-plugin-buble": "^0.19.8",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-json": "^4.0.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-replace": "^2.2.0",
"rollup-plugin-sourcemaps": "^0.4.2",
"rollup-plugin-terser": "^5.1.2",
"rollup-plugin-unassert": "^0.3.0",
"selenium-webdriver": "^4.0.0-alpha.5",
"shuffle-seed": "^1.1.6",
"sinon": "^7.3.2",
"st": "^1.2.2",
"stylelint": "^9.10.1",
"stylelint-config-standard": "^18.2.0",
"tap": "~12.4.1",
"tap-parser": "^10.0.1",
"tape": "^4.13.2",
"tape-filter": "^1.0.4",
"testem": "^3.0.0"
},
"engines": {
"node": ">=6.4.0"
},
"esm": true,
"files": [
"build/",
"dist/mapbox-gl*",
"dist/style-spec/",
"flow-typed/*.js",
"src/",
".flowconfig"
],
"homepage": "https://github.com/maplibre/maplibre-gl-js#readme",
"license": "BSD-3-Clause",
"main": "dist/mapbox-gl.js",
"name": "maplibre-gl",
"repository": {
"type": "git",
"url": "git://github.com/maplibre/maplibre-gl-js.git"
},
"scripts": {
"build-benchmarks": "BENCHMARK_VERSION=${BENCHMARK_VERSION:-\"$(git rev-parse --abbrev-ref HEAD) $(git rev-parse --short=7 HEAD)\"} rollup -c bench/versions/rollup_config_benchmarks.js",
"build-csp": "rollup -c rollup.config.csp.js",
"build-css": "postcss -o dist/mapbox-gl.css src/css/mapbox-gl.css",
"build-dev": "rollup -c --environment BUILD:dev",
"build-flow-types": "mkdir -p dist && cp build/mapbox-gl.js.flow dist/mapbox-gl.js.flow && cp build/mapbox-gl.js.flow dist/mapbox-gl-dev.js.flow",
"build-prod": "rollup -c --environment BUILD:production",
"build-prod-min": "rollup -c --environment BUILD:production,MINIFY:true",
"build-query-suite": "rollup -c test/integration/rollup.config.test.js",
"build-style-spec": "cd src/style-spec && npm run build && cd ../.. && mkdir -p dist/style-spec && cp src/style-spec/dist/* dist/style-spec",
"build-token": "node build/generate-access-token-script.js",
"codegen": "build/run-node build/generate-style-code.js && build/run-node build/generate-struct-arrays.js",
"diff-tarball": "build/run-node build/diff-tarball && echo \"Please confirm the above is correct [y/n]? \"; read answer; if [ \"$answer\" = \"${answer#[Yy]}\" ]; then false; fi",
"lint": "eslint --cache --ignore-path .gitignore src test bench debug/*.html",
"lint-css": "stylelint 'src/css/mapbox-gl.css'",
"lint-docs": "documentation lint src/index.js",
"prepare-publish": "git clean -fdx && yarn install",
"prepublishOnly": "run-s prepare-publish build-flow-types build-dev build-prod-min build-prod build-csp build-css build-style-spec test-build diff-tarball",
"print-release-url": "node build/print-release-url.js",
"start": "run-p build-token watch-css watch-query watch-benchmarks start-server",
"start-bench": "run-p build-token watch-benchmarks start-server",
"start-debug": "run-p build-token watch-css watch-dev start-server",
"start-release": "run-s build-token build-prod-min build-css print-release-url start-server",
"start-server": "st --no-cache -H 0.0.0.0 --port 9966 --index index.html .",
"start-tests": "run-p build-token watch-css watch-query start-server",
"test": "run-s lint lint-css lint-docs test-flow test-unit",
"test-browser": "build/run-tap --reporter spec --no-coverage test/browser/**/*.test.js",
"test-build": "build/run-tap --no-coverage test/build/**/*.test.js",
"test-cov": "nyc --require=@mapbox/flow-remove-types/register --reporter=text-summary --reporter=lcov --cache run-s test-unit test-expressions test-query test-render",
"test-expressions": "build/run-node test/expression.test.js",
"test-flow": "build/run-node build/generate-flow-typed-style-spec && flow .",
"test-query": "testem ci -f test/integration/testem.js -R xunit > test/integration/query-tests/test-results.xml",
"test-query-node": "node test/query.test.js",
"test-render": "node --max-old-space-size=2048 test/render.test.js",
"test-suite": "run-s test-render test-query test-expressions",
"test-suite-clean": "find test/integration/{render,query, expressions}-tests -mindepth 2 -type d -exec test -e \"{}/actual.png\" \\; -not \\( -exec test -e \"{}/style.json\" \\; \\) -print | xargs -t rm -r",
"test-unit": "build/run-tap --reporter classic --no-coverage test/unit",
"watch-benchmarks": "BENCHMARK_VERSION=${BENCHMARK_VERSION:-\"$(git rev-parse --abbrev-ref HEAD) $(git rev-parse --short=7 HEAD)\"} rollup -c bench/rollup_config_benchmarks.js -w",
"watch-css": "postcss --watch -o dist/mapbox-gl.css src/css/mapbox-gl.css",
"watch-dev": "rollup -c --environment BUILD:dev --watch",
"watch-query": "testem -f test/integration/testem.js"
},
"style": "dist/mapbox-gl.css",
"version": "1.13.0-rc.4"
}

@ -0,0 +1,65 @@
<?php
require_once __DIR__ . "/FixPhrase.lib.php";
/**
* Build and send a simple JSON response.
* @param string $msg A message
* @param string $status "OK" or "ERROR"
* @param array $data More JSON data
*/
function sendJsonResp(string $msg = null, string $status = "OK", array $data = null) {
$resp = [];
if (!is_null($data)) {
$resp = $data;
}
if (!is_null($msg)) {
$resp["msg"] = $msg;
}
$resp["status"] = $status;
header("Content-Type: application/json");
exit(json_encode($resp));
}
function exitWithJson(array $json) {
header("Content-Type: application/json");
exit(json_encode($json));
}
$output = [];
try {
if (!empty($_GET["words"])) {
// convert words to coordinates
$words = urldecode($_GET["words"]);
$coords = FixPhrase::decode($words);
$output = [
"status" => "OK",
"action" => "decodeFromWords",
"words" => $words,
"coords" => $coords
];
} else if (!empty($_GET["latitude"]) && !empty($_GET["longitude"])) {
// convert coordinates to words
$lat = round($_GET["latitude"], 4);
$lon = round($_GET["longitude"], 4);
$words = FixPhrase::encode($lat, $lon);
$output = [
"status" => "OK",
"action" => "encodeToWords",
"words" => $words,
"coords" => [
$lat,
$lon
]
];
} else {
throw new Exception("Must supply either a string of words or a latitude/longitude pair.");
}
} catch (Exception $ex) {
sendJsonResp($ex->getMessage(), "ERROR");
}
exitWithJson($output);

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="5.6444445mm" height="9.847393mm" viewBox="0 0 20 34.892337" id="svg3455" version="1.1" inkscape:version="0.91 r13725" sodipodi:docname="Map Pin.svg">
<defs id="defs3457"/>
<sodipodi:namedview id="base" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="12.181359" inkscape:cx="8.4346812" inkscape:cy="14.715224" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="false" inkscape:window-width="1024" inkscape:window-height="705" inkscape:window-x="-4" inkscape:window-y="-4" inkscape:window-maximized="1" fit-margin-top="0" fit-margin-left="0" fit-margin-right="0" fit-margin-bottom="0"/>
<metadata id="metadata3460">
<rdf:RDF>
<cc:Work rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
<dc:title/>
</cc:Work>
</rdf:RDF>
</metadata>
<g inkscape:label="Layer 1" inkscape:groupmode="layer" id="layer1" transform="translate(-814.59595,-274.38623)">
<g id="g3477" transform="matrix(1.1855854,0,0,1.1855854,-151.17715,-57.3976)">
<path sodipodi:nodetypes="sscccccsscs" inkscape:connector-curvature="0" id="path4337-3" d="m 817.11249,282.97118 c -1.25816,1.34277 -2.04623,3.29881 -2.01563,5.13867 0.0639,3.84476 1.79693,5.3002 4.56836,10.59179 0.99832,2.32851 2.04027,4.79237 3.03125,8.87305 0.13772,0.60193 0.27203,1.16104 0.33416,1.20948 0.0621,0.0485 0.19644,-0.51262 0.33416,-1.11455 0.99098,-4.08068 2.03293,-6.54258 3.03125,-8.87109 2.77143,-5.29159 4.50444,-6.74704 4.56836,-10.5918 0.0306,-1.83986 -0.75942,-3.79785 -2.01758,-5.14062 -1.43724,-1.53389 -3.60504,-2.66908 -5.91619,-2.71655 -2.31115,-0.0475 -4.4809,1.08773 -5.91814,2.62162 z" style="display:inline;opacity:1;fill:#ff4646;fill-opacity:1;stroke:#d73534;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"/>
<circle r="3.0355" cy="288.25278" cx="823.03064" id="path3049" style="display:inline;opacity:1;fill:#590000;fill-opacity:1;stroke-width:0"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

@ -0,0 +1,7 @@
include.path=${php.global.include.path}
php.version=PHP_74
source.encoding=UTF-8
src.dir=.
tags.asp=false
tags.short=false
web.root=.

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.php.project</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/php-project/1">
<name>fixphrase.com</name>
</data>
</configuration>
</project>
Loading…
Cancel
Save