Add map on tracking results, bump version to 1.1.0
parent
38ad007b76
commit
83ee49942c
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
./scripts/www_npm_install.sh
|
||||
./scripts/generate_credits.sh
|
||||
./scripts/remove_bloat.sh
|
||||
./scripts/remove_bloat.sh
|
||||
./scripts/generate_credits.sh
|
Binary file not shown.
After Width: | Height: | Size: 3.3 KiB |
@ -0,0 +1,486 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!--part of the matt icon theme by sixsixfive released under CC0 (https://creativecommons.org/publicdomain/zero/1.0/) on openclipart-->
|
||||
|
||||
<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:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
viewBox="0 0 128 128"
|
||||
version="1.1"
|
||||
id="svg947"
|
||||
sodipodi:docname="package-icon.svg"
|
||||
inkscape:version="0.92.3 (2405546, 2018-03-11)"
|
||||
inkscape:export-filename="/home/skylar/Documents/Projects/Sources/Apps/Native/HelenaExpress/www/assets/images/package-icon.png"
|
||||
inkscape:export-xdpi="48"
|
||||
inkscape:export-ydpi="48">
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1013"
|
||||
id="namedview949"
|
||||
showgrid="false"
|
||||
inkscape:zoom="2.0826504"
|
||||
inkscape:cx="-88.655531"
|
||||
inkscape:cy="82.300913"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg947" />
|
||||
<metadata
|
||||
id="metadata951">
|
||||
<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></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
id="0">
|
||||
<linearGradient
|
||||
id="D">
|
||||
<stop
|
||||
id="T" />
|
||||
<stop
|
||||
stop-opacity="0"
|
||||
offset="1"
|
||||
id="U" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="E">
|
||||
<stop
|
||||
stop-color="#fff"
|
||||
id="V" />
|
||||
<stop
|
||||
stop-color="#eddabc"
|
||||
offset="1"
|
||||
id="W" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="F">
|
||||
<stop
|
||||
stop-color="#c29650"
|
||||
id="X" />
|
||||
<stop
|
||||
stop-color="#cca86e"
|
||||
offset="1"
|
||||
id="Y" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="G">
|
||||
<stop
|
||||
stop-color="#a37a39"
|
||||
id="Z" />
|
||||
<stop
|
||||
stop-color="#c39854"
|
||||
offset="1"
|
||||
id="a" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="H">
|
||||
<stop
|
||||
stop-color="#eddabc"
|
||||
id="b" />
|
||||
<stop
|
||||
stop-color="#d8af6e"
|
||||
offset="1"
|
||||
id="c" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
gradientTransform="matrix(0.13337487,-0.58579661,0.43334796,0.09866518,-140.53171,197.47031)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
xlink:href="#H"
|
||||
id="I"
|
||||
r="110.72"
|
||||
cy="382.63"
|
||||
cx="211.15" />
|
||||
<radialGradient
|
||||
gradientTransform="matrix(-0.37117278,0.14517548,-0.14805715,-0.37854038,312.3712,40.739168)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
xlink:href="#G"
|
||||
id="J"
|
||||
r="119.48"
|
||||
cy="201.93"
|
||||
cx="445.36" />
|
||||
<radialGradient
|
||||
gradientTransform="matrix(0.50693897,-0.129967,0.0262165,0.10225801,-39.663475,32.07396)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
xlink:href="#E"
|
||||
id="K"
|
||||
r="134.88"
|
||||
cy="162.96"
|
||||
cx="139.26" />
|
||||
<radialGradient
|
||||
gradientTransform="matrix(0.03919011,-0.09570432,0.16373591,0.06704846,-2.2215551,38.191936)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
xlink:href="#F"
|
||||
id="L"
|
||||
r="228.86"
|
||||
cy="280.07"
|
||||
cx="212.44" />
|
||||
<filter
|
||||
id="M"
|
||||
color-interpolation-filters="sRGB">
|
||||
<feGaussianBlur
|
||||
id="d"
|
||||
stdDeviation="1.84125" />
|
||||
</filter>
|
||||
<filter
|
||||
id="N"
|
||||
color-interpolation-filters="sRGB">
|
||||
<feGaussianBlur
|
||||
id="e"
|
||||
stdDeviation="1.0013" />
|
||||
</filter>
|
||||
<linearGradient
|
||||
gradientUnits="userSpaceOnUse"
|
||||
xlink:href="#D"
|
||||
id="O"
|
||||
y2="131"
|
||||
x2="72.26"
|
||||
y1="135.17"
|
||||
x1="48.3" />
|
||||
<clipPath
|
||||
clipPathUnits="userSpaceOnUse"
|
||||
id="clipPath1158">
|
||||
<path
|
||||
style="opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:27.61475563;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
|
||||
d="M -12.224537,16.342765 154.84386,1.7278173 V 13.664377 L -12.224537,28.279324 Z"
|
||||
id="path1160"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccccc" />
|
||||
</clipPath>
|
||||
</defs>
|
||||
<path
|
||||
filter="url(#N)"
|
||||
fill="url(#O)"
|
||||
opacity="0.425"
|
||||
id="1"
|
||||
transform="matrix(0.85693077,-0.4706646,0.46259458,0.87188005,2.2336477,0.32237861)"
|
||||
d="m 55.132413,114.01574 13.842394,0 1.476115,23.73867 -13.842394,0 -1.476115,-23.73867 z" />
|
||||
<path
|
||||
filter="url(#M)"
|
||||
opacity="0.637"
|
||||
id="2"
|
||||
transform="matrix(0.48733016,0.40593889,-0.40593889,0.48733016,80.572751,-24.561254)"
|
||||
d="M 96.675414,14.344852 C 67.689599,27.185172 40.560433,41.085059 11.680603,54.183529 -7.6075114,79.672109 -26.168705,102.04586 -45.214473,127.6876 c 0.151729,2.90509 3.743817,4.43623 5.153803,6.80723 23.015547,25.23201 45.5168287,50.39807 68.676681,75.4598 6.224828,-0.31571 11.138232,-0.98651 17.378335,-1.83048 25.938049,-4.60892 51.976105,-8.89435 77.851984,-13.70442 3.21252,-5.55585 5.23055,-11.94584 8.01672,-17.79829 10.53597,-24.6053 21.42572,-49.1107 31.74136,-73.77824 -2.53772,-4.898976 -7.63337,-7.674135 -10.69436,-12.340782 C 134.45608,65.22696 116.26812,39.698472 97.648395,14.58068 c -2.439828,2.765187 -2.727177,2.05986 -0.972981,-0.235828 z" />
|
||||
<path
|
||||
style="fill:#c09652;fill-opacity:1"
|
||||
fill="#debd87"
|
||||
id="3"
|
||||
transform="matrix(0.48733016,0.40593889,-0.40593889,0.48733016,80.572751,-24.960797)"
|
||||
d="m 97.75,12.875 a 1.6878972,1.6878972 0 0 0 -0.59375,0.15625 L 11.375,51.65625 a 1.6878972,1.6878972 0 0 0 -0.65625,0.5 L -46.5625,127.875 a 1.6878972,1.6878972 0 0 0 0.09375,2.15625 l 73.1875,80.65625 a 1.6878972,1.6878972 0 0 0 1.53125,0.53125 l 94.96875,-16.5625 a 1.6878972,1.6878972 0 0 0 1.28125,-1 L 163.46875,103.5 a 1.6878972,1.6878972 0 0 0 -0.1875,-1.65625 L 99.21875,13.5625 A 1.6878972,1.6878972 0 0 0 97.75,12.875 z" />
|
||||
<path
|
||||
style="fill:#c9a05d;fill-opacity:1"
|
||||
fill="url(#J)"
|
||||
id="5"
|
||||
d="m 122.34471,21.870475 -59.789046,18.790616 -0.840425,78.096019 0.428141,0.24578 55.57899,-28.130421 4.62234,-69.001994 z" />
|
||||
<path
|
||||
sodipodi:nodetypes="ccccccccccccc"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#debd87;fill-opacity:1"
|
||||
id="6"
|
||||
d="M 64.175892,4.9132298 5.5735194,18.518957 l -0.3178712,0.454639 -0.1330708,0.348105 0.019362,0.303691 0.9560712,0.116738 56.4576536,20.918961 60.834596,-18.455439 0.027,-0.643479 -0.43445,-0.568068 -0.93518,-0.277419 L 64.812497,4.7434685 Z" />
|
||||
<path
|
||||
style="fill:none;stroke:#debc85;stroke-width:1.12781262"
|
||||
inkscape:connector-curvature="0"
|
||||
id="8"
|
||||
d="m 62.562595,40.14536 -0.436863,79.31083" />
|
||||
<path
|
||||
stroke-width="0.381"
|
||||
stroke="#000"
|
||||
fill="#eddabc"
|
||||
opacity="0.708"
|
||||
id="B"
|
||||
d="M 34.37719,29.724231 91.556048,13.211371" />
|
||||
<path
|
||||
fill="url(#K)"
|
||||
opacity="0.708"
|
||||
id="C"
|
||||
d="m 88.344436,11.310762 -58.335387,16.529896 -0.412283,9.157452 1.339921,-0.451926 -1.062423,1.070351 0.0555,0.02377 1.974204,-0.745282 -0.261642,1.228922 1.220994,-0.523283 -0.420212,0.91971 0.03171,0.01586 1.355779,-0.80871 0.08721,1.268565 0.832496,-0.737354 0.475712,0.911781 0.792853,-0.436069 0.261641,1.054495 0.959352,-0.880067 c 0,0 0.119342,0.225878 0.150642,0.285427 l 0.467784,-7.524162 60.182279,-17.663351 -9.696137,-2.696025 z" />
|
||||
<path
|
||||
sodipodi:nodetypes="sssssssss"
|
||||
inkscape:connector-curvature="0"
|
||||
id="rect953"
|
||||
d="m 68.741875,42.061661 16,-5.020334 c 1.057181,-0.331713 2,0.892 2,2 v 26 c 0,1.108 -0.942819,1.668287 -2,2 l -16,5.020334 c -1.057181,0.331713 -2,-0.892 -2,-2 v -26 c 0,-1.108 0.942819,-1.668287 2,-2 z"
|
||||
style="opacity:1;fill:#d9d9d9;fill-opacity:1;stroke:none;stroke-width:4.2442503;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
|
||||
<g
|
||||
transform="matrix(0.11971145,0,0,0.43376981,68.062795,56.560179)"
|
||||
style="fill:#000000"
|
||||
id="barcode"
|
||||
clip-path="url(#clipPath1158)">
|
||||
<rect
|
||||
height="30"
|
||||
width="2"
|
||||
id="barcode_bar1"
|
||||
y="0"
|
||||
x="0" />
|
||||
<rect
|
||||
height="30"
|
||||
width="1"
|
||||
id="barcode_bar3"
|
||||
y="0"
|
||||
x="3" />
|
||||
<rect
|
||||
height="30"
|
||||
width="1"
|
||||
id="barcode_bar5"
|
||||
y="0"
|
||||
x="6" />
|
||||
<rect
|
||||
height="30"
|
||||
width="1"
|
||||
id="barcode_bar7"
|
||||
y="0"
|
||||
x="11" />
|
||||
<rect
|
||||
height="30"
|
||||
width="2"
|
||||
id="barcode_bar9"
|
||||
y="0"
|
||||
x="13" />
|
||||
<rect
|
||||
height="30"
|
||||
width="1"
|
||||
id="barcode_bar11"
|
||||
y="0"
|
||||
x="17" />
|
||||
<rect
|
||||
height="30"
|
||||
width="1"
|
||||
id="barcode_bar13"
|
||||
y="0"
|
||||
x="22" />
|
||||
<rect
|
||||
height="30"
|
||||
width="1"
|
||||
id="barcode_bar15"
|
||||
y="0"
|
||||
x="25" />
|
||||
<rect
|
||||
height="30"
|
||||
width="2"
|
||||
id="barcode_bar17"
|
||||
y="0"
|
||||
x="27" />
|
||||
<rect
|
||||
height="30"
|
||||
width="1"
|
||||
id="barcode_bar19"
|
||||
y="0"
|
||||
x="33" />
|
||||
<rect
|
||||
height="30"
|
||||
width="4"
|
||||
id="barcode_bar21"
|
||||
y="0"
|
||||
x="35" />
|
||||
<rect
|
||||
height="30"
|
||||
width="1"
|
||||
id="barcode_bar23"
|
||||
y="0"
|
||||
x="41" />
|
||||
<rect
|
||||
height="30"
|
||||
width="1"
|
||||
id="barcode_bar25"
|
||||
y="0"
|
||||
x="44" />
|
||||
<rect
|
||||
height="30"
|
||||
width="4"
|
||||
id="barcode_bar27"
|
||||
y="0"
|
||||
x="47" />
|
||||
<rect
|
||||
height="30"
|
||||
width="1"
|
||||
id="barcode_bar29"
|
||||
y="0"
|
||||
x="52" />
|
||||
<rect
|
||||
height="30"
|
||||
width="1"
|
||||
id="barcode_bar31"
|
||||
y="0"
|
||||
x="55" />
|
||||
<rect
|
||||
height="30"
|
||||
width="2"
|
||||
id="barcode_bar33"
|
||||
y="0"
|
||||
x="57" />
|
||||
<rect
|
||||
height="30"
|
||||
width="1"
|
||||
id="barcode_bar35"
|
||||
y="0"
|
||||
x="61" />
|
||||
<rect
|
||||
height="30"
|
||||
width="1"
|
||||
id="barcode_bar37"
|
||||
y="0"
|
||||
x="66" />
|
||||
<rect
|
||||
height="30"
|
||||
width="1"
|
||||
id="barcode_bar39"
|
||||
y="0"
|
||||
x="69" />
|
||||
<rect
|
||||
height="30"
|
||||
width="4"
|
||||
id="barcode_bar41"
|
||||
y="0"
|
||||
x="72" />
|
||||
<rect
|
||||
height="30"
|
||||
width="2"
|
||||
id="barcode_bar43"
|
||||
y="0"
|
||||
x="77" />
|
||||
<rect
|
||||
height="30"
|
||||
width="2"
|
||||
id="barcode_bar45"
|
||||
y="0"
|
||||
x="80" />
|
||||
<rect
|
||||
height="30"
|
||||
width="2"
|
||||
id="barcode_bar47"
|
||||
y="0"
|
||||
x="84" />
|
||||
<rect
|
||||
height="30"
|
||||
width="1"
|
||||
id="barcode_bar49"
|
||||
y="0"
|
||||
x="88" />
|
||||
<rect
|
||||
height="30"
|
||||
width="2"
|
||||
id="barcode_bar51"
|
||||
y="0"
|
||||
x="90" />
|
||||
<rect
|
||||
height="30"
|
||||
width="1"
|
||||
id="barcode_bar53"
|
||||
y="0"
|
||||
x="94" />
|
||||
<rect
|
||||
height="30"
|
||||
width="1"
|
||||
id="barcode_bar55"
|
||||
y="0"
|
||||
x="99" />
|
||||
<rect
|
||||
height="30"
|
||||
width="2"
|
||||
id="barcode_bar57"
|
||||
y="0"
|
||||
x="102" />
|
||||
<rect
|
||||
height="30"
|
||||
width="1"
|
||||
id="barcode_bar59"
|
||||
y="0"
|
||||
x="105" />
|
||||
<rect
|
||||
height="30"
|
||||
width="1"
|
||||
id="barcode_bar61"
|
||||
y="0"
|
||||
x="110" />
|
||||
<rect
|
||||
height="30"
|
||||
width="2"
|
||||
id="barcode_bar63"
|
||||
y="0"
|
||||
x="113" />
|
||||
<rect
|
||||
height="30"
|
||||
width="1"
|
||||
id="barcode_bar65"
|
||||
y="0"
|
||||
x="116" />
|
||||
<rect
|
||||
height="30"
|
||||
width="2"
|
||||
id="barcode_bar67"
|
||||
y="0"
|
||||
x="121" />
|
||||
<rect
|
||||
height="30"
|
||||
width="3"
|
||||
id="barcode_bar69"
|
||||
y="0"
|
||||
x="124" />
|
||||
<rect
|
||||
height="30"
|
||||
width="1"
|
||||
id="barcode_bar71"
|
||||
y="0"
|
||||
x="129" />
|
||||
<rect
|
||||
height="30"
|
||||
width="2"
|
||||
id="barcode_bar73"
|
||||
y="0"
|
||||
x="132" />
|
||||
<rect
|
||||
height="30"
|
||||
width="3"
|
||||
id="barcode_bar75"
|
||||
y="0"
|
||||
x="137" />
|
||||
<rect
|
||||
height="30"
|
||||
width="1"
|
||||
id="barcode_bar77"
|
||||
y="0"
|
||||
x="141" />
|
||||
<rect
|
||||
height="30"
|
||||
width="2"
|
||||
id="barcode_bar79"
|
||||
y="0"
|
||||
x="143" />
|
||||
</g>
|
||||
<path
|
||||
style="opacity:1;fill:#909090;fill-opacity:1;stroke:none;stroke-width:3.77952766;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
|
||||
d="m 70.571074,49.426148 13.564447,-4.240079 v 1.200393 l -13.564447,4.240079 z"
|
||||
id="rect1172"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccccc" />
|
||||
<path
|
||||
sodipodi:nodetypes="ccccc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path1175"
|
||||
d="m 70.571074,52.426148 13.564447,-4.240079 v 1.200393 l -13.564447,4.240079 z"
|
||||
style="opacity:1;fill:#909090;fill-opacity:1;stroke:none;stroke-width:3.77952766;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
|
||||
<path
|
||||
style="opacity:1;fill:#909090;fill-opacity:1;stroke:none;stroke-width:3.77952766;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
|
||||
d="m 70.571074,55.426148 13.564447,-4.240079 v 1.200393 l -13.564447,4.240079 z"
|
||||
id="path1177"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccccc" />
|
||||
</svg>
|
After Width: | Height: | Size: 14 KiB |
@ -0,0 +1,74 @@
|
||||
/*
|
||||
* 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();
|
||||
centerMapOnPackage();
|
||||
} else {
|
||||
console.log("maplibre-gl not supported, disabling map");
|
||||
$("#mapbox").css("display", "none");
|
||||
}
|
||||
}
|
||||
|
||||
function centerMapOnPackage() {
|
||||
var latitude = $("#mapbox").data("latitude");
|
||||
var longitude = $("#mapbox").data("longitude");
|
||||
var accurate = $("#mapbox").data("accurate") == "true";
|
||||
|
||||
map.removeMarkers();
|
||||
map.addMarker(latitude, longitude);
|
||||
map.animateMapIn(latitude, longitude, (accurate ? 14 : 10));
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroy and re-create the map.
|
||||
* @returns {undefined}
|
||||
*/
|
||||
function reloadMap() {
|
||||
try {
|
||||
if (map != null && typeof map != 'undefined') {
|
||||
map.off();
|
||||
map.remove();
|
||||
map = null;
|
||||
|
||||
if (document.getElementById("mapbox") != null) {
|
||||
createMap();
|
||||
} else {
|
||||
console.log("Info", "Not re-creating map because #mapbox is not in DOM. Creation will be automatically triggered when map page is loaded.");
|
||||
}
|
||||
} 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 = 10;
|
||||
}
|
||||
if (typeof heading == 'undefined') {
|
||||
heading = 0;
|
||||
}
|
||||
map.animateMapIn(latitude, longitude, zoom, heading);
|
||||
}
|
@ -0,0 +1,86 @@
|
||||
/*
|
||||
* 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";
|
||||
if ($("#app").hasClass("theme-dark")) {
|
||||
theme = "libertydark";
|
||||
}
|
||||
|
||||
$("#mapbox").css("background-color", SETTINGS.maptileurls[theme].bgcolor);
|
||||
|
||||
var map = new mapboxgl.Map({
|
||||
container: 'mapbox',
|
||||
style: SETTINGS.maptileurls[theme].json,
|
||||
//attributionControl: false,
|
||||
interactive: false,
|
||||
pitch: 0,
|
||||
zoom: 1,
|
||||
maxZoom: 14,
|
||||
center: [-97, 38]
|
||||
});
|
||||
|
||||
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 = "package-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;
|
||||
}
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue