├── .gitignore ├── assets ├── libs │ ├── jsonSearch │ │ ├── chosen │ │ │ ├── chosen-sprite.png │ │ │ ├── chosen-sprite@2x.png │ │ │ ├── docsupport │ │ │ │ ├── chosen.png │ │ │ │ ├── oss-credit.png │ │ │ │ ├── prism.css │ │ │ │ ├── event.simulate.js │ │ │ │ ├── prism.js │ │ │ │ └── style.css │ │ │ ├── bower.json │ │ │ ├── package.json │ │ │ ├── chosen.min.css │ │ │ ├── options.html │ │ │ ├── chosen.css │ │ │ ├── chosen.jquery.min.js │ │ │ └── chosen.proto.min.js │ │ ├── json │ │ │ └── layers.json │ │ ├── layers.js │ │ └── layerSearch.js │ ├── print-export │ │ ├── north_arrow.svg │ │ ├── css │ │ │ └── app.css │ │ └── libs │ │ │ ├── canvas-to-blob.min.js │ │ │ └── FileSaver.min.js │ ├── progress-bar │ │ ├── progress.css │ │ └── progress.js │ ├── layerTree │ │ ├── layer-tree-group-settings.css │ │ └── styles.min.css │ └── geocoder │ │ └── mapbox-gl-geocoder.css ├── json │ ├── eyes.json │ ├── eyes2.json │ ├── water.json │ ├── mouth.json │ ├── water2.json │ ├── mouth2.json │ ├── monster.json │ ├── octo.json │ └── test.json ├── images │ ├── icons │ │ └── layer-stack-15.svg │ └── logos │ │ ├── favicon.svg │ │ └── globe-africa-solid.svg ├── css │ ├── text-editor-style.css │ └── styles-custom.css └── js │ └── print.js ├── LICENSE └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | Thumbs.db 2 | .DS_Store -------------------------------------------------------------------------------- /assets/libs/jsonSearch/chosen/chosen-sprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/portofportlandgis/portmap/HEAD/assets/libs/jsonSearch/chosen/chosen-sprite.png -------------------------------------------------------------------------------- /assets/libs/jsonSearch/chosen/chosen-sprite@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/portofportlandgis/portmap/HEAD/assets/libs/jsonSearch/chosen/chosen-sprite@2x.png -------------------------------------------------------------------------------- /assets/libs/jsonSearch/chosen/docsupport/chosen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/portofportlandgis/portmap/HEAD/assets/libs/jsonSearch/chosen/docsupport/chosen.png -------------------------------------------------------------------------------- /assets/libs/jsonSearch/chosen/docsupport/oss-credit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/portofportlandgis/portmap/HEAD/assets/libs/jsonSearch/chosen/docsupport/oss-credit.png -------------------------------------------------------------------------------- /assets/json/eyes.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "FeatureCollection", 3 | "crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } }, 4 | "features": [ 5 | { "type": "Feature", "properties": { "Id": 0 }, "geometry": { "type": "Point", "coordinates": [ -42.381757078982822, 32.753133895511056 ] } }, 6 | { "type": "Feature", "properties": { "Id": 0 }, "geometry": { "type": "Point", "coordinates": [ -36.599666834815238, 33.324204536910322 ] } } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /assets/libs/print-export/north_arrow.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 9 | northarrow 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /assets/json/eyes2.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "FeatureCollection", 3 | "crs": { 4 | "type": "name", 5 | "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } 6 | }, 7 | "features": [ 8 | { 9 | "type": "Feature", 10 | "properties": {}, 11 | "geometry": { 12 | "type": "Point", 13 | "coordinates": [ 14 | -82.9248046875, 15 | -19.932041306115526 16 | ] 17 | } 18 | }, 19 | { 20 | "type": "Feature", 21 | "properties": {}, 22 | "geometry": { 23 | "type": "Point", 24 | "coordinates": [ 25 | -80.771484375, 26 | -19.68397023588844 27 | ] 28 | } 29 | } 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /assets/libs/progress-bar/progress.css: -------------------------------------------------------------------------------- 1 | 2 | .progress 3 | { 4 | position: fixed; 5 | left: 0px; 6 | top: 0px; 7 | width: 100%; 8 | height: 100%; 9 | z-index: 9999; 10 | background-color: #2f3d44; 11 | } 12 | .bar 13 | { 14 | background-color: #ffffff; 15 | width:0%; 16 | height:7px; 17 | border-radius: 4px; 18 | position: absolute; 19 | margin-top: 50px; 20 | left: 33.3333%; 21 | 22 | } 23 | .percent 24 | { 25 | position:absolute; 26 | display:inline-block; 27 | top:3px; 28 | left:48%; 29 | 30 | } 31 | 32 | .emptybar 33 | { 34 | background-color: #a6a6a6; 35 | width:33%; 36 | height:7px; 37 | border-radius: 4px; 38 | position: absolute; 39 | margin-top: 50px; 40 | left: 33.3333%; 41 | border: solid 1px rgba(255, 255, 255, 0); 42 | 43 | } 44 | 45 | 46 | -------------------------------------------------------------------------------- /assets/libs/jsonSearch/json/layers.json: -------------------------------------------------------------------------------- 1 | { 2 | "Layers": [ 3 | { 4 | "source": "ne_50m_populated_places_simple", 5 | "display_name": "Populated Place", 6 | "name": "populated", 7 | "catagory": "Cultural", 8 | "type": "point" 9 | }, 10 | 11 | { 12 | "source": "ne_110m_admin_0_map_units", 13 | "display_name": "Country", 14 | "name": "country", 15 | "catagory": "Cultural", 16 | "type": "polygon" 17 | }, 18 | 19 | { 20 | "source": "ne_110m_rivers_lake_centerlines", 21 | "display_name": "River", 22 | "name": "river", 23 | "catagory": "Physical", 24 | "type": "line" 25 | }, 26 | 27 | { 28 | "source": "ne_110m_geography_marine_polys", 29 | "display_name": "Ocean", 30 | "name": "ocean", 31 | "catagory": "Physical", 32 | "type": "polygon" 33 | } 34 | ] 35 | } -------------------------------------------------------------------------------- /assets/libs/layerTree/layer-tree-group-settings.css: -------------------------------------------------------------------------------- 1 | 2 | #floor_1, #floor_2, #floor_3 { 3 | display: none; 4 | } 5 | 6 | #room_1, #room_2, #room_3, #room_1_labels, #room_2_labels, #room_3_labels, #airline_gate { 7 | display: none; 8 | } 9 | 10 | #inside_feature_poly_1, #inside_feature_poly_2, #inside_feature_poly_3 { 11 | display: none; 12 | } 13 | 14 | #elevator_1, #elevator_2, #elevator_3 { 15 | display: none; 16 | } 17 | 18 | #door_poly_1, #door_poly_2, #door_poly_3 { 19 | display: none; 20 | } 21 | 22 | #pavement_sections_labels, #pavement_sections { 23 | display: none; 24 | } 25 | 26 | #pdx_far77_label, #pdx_far77, #ttd_far77_label, #ttd_far77, #hio_far77_label, #hio_far77 { 27 | display: none; 28 | } 29 | 30 | #building_poly_labels, #building_poly { 31 | display: none; 32 | } 33 | 34 | #lease_ground_labels, #lease_ground { 35 | display: none; 36 | } 37 | 38 | 39 | -------------------------------------------------------------------------------- /assets/images/icons/layer-stack-15.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 8 | layer-stack-15 9 | 11 | 13 | 15 | 16 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Port of Portland GIS 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /assets/libs/progress-bar/progress.js: -------------------------------------------------------------------------------- 1 | document.onreadystatechange = function(e) 2 | { 3 | if(document.readyState=="interactive") 4 | { 5 | var all = document.getElementsByTagName("*"); 6 | for (var i=0, max=all.length; i < max; i++) 7 | { 8 | set_ele(all[i]); 9 | } 10 | } 11 | } 12 | 13 | function check_element(ele) 14 | { 15 | var all = document.getElementsByTagName("*"); 16 | var totalele=all.length; 17 | var per_inc=33/all.length; 18 | 19 | if($(ele).on()) 20 | { 21 | var prog_width=per_inc+Number(document.getElementById("progress_width").value); 22 | document.getElementById("progress_width").value=prog_width; 23 | $("#bar1").animate({width:prog_width+"%"},10,function(){ 24 | // if(document.getElementById("bar1").style.width=="33%") 25 | // { 26 | 27 | // $(".progress").fadeOut("slow"); 28 | // } 29 | setTimeout(function() { 30 | 31 | $(".progress").fadeOut("slow"); 32 | 33 | }, 6000); 34 | }); 35 | } 36 | 37 | else 38 | { 39 | set_ele(ele); 40 | } 41 | } 42 | 43 | function set_ele(set_element) 44 | { 45 | check_element(set_element); 46 | } -------------------------------------------------------------------------------- /assets/libs/jsonSearch/layers.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function () { 2 | 3 | // Populate the json layer dropdown 4 | var catagory = ""; 5 | var optgroup_count = 0; 6 | 7 | $.getJSON("assets/libs/jsonSearch/json/layers.json", function (obj) { 8 | var $optgroup; 9 | $("#json_layer").append($('')); 10 | $.each(obj.Layers, function (key, value) { 11 | if (value.catagory !== catagory) { 12 | if (optgroup_count > 0) { 13 | $("#json_layer").append($optgroup); 14 | } 15 | $optgroup = $("", { label: value.catagory }); 16 | $optgroup.append($('').val(value.source + "-" + value.type).html(value.display_name)); 17 | catagory = value.catagory; 18 | ++optgroup_count; 19 | } else { 20 | $optgroup.append($('').val(value.source + "-" + value.type).html(value.display_name)); 21 | } 22 | }); 23 | 24 | $("#json_layer").append($optgroup); 25 | 26 | $("#json_layer").chosen({ width: "200px;" }); 27 | 28 | }); 29 | }); -------------------------------------------------------------------------------- /assets/json/water.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "FeatureCollection", 3 | "crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } }, 4 | "features": [ 5 | { "type": "Feature", "properties": { "Id": 0 }, "geometry": { "type": "LineString", "coordinates": [ [ -59.50197901593171, 18.102792482614014 ], [ -57.693588651500697, 18.483506243546859 ], [ -56.836982689401793, 19.625647526345393 ], [ -55.885198287069684, 20.958145689610351 ], [ -53.31538040077298, 18.483506243546859 ], [ -49.127529030511681, 16.960651199815477 ], [ -46.938424905147819, 17.81725716191438 ], [ -45.225212980950019, 20.291896607977872 ], [ -44.083071698151485, 18.578684683780068 ], [ -42.84575197511974, 17.055829640048689 ], [ -40.942183170455515, 16.960651199815477 ], [ -38.467543724392023, 17.341364960748322 ], [ -36.468796479494586, 19.720825966578605 ], [ -35.897725838095312, 20.101539727511451 ], [ -34.089335473664299, 17.531721841214747 ], [ -31.900231348300441, 16.484758998649422 ], [ -30.377376304569061, 16.484758998649422 ], [ -25.999168053841345, 18.388327803313647 ], [ -24.857026771042808, 20.482253488444293 ], [ -23.810063928477483, 18.578684683780068 ], [ -22.382387324979316, 16.960651199815477 ], [ -20.954710721481145, 16.008866797483364 ] ] } } 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /assets/libs/print-export/css/app.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin:0; padding:0; 3 | } 4 | 5 | #map { 6 | position:absolute; 7 | top:0; 8 | bottom:0; 9 | width:100%; 10 | } 11 | 12 | #mapboxgl-ctrl-print { 13 | background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjxzdmcgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMTc5MiAxNzkyIiB3aWR0aD0iMTc5MiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNNDQ4IDE1MzZoODk2di0yNTZoLTg5NnYyNTZ6bTAtNjQwaDg5NnYtMzg0aC0xNjBxLTQwIDAtNjgtMjh0LTI4LTY4di0xNjBoLTY0MHY2NDB6bTExNTIgNjRxMC0yNi0xOS00NXQtNDUtMTktNDUgMTktMTkgNDUgMTkgNDUgNDUgMTkgNDUtMTkgMTktNDV6bTEyOCAwdjQxNnEwIDEzLTkuNSAyMi41dC0yMi41IDkuNWgtMjI0djE2MHEwIDQwLTI4IDY4dC02OCAyOGgtOTYwcS00MCAwLTY4LTI4dC0yOC02OHYtMTYwaC0yMjRxLTEzIDAtMjIuNS05LjV0LTkuNS0yMi41di00MTZxMC03OSA1Ni41LTEzNS41dDEzNS41LTU2LjVoNjR2LTU0NHEwLTQwIDI4LTY4dDY4LTI4aDY3MnE0MCAwIDg4IDIwdDc2IDQ4bDE1MiAxNTJxMjggMjggNDggNzZ0MjAgODh2MjU2aDY0cTc5IDAgMTM1LjUgNTYuNXQ1Ni41IDEzNS41eiIvPjwvc3ZnPg==); 14 | background-size: 20px; 15 | background-repeat: no-repeat; 16 | background-position: center; 17 | vertical-align: middle; 18 | } 19 | 20 | .radio-groups { 21 | text-align: center; 22 | } 23 | 24 | .form-horizontal .control-label { 25 | text-align: left; 26 | } -------------------------------------------------------------------------------- /assets/libs/jsonSearch/chosen/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "chosen", 3 | "description": "Chosen is a JavaScript plugin that makes select boxes user-friendly. It is currently available in both jQuery and Prototype flavors.", 4 | "keywords": [ 5 | "select", 6 | "multiselect", 7 | "dropdown", 8 | "form", 9 | "input", 10 | "ui" 11 | ], 12 | "homepage": "https://harvesthq.github.io/chosen/", 13 | "license": "https://github.com/harvesthq/chosen/blob/master/LICENSE.md", 14 | "authors": [ 15 | { 16 | "name": "Patrick Filler", 17 | "url": "https://github.com/pfiller" 18 | }, 19 | { 20 | "name": "Christophe Coevoet", 21 | "url": "https://github.com/stof" 22 | }, 23 | { 24 | "name": "Ken Earley", 25 | "url": "https://github.com/kenearley" 26 | }, 27 | { 28 | "name": "Koen Punt", 29 | "url": "https://github.com/koenpunt" 30 | } 31 | ], 32 | "dependencies": { 33 | "jquery": ">=1.4.4" 34 | }, 35 | "main": [ 36 | "chosen.jquery.js", 37 | "chosen.css", 38 | "chosen-sprite@2x.png", 39 | "chosen-sprite.png" 40 | ], 41 | "ignore": [], 42 | "repository": { 43 | "type": "git", 44 | "url": "https://github.com/harvesthq/chosen.git" 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /assets/libs/jsonSearch/chosen/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "chosen-js", 3 | "version": "1.6.3", 4 | "description": "Chosen is a JavaScript plugin that makes select boxes user-friendly. It is currently available in both jQuery and Prototype flavors.", 5 | "keywords": [ 6 | "select", 7 | "multiselect", 8 | "dropdown", 9 | "form", 10 | "input", 11 | "ui" 12 | ], 13 | "homepage": "https://harvesthq.github.io/chosen/", 14 | "bugs": "https://github.com/harvesthq/chosen/issues", 15 | "license": "MIT", 16 | "contributors": [ 17 | { 18 | "name": "Patrick Filler", 19 | "url": "https://github.com/pfiller" 20 | }, 21 | { 22 | "name": "Christophe Coevoet", 23 | "url": "https://github.com/stof" 24 | }, 25 | { 26 | "name": "Ken Earley", 27 | "url": "https://github.com/kenearley" 28 | }, 29 | { 30 | "name": "Koen Punt", 31 | "url": "https://github.com/koenpunt" 32 | } 33 | ], 34 | "dependencies": { 35 | "jquery": ">=1.4.4" 36 | }, 37 | "files": [ 38 | "chosen.jquery.js", 39 | "chosen.css", 40 | "chosen-sprite@2x.png", 41 | "chosen-sprite.png" 42 | ], 43 | "main": "chosen.jquery.js", 44 | "repository": { 45 | "type": "git", 46 | "url": "https://github.com/harvesthq/chosen.git" 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /assets/images/logos/favicon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/libs/print-export/libs/canvas-to-blob.min.js: -------------------------------------------------------------------------------- 1 | !function (t) { "use strict"; var e = t.HTMLCanvasElement && t.HTMLCanvasElement.prototype, o = t.Blob && function () { try { return Boolean(new Blob) } catch (t) { return !1 } }(), n = o && t.Uint8Array && function () { try { return 100 === new Blob([new Uint8Array(100)]).size } catch (t) { return !1 } }(), r = t.BlobBuilder || t.WebKitBlobBuilder || t.MozBlobBuilder || t.MSBlobBuilder, a = /^data:((.*?)(;charset=.*?)?)(;base64)?,/, i = (o || r) && t.atob && t.ArrayBuffer && t.Uint8Array && function (t) { var e, i, l, u, c, f, b, d, B; if (!(e = t.match(a))) throw new Error("invalid data URI"); for (i = e[2] ? e[1] : "text/plain" + (e[3] || ";charset=US-ASCII"), l = !!e[4], u = t.slice(e[0].length), c = l ? atob(u) : decodeURIComponent(u), f = new ArrayBuffer(c.length), b = new Uint8Array(f), d = 0; d < c.length; d += 1) b[d] = c.charCodeAt(d); return o ? new Blob([n ? b : f], { type: i }) : ((B = new r).append(f), B.getBlob(i)) }; t.HTMLCanvasElement && !e.toBlob && (e.mozGetAsFile ? e.toBlob = function (t, o, n) { var r = this; setTimeout(function () { t(n && e.toDataURL && i ? i(r.toDataURL(o, n)) : r.mozGetAsFile("blob", o)) }) } : e.toDataURL && i && (e.toBlob = function (t, e, o) { var n = this; setTimeout(function () { t(i(n.toDataURL(e, o))) }) })), "function" == typeof define && define.amd ? define(function () { return i }) : "object" == typeof module && module.exports ? module.exports = i : t.dataURLtoBlob = i }(window); 2 | //# sourceMappingURL=canvas-to-blob.min.js.map -------------------------------------------------------------------------------- /assets/images/logos/globe-africa-solid.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 9 | 18 | 19 | -------------------------------------------------------------------------------- /assets/json/mouth.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "FeatureCollection", 3 | "crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } }, 4 | "features": [ 5 | { "type": "Feature", "properties": { "Id": 0 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -43.867492531023174, 22.819360088370786 ], [ -43.620028586416822, 24.228001003822328 ], [ -43.029922256970906, 23.428502105863345 ], [ -42.592101431898129, 24.266072379915613 ], [ -41.925852350265757, 23.142966785163708 ], [ -41.126353452306773, 24.056679811402546 ], [ -40.859853819653779, 23.047788344930495 ], [ -40.25071180216122, 23.847287242889479 ], [ -39.946140793414941, 22.819360088370786 ], [ -39.08953483131603, 23.733073114609624 ], [ -38.670749694289896, 22.819360088370786 ], [ -37.85221510828427, 23.561751922189842 ], [ -37.395358595164907, 22.590931831811076 ], [ -37.033680522278701, 23.599823298283127 ], [ -36.500681256972712, 22.952609904697283 ], [ -36.25321731236636, 22.038896878458445 ], [ -36.748145201579064, 21.410719172919244 ], [ -37.490537035398063, 21.353612108779316 ], [ -38.194857493123834, 21.563004677292383 ], [ -38.765928134523108, 22.038896878458445 ], [ -39.032427767176102, 21.429754860965886 ], [ -39.603498408575376, 21.429754860965886 ], [ -40.307818866301147, 21.524933301199098 ], [ -40.897925195747064, 22.210218070878227 ], [ -41.164424828400058, 21.582040365339026 ], [ -41.64031702956612, 21.505897613152456 ], [ -42.36367317533842, 21.601076053385668 ], [ -42.725351248224626, 22.248289446971512 ], [ -43.201243449390688, 21.696254493618881 ], [ -43.715207026650035, 22.324432199158082 ], [ -43.867492531023174, 22.819360088370786 ] ] ] } } 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /assets/json/water2.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "FeatureCollection", 3 | "crs": { 4 | "type": "name", 5 | "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } 6 | }, 7 | "features": [ 8 | { 9 | "type": "Feature", 10 | "properties": { "Id": 0 }, 11 | "geometry": { 12 | "type": "LineString", 13 | "coordinates": [ 14 | [ 15 | -91.8017578125, 16 | -28.1882436418503 17 | ], 18 | [ 19 | -89.912109375, 20 | -27.137368359795584 21 | ], 22 | [ 23 | -88.6376953125, 24 | -27.644606381943312 25 | ], 26 | [ 27 | -86.30859375, 28 | -26.31311263768267 29 | ], 30 | [ 31 | -85.6494140625, 32 | -27.098253906137884 33 | ], 34 | [ 35 | -83.5400390625, 36 | -26.194876675795218 37 | ], 38 | [ 39 | -82.3974609375, 40 | -27.019984007982554 41 | ], 42 | [ 43 | -80.85937499999999, 44 | -26.35249785815401 45 | ], 46 | [ 47 | -79.1455078125, 48 | -27.019984007982554 49 | ], 50 | [ 51 | -78.134765625, 52 | -26.07652055985696 53 | ], 54 | [ 55 | -75.498046875, 56 | -26.667095801104804 57 | ], 58 | [ 59 | -73.6962890625, 60 | -25.878994400196202 61 | ], 62 | [ 63 | -72.6416015625, 64 | -26.588527147308614 65 | ] 66 | ] 67 | } 68 | } 69 | ] 70 | } 71 | -------------------------------------------------------------------------------- /assets/libs/jsonSearch/chosen/docsupport/prism.css: -------------------------------------------------------------------------------- 1 | /** 2 | * okaidia theme for JavaScript, CSS and HTML 3 | * Loosely based on Monokai textmate theme by http://www.monokai.nl/ 4 | * @author ocodia 5 | */ 6 | 7 | code[class*="language-"], 8 | pre[class*="language-"] { 9 | color: #f8f8f2; 10 | text-shadow: 0 1px rgba(0,0,0,0.3); 11 | font-family: Consolas, Monaco, 'Andale Mono', monospace; 12 | direction: ltr; 13 | text-align: left; 14 | white-space: pre; 15 | word-spacing: normal; 16 | 17 | -moz-tab-size: 4; 18 | -o-tab-size: 4; 19 | tab-size: 4; 20 | 21 | -webkit-hyphens: none; 22 | -moz-hyphens: none; 23 | -ms-hyphens: none; 24 | hyphens: none; 25 | } 26 | 27 | /* Code blocks */ 28 | pre[class*="language-"] { 29 | padding: 1em; 30 | margin: .5em 0; 31 | overflow: auto; 32 | border-radius: 0.3em; 33 | } 34 | 35 | :not(pre) > code[class*="language-"], 36 | pre[class*="language-"] { 37 | background: #272822; 38 | } 39 | 40 | /* Inline code */ 41 | :not(pre) > code[class*="language-"] { 42 | padding: .1em; 43 | border-radius: .3em; 44 | } 45 | 46 | .token.comment, 47 | .token.prolog, 48 | .token.doctype, 49 | .token.cdata { 50 | color: slategray; 51 | } 52 | 53 | .token.punctuation { 54 | color: #f8f8f2; 55 | } 56 | 57 | .namespace { 58 | opacity: .7; 59 | } 60 | 61 | .token.property, 62 | .token.tag { 63 | color: #f92672; 64 | } 65 | 66 | .token.boolean, 67 | .token.number{ 68 | color: #ae81ff; 69 | } 70 | 71 | .token.selector, 72 | .token.attr-name, 73 | .token.string { 74 | color: #a6e22e; 75 | } 76 | 77 | 78 | .token.operator, 79 | .token.entity, 80 | .token.url, 81 | .language-css .token.string, 82 | .style .token.string { 83 | color: #f8f8f2; 84 | } 85 | 86 | .token.atrule, 87 | .token.attr-value 88 | { 89 | color: #e6db74; 90 | } 91 | 92 | 93 | .token.keyword{ 94 | color: #66d9ef; 95 | } 96 | 97 | .token.regex, 98 | .token.important { 99 | color: #fd971f; 100 | } 101 | 102 | .token.important { 103 | font-weight: bold; 104 | } 105 | 106 | .token.entity { 107 | cursor: help; 108 | } 109 | -------------------------------------------------------------------------------- /assets/libs/layerTree/styles.min.css: -------------------------------------------------------------------------------- 1 | .ui-sortable-handle { 2 | -ms-touch-action: none; 3 | touch-action: none; 4 | } 5 | 6 | .mapboxgl-ctrl.legend-container { 7 | display: none; 8 | width: auto; 9 | height: auto; 10 | pointer-events: auto; 11 | margin: 0; 12 | float: none; 13 | } 14 | 15 | #mapboxgl-legend { 16 | padding: 5px; 17 | } 18 | 19 | .layer-directory .directory-name { 20 | font-size: 12px; 21 | font-weight: 600; 22 | padding: 5px; 23 | } 24 | 25 | .layer-directory .layer-item { 26 | font-size: 11px; 27 | font-weight: 500; 28 | padding: 3px 6px 2px 15px; 29 | } 30 | 31 | .layer-item input { 32 | margin-right: 5px; 33 | margin-top: 2px; 34 | } 35 | 36 | .layer-item.ghost { 37 | color: #d3d3d3; 38 | } 39 | 40 | .layer-item span.name { 41 | margin-left: 5px; 42 | } 43 | 44 | .child-layer > img, .layer-item > img { 45 | height: 12px; 46 | width: 12px; 47 | } 48 | 49 | .child-layer { 50 | padding-left: 30px; 51 | padding-bottom: 3px; 52 | font-size: 11px; 53 | } 54 | 55 | .child-layer span.child-name { 56 | padding-left: 5px; 57 | } 58 | 59 | .grb { 60 | cursor: move; 61 | cursor: grab; 62 | cursor: -moz-grab; 63 | cursor: -webkit-grab; 64 | } 65 | 66 | .grb:active { 67 | cursor: grabbing; 68 | cursor: -moz-grabbing; 69 | cursor: -webkit-grabbing; 70 | } 71 | 72 | .geojson-polygon:before { 73 | content: "\f0c8"; 74 | } 75 | 76 | .geojson-circle:before { 77 | content: "\f111"; 78 | } 79 | 80 | .geojson-line-solid:before { 81 | content: "\f068"; 82 | } 83 | 84 | .geojson-line-dashed:before { 85 | content: "\f141"; 86 | } 87 | 88 | .toggle-directory-close, .toggle-directory-open { 89 | float: left; 90 | margin-right: 5px; 91 | margin-top: 2px; 92 | } 93 | 94 | .toggle-directory-open:before { 95 | content: "\f07c"; 96 | } 97 | 98 | .toggle-directory-close:before { 99 | content: "\f07b"; 100 | } 101 | -------------------------------------------------------------------------------- /assets/libs/jsonSearch/chosen/docsupport/event.simulate.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Event.simulate(@element, eventName[, options]) -> Element 3 | * 4 | * - @element: element to fire event on 5 | * - eventName: name of event to fire (only MouseEvents and HTMLEvents interfaces are supported) 6 | * - options: optional object to fine-tune event properties - pointerX, pointerY, ctrlKey, etc. 7 | * 8 | * $('foo').simulate('click'); // => fires "click" event on an element with id=foo 9 | * 10 | **/ 11 | (function(){ 12 | 13 | var eventMatchers = { 14 | 'HTMLEvents': /^(?:load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll)$/, 15 | 'MouseEvents': /^(?:click|dblclick|mouse(?:down|up|over|move|out))$/ 16 | } 17 | var defaultOptions = { 18 | pointerX: 0, 19 | pointerY: 0, 20 | button: 0, 21 | ctrlKey: false, 22 | altKey: false, 23 | shiftKey: false, 24 | metaKey: false, 25 | bubbles: true, 26 | cancelable: true 27 | } 28 | 29 | Event.simulate = function(element, eventName) { 30 | var options = Object.extend(Object.clone(defaultOptions), arguments[2] || { }); 31 | var oEvent, eventType = null; 32 | 33 | element = $(element); 34 | 35 | for (var name in eventMatchers) { 36 | if (eventMatchers[name].test(eventName)) { eventType = name; break; } 37 | } 38 | 39 | if (!eventType) 40 | throw new SyntaxError('Only HTMLEvents and MouseEvents interfaces are supported'); 41 | 42 | if (document.createEvent) { 43 | oEvent = document.createEvent(eventType); 44 | if (eventType == 'HTMLEvents') { 45 | oEvent.initEvent(eventName, options.bubbles, options.cancelable); 46 | } 47 | else { 48 | oEvent.initMouseEvent(eventName, options.bubbles, options.cancelable, document.defaultView, 49 | options.button, options.pointerX, options.pointerY, options.pointerX, options.pointerY, 50 | options.ctrlKey, options.altKey, options.shiftKey, options.metaKey, options.button, element); 51 | } 52 | element.dispatchEvent(oEvent); 53 | } 54 | else { 55 | options.clientX = options.pointerX; 56 | options.clientY = options.pointerY; 57 | oEvent = Object.extend(document.createEventObject(), options); 58 | element.fireEvent('on' + eventName, oEvent); 59 | } 60 | return element; 61 | } 62 | 63 | Element.addMethods({ simulate: Event.simulate }); 64 | })(); -------------------------------------------------------------------------------- /assets/libs/print-export/libs/FileSaver.min.js: -------------------------------------------------------------------------------- 1 | /*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */ 2 | var saveAs = saveAs || function (e) { "use strict"; if (typeof e === "undefined" || typeof navigator !== "undefined" && /MSIE [1-9]\./.test(navigator.userAgent)) { return } var t = e.document, n = function () { return e.URL || e.webkitURL || e }, r = t.createElementNS("http://www.w3.org/1999/xhtml", "a"), o = "download" in r, a = function (e) { var t = new MouseEvent("click"); e.dispatchEvent(t) }, i = /constructor/i.test(e.HTMLElement) || e.safari, f = /CriOS\/[\d]+/.test(navigator.userAgent), u = function (t) { (e.setImmediate || e.setTimeout)(function () { throw t }, 0) }, s = "application/octet-stream", d = 1e3 * 40, c = function (e) { var t = function () { if (typeof e === "string") { n().revokeObjectURL(e) } else { e.remove() } }; setTimeout(t, d) }, l = function (e, t, n) { t = [].concat(t); var r = t.length; while (r--) { var o = e["on" + t[r]]; if (typeof o === "function") { try { o.call(e, n || e) } catch (a) { u(a) } } } }, p = function (e) { if (/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)) { return new Blob([String.fromCharCode(65279), e], { type: e.type }) } return e }, v = function (t, u, d) { if (!d) { t = p(t) } var v = this, w = t.type, m = w === s, y, h = function () { l(v, "writestart progress write writeend".split(" ")) }, S = function () { if ((f || m && i) && e.FileReader) { var r = new FileReader; r.onloadend = function () { var t = f ? r.result : r.result.replace(/^data:[^;]*;/, "data:attachment/file;"); var n = e.open(t, "_blank"); if (!n) e.location.href = t; t = undefined; v.readyState = v.DONE; h() }; r.readAsDataURL(t); v.readyState = v.INIT; return } if (!y) { y = n().createObjectURL(t) } if (m) { e.location.href = y } else { var o = e.open(y, "_blank"); if (!o) { e.location.href = y } } v.readyState = v.DONE; h(); c(y) }; v.readyState = v.INIT; if (o) { y = n().createObjectURL(t); setTimeout(function () { r.href = y; r.download = u; a(r); h(); c(y); v.readyState = v.DONE }); return } S() }, w = v.prototype, m = function (e, t, n) { return new v(e, t || e.name || "download", n) }; if (typeof navigator !== "undefined" && navigator.msSaveOrOpenBlob) { return function (e, t, n) { t = t || e.name || "download"; if (!n) { e = p(e) } return navigator.msSaveOrOpenBlob(e, t) } } w.abort = function () { }; w.readyState = w.INIT = 0; w.WRITING = 1; w.DONE = 2; w.error = w.onwritestart = w.onprogress = w.onwrite = w.onabort = w.onerror = w.onwriteend = null; return m }(typeof self !== "undefined" && self || typeof window !== "undefined" && window || this.content); if (typeof module !== "undefined" && module.exports) { module.exports.saveAs = saveAs } else if (typeof define !== "undefined" && define !== null && define.amd !== null) { define("FileSaver.js", function () { return saveAs }) } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PortMap 2 | A responsive web map application template using [Bootstrap](https://getbootstrap.com/) and [Mapbox GL](https://www.mapbox.com/mapbox-gl-js/api/) 3 | 4 | To get started you need to generate a Mapbox ID. Get your ID by creating a Mapbox account. Insert your Mapbox ID in assets/js/map.js on line 1. 5 | 6 | ## What it does: 7 | * Layer tree allows the user to interactively organize and reposition map layers using [Mapbox-GL-JS-Layer-Tree](https://github.com/TheGartrellGroup/Mapbox-GL-JS-Layer-Tree) 8 | * Layer Tree pulls feature symbology automatically via [Font Awesome](http://fontawesome.io/ ) 9 | * Supports drawing and editing using [Mapbox Draw API](https://github.com/mapbox/mapbox-gl-draw) 10 | * User can calculate area and length of drawn features using [Mapbox Turf](https://www.mapbox.com/help/define-turf/) 11 | * User can add labels directly to the map as a symbol layer using [Mapbox-GL-JS-Text-Markup](https://github.com/TheGartrellGroup/Mapbox-GL-JS-Text-Markup) 12 | * User can easily find latitude and longitude by clicking on the map 13 | * Global address search using the [mapbox-gl-geocoder](https://github.com/mapbox/mapbox-gl-geocoder) 14 | * Search JSON Properties with autocomplete and zoom to feature 15 | * Client side Print Export to PNG or PDF with legend: [Print/Export for Mapbox GL](https://github.com/TheGartrellGroup/Mapbox-GL-Print-Export-For-Port) 16 | * Identify multiple features and view attributes in a modal 17 | * Bookmark drop-down list 18 | * Disclaimer modal 19 | * Scale bar 20 | * Not included in this repo: Save Views function allows the user to save Layer Tree configuration, Mapbox drawn features, Text Markups, and Zoom and Pitch. All plugins in this repo have code pre-built to work with the Save Views plugin: [Mapbox-GL-JS-save-view](https://github.com/TheGartrellGroup/Mapbox-GL-JS-save-view) 21 | 22 | 23 | ## Tutorial: 24 | 25 | I created a [Tutorial](https://opensource.portofportland.io/portmap-tutorial.html) that shows you how to add data to PortMap, and make that data interactive. 26 | 27 | ## Quick Preview: 28 | 29 | ### Layer Tree 30 | ![layers](https://user-images.githubusercontent.com/17071327/114205473-2e94e080-990f-11eb-8ad0-64ace1f12af5.png) 31 | 32 | ### Identify Features 33 | ![identify](https://user-images.githubusercontent.com/17071327/114205484-30f73a80-990f-11eb-90f5-069a8e469fa4.png) 34 | 35 | ### Draw and Text 36 | ![draw](https://user-images.githubusercontent.com/17071327/114205491-32286780-990f-11eb-91e5-b4cb8d33bc8c.png) 37 | 38 | ### Search JSON with autocomplete 39 | ![search](https://user-images.githubusercontent.com/17071327/114205518-38b6df00-990f-11eb-88ba-1070afdd4f4b.png) 40 | 41 | ### Client Side Printing 42 | ![print](https://user-images.githubusercontent.com/17071327/114205528-3a80a280-990f-11eb-9586-afdbe6a943d7.png) 43 | 44 | ### Location Tools 45 | ![mobile](https://user-images.githubusercontent.com/17071327/114205505-348ac180-990f-11eb-8735-e084c86a7454.png) 46 | 47 | -------------------------------------------------------------------------------- /assets/css/text-editor-style.css: -------------------------------------------------------------------------------- 1 | /* 'input' styling */ 2 | .label-marker { 3 | display: block; 4 | position: relative; 5 | min-height: 20px; 6 | /* modify with regards to text limit */ 7 | max-width: 180px; 8 | padding: 5px; 9 | border-radius: 3px; 10 | overflow: hidden; 11 | white-space: nowrap; 12 | text-overflow: ellipsis; 13 | text-align: center; 14 | background-color: transparent; 15 | -webkit-appearance: textarea; 16 | -moz-appearance: textarea; 17 | appearance: textarea; 18 | } 19 | /* container class added when editable */ 20 | .label-marker.label-container { 21 | min-height: 40px; 22 | display: flex; 23 | display: -webkit-flex; 24 | -webkit-align-items: center; 25 | align-items: center; 26 | text-decoration: none !important; 27 | } 28 | 29 | .label-marker.active, 30 | .label-marker:focus, 31 | .label-marker.label-container.active { 32 | background-color: rgba(255,255,255,0.90); 33 | } 34 | /* hide chromes blue outline on inputs */ 35 | .label-marker.active, 36 | .label-marker:focus, 37 | .label-marker.label-container.active, 38 | .label-marker.label-container .marker-text-child:active, 39 | .label-marker.label-container .marker-text-child:focus { 40 | outline: none !important; 41 | } 42 | /* editable input */ 43 | span.marker-text-child { 44 | margin: auto; 45 | } 46 | /* icon for dragging labels */ 47 | .drag-icon { 48 | padding: 8px; 49 | float: left !important; 50 | cursor: move; 51 | } 52 | 53 | #textTool, #editTextTool { 54 | /* right: 10px; */ 55 | /* height: 25px; */ 56 | /* width: 120px; */ 57 | /* padding: 5px; */ 58 | padding: 5px 10px 5px 5px; 59 | } 60 | 61 | #textTool { 62 | top: 60px; 63 | } 64 | 65 | #editTextTool { 66 | top: 105px; 67 | } 68 | 69 | #textTool[active='true'], 70 | #editTextTool[active='true'] { 71 | background-color: #e4e4e4;; 72 | /* color: #e8e8e8; 73 | border: 1px solid rgb(74, 74, 74); */ 74 | } 75 | 76 | #textTool, #editTextTool, #customTextPalette { 77 | background: #ffffff; 78 | z-index: 1; 79 | border-radius: 4px; 80 | border: 1px solid rgb(208, 208, 208); 81 | margin-right: 10px; 82 | font-size: 12px; 83 | } 84 | 85 | #customTextPalette { 86 | top: 165px; 87 | right: 10px; 88 | padding: 5px; 89 | } 90 | 91 | .font-size-change, .font-color-change { 92 | display: inline-block; 93 | } 94 | 95 | .font-size-change:hover, .font-color-change:hover { 96 | cursor: pointer !important; 97 | } 98 | 99 | .font-size-change { 100 | padding: 0px 8px 0px 0px; 101 | } 102 | 103 | .font-color-change { 104 | height: 18px; 105 | width: 18px; 106 | border-radius: 0px; 107 | margin: 0 0 0 2px; 108 | } 109 | -------------------------------------------------------------------------------- /assets/json/mouth2.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "FeatureCollection", 3 | "crs": { 4 | "type": "name", 5 | "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } 6 | }, 7 | "features": [ 8 | { 9 | "type": "Feature", 10 | "properties": { "Id": 0 }, 11 | "geometry": { 12 | "type": "Polygon", 13 | "coordinates": [ 14 | [ 15 | [ 16 | -78.8818359375, 17 | -21.667638606781576 18 | ], 19 | [ 20 | -78.8818359375, 21 | -21.504185500778405 22 | ], 23 | [ 24 | -82.452392578125, 25 | -22.684984142872096 26 | ], 27 | [ 28 | -82.562255859375, 29 | -22.786310789104277 30 | ], 31 | [ 32 | -78.958740234375, 33 | -23.433009077420344 34 | ], 35 | [ 36 | -79.013671875, 37 | -23.29181053244191 38 | ], 39 | [ 40 | -79.21142578125, 41 | -22.907803451058378 42 | ], 43 | [ 44 | -79.62890625, 45 | -23.180763583129433 46 | ], 47 | [ 48 | -79.837646484375, 49 | -22.776181505086505 50 | ], 51 | [ 52 | -80.13427734374999, 53 | -23.089838367476705 54 | ], 55 | [ 56 | -80.35400390625, 57 | -22.684984142872096 58 | ], 59 | [ 60 | -80.83740234375, 61 | -22.98873816096073 62 | ], 63 | [ 64 | -80.947265625, 65 | -22.695120184965685 66 | ], 67 | [ 68 | -81.34277343749999, 69 | -22.87744046489713 70 | ], 71 | [ 72 | -82.177734375, 73 | -22.745789142425874 74 | ], 75 | [ 76 | -81.474609375, 77 | -22.50240745949774 78 | ], 79 | [ 80 | -81.298828125, 81 | -22.664709810176813 82 | ], 83 | [ 84 | -81.05712890625, 85 | -22.37039634432004 86 | ], 87 | [ 88 | -80.518798828125, 89 | -22.471954507739213 90 | ], 91 | [ 92 | -80.18920898437499, 93 | -22.085639901650328 94 | ], 95 | [ 96 | -79.65087890624999, 97 | -22.37039634432004 98 | ], 99 | [ 100 | -79.541015625, 101 | -21.902277966668624 102 | ], 103 | [ 104 | -78.98071289062499, 105 | -22.044913300245675 106 | ], 107 | [ 108 | -78.8818359375, 109 | -21.667638606781576 110 | ] 111 | ] 112 | ] 113 | } 114 | } 115 | ] 116 | } 117 | -------------------------------------------------------------------------------- /assets/json/monster.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "FeatureCollection", 3 | "crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } }, 4 | "features": [ 5 | { "type": "Feature", "properties": { "Id": 0 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -49.12752903051171, 16.960651199815572 ], [ -48.151950018121283, 19.708928661549578 ], [ -48.330409593558556, 22.064595057321412 ], [ -47.592776681751161, 24.015753082102265 ], [ -47.66416051192607, 25.157894364900812 ], [ -48.377998813675163, 25.800348836474996 ], [ -50.448129888747417, 25.943116496824814 ], [ -54.017321397492879, 26.514187138224088 ], [ -55.7305333216907, 27.799096081372454 ], [ -56.372987793264883, 29.797843326269913 ], [ -57.943432057112886, 30.654449288368824 ], [ -58.728654189036888, 32.510428872916464 ], [ -58.657270358861979, 34.152256966939376 ], [ -57.65789673641325, 35.437165910087742 ], [ -57.515129076063431, 33.866721646239739 ], [ -57.443745245888522, 32.367661212566645 ], [ -56.230220132915065, 31.511055250467734 ], [ -55.088078850116517, 31.725206740992462 ], [ -55.302230340641245, 33.224267174665556 ], [ -56.016068642390337, 34.080873136764467 ], [ -56.301603963089974, 35.437165910087742 ], [ -55.944684812215428, 36.151004211836835 ], [ -53.731786076793242, 34.509176117813922 ], [ -53.731786076793242, 33.081499514315738 ], [ -53.731786076793242, 31.296903759943007 ], [ -54.302856718192515, 30.297530137494277 ], [ -54.302856718192515, 29.869227156444822 ], [ -53.374866925918695, 28.584318213296456 ], [ -52.304109473295057, 27.656328421022636 ], [ -49.662907756823415, 27.442176930497908 ], [ -48.235231153325344, 27.442176930497908 ], [ -47.378625191226433, 27.656328421022636 ], [ -45.165726455804247, 27.656328421022636 ], [ -43.381130701431573, 27.799096081372454 ], [ -43.309746871256664, 29.012621194345911 ], [ -43.381130701431573, 30.725833118543733 ], [ -44.808807304929701, 31.93935823151719 ], [ -44.951574965279519, 32.938731853965919 ], [ -42.810060060032299, 34.437792287639013 ], [ -40.739928984959931, 34.72332760833865 ], [ -39.88332302286102, 32.653196533266282 ], [ -41.168231966009387, 31.082752269418279 ], [ -41.453767286709024, 29.226772684870639 ], [ -41.667918777233751, 28.298782892596819 ], [ -40.811312815134841, 26.871106289098634 ], [ -38.527030249537745, 27.085257779623362 ], [ -37.813191947788653, 28.441550552946637 ], [ -38.02734343831338, 30.226146307319368 ], [ -38.527030249537745, 31.653822910817553 ], [ -38.883949400412291, 32.724580363441191 ], [ -38.812565570237382, 34.009489306589558 ], [ -36.671050664990105, 35.223014419563015 ], [ -34.743687250267556, 34.72332760833865 ], [ -34.029848948518463, 33.438418665190284 ], [ -34.957838740792283, 32.082125891867008 ], [ -36.242747683940649, 31.225519929768097 ], [ -36.528283004640286, 29.298156515045548 ], [ -36.456899174465377, 27.299409270148089 ], [ -36.17136385376574, 25.871732666649905 ], [ -35.600293212366466, 25.086510534725903 ], [ -34.3153842692181, 24.729591383851357 ], [ -32.530788514845483, 24.229904572626992 ], [ -30.460657439773115, 24.301288402801902 ], [ -28.890213175925112, 24.800975214026266 ], [ -27.177001251727347, 25.800348836474996 ], [ -26.177627629278618, 27.584944590847726 ], [ -25.749324648229162, 29.15538885469573 ], [ -26.106243799103709, 30.583065458193914 ], [ -26.820082100852801, 32.439045042741554 ], [ -26.605930610328073, 33.581186325540102 ], [ -24.607183365430615, 34.295024627289195 ], [ -25.321021667179707, 32.581812703091373 ], [ -25.106870176654979, 31.368287590117916 ], [ -24.250264214556069, 30.440297797844096 ], [ -22.822587611057884, 30.797216948718642 ], [ -22.608436120533156, 32.296277382391736 ], [ -22.822587611057884, 33.509802495365193 ], [ -22.180133139483701, 34.080873136764467 ], [ -21.252143347209881, 32.510428872916464 ], [ -21.394911007559699, 30.797216948718642 ], [ -22.108749309308791, 28.869853533996093 ], [ -23.607809742981885, 28.727085873646274 ], [ -25.03548634648007, 27.156641609798271 ], [ -25.677940818054253, 25.728965006300086 ], [ -26.962849761202619, 24.229904572626992 ], [ -29.461283817324386, 23.087763289828445 ], [ -32.173869363970937, 22.302541157904443 ], [ -32.245253194145846, 21.802854346680078 ], [ -32.887707665720029, 20.089642422482427 ], [ -33.744313627818826, 19.233036460383516 ], [ -34.089335473664221, 17.531721841214846 ], [ -35.897725838095255, 20.101539727511579 ], [ -36.468796479494529, 19.72082596657873 ], [ -38.467543724391987, 17.341364960748422 ], [ -40.942183170455507, 16.960651199815572 ], [ -42.845751975119754, 17.055829640048785 ], [ -45.225212980950005, 20.291896607978003 ], [ -46.938424905147826, 17.817257161914483 ], [ -49.12752903051171, 16.960651199815572 ] ] ] } } 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /assets/libs/jsonSearch/chosen/docsupport/prism.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Prism: Lightweight, robust, elegant syntax highlighting 3 | * MIT license http://www.opensource.org/licenses/mit-license.php/ 4 | * @author Lea Verou http://lea.verou.me 5 | */(function(){var e=/\blang(?:uage)?-(?!\*)(\w+)\b/i,t=self.Prism={util:{type:function(e){return Object.prototype.toString.call(e).match(/\[object (\w+)\]/)[1]},clone:function(e){var n=t.util.type(e);switch(n){case"Object":var r={};for(var i in e)e.hasOwnProperty(i)&&(r[i]=t.util.clone(e[i]));return r;case"Array":return e.slice()}return e}},languages:{extend:function(e,n){var r=t.util.clone(t.languages[e]);for(var i in n)r[i]=n[i];return r},insertBefore:function(e,n,r,i){i=i||t.languages;var s=i[e],o={};for(var u in s)if(s.hasOwnProperty(u)){if(u==n)for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);o[u]=s[u]}return i[e]=o},DFS:function(e,n){for(var r in e){n.call(e,r,e[r]);t.util.type(e)==="Object"&&t.languages.DFS(e[r],n)}}},highlightAll:function(e,n){var r=document.querySelectorAll('code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code');for(var i=0,s;s=r[i++];)t.highlightElement(s,e===!0,n)},highlightElement:function(r,i,s){var o,u,a=r;while(a&&!e.test(a.className))a=a.parentNode;if(a){o=(a.className.match(e)||[,""])[1];u=t.languages[o]}if(!u)return;r.className=r.className.replace(e,"").replace(/\s+/g," ")+" language-"+o;a=r.parentNode;/pre/i.test(a.nodeName)&&(a.className=a.className.replace(e,"").replace(/\s+/g," ")+" language-"+o);var f=r.textContent;if(!f)return;f=f.replace(/&/g,"&").replace(/e.length)break e;if(p instanceof i)continue;a.lastIndex=0;var d=a.exec(p);if(d){l&&(c=d[1].length);var v=d.index-1+c,d=d[0].slice(c),m=d.length,g=v+m,y=p.slice(0,v+1),b=p.slice(g+1),w=[h,1];y&&w.push(y);var E=new i(u,f?t.tokenize(d,f):d);w.push(E);b&&w.push(b);Array.prototype.splice.apply(s,w)}}}return s},hooks:{all:{},add:function(e,n){var r=t.hooks.all;r[e]=r[e]||[];r[e].push(n)},run:function(e,n){var r=t.hooks.all[e];if(!r||!r.length)return;for(var i=0,s;s=r[i++];)s(n)}}},n=t.Token=function(e,t){this.type=e;this.content=t};n.stringify=function(e,r,i){if(typeof e=="string")return e;if(Object.prototype.toString.call(e)=="[object Array]")return e.map(function(t){return n.stringify(t,r,e)}).join("");var s={type:e.type,content:n.stringify(e.content,r,i),tag:"span",classes:["token",e.type],attributes:{},language:r,parent:i};s.type=="comment"&&(s.attributes.spellcheck="true");t.hooks.run("wrap",s);var o="";for(var u in s.attributes)o+=u+'="'+(s.attributes[u]||"")+'"';return"<"+s.tag+' class="'+s.classes.join(" ")+'" '+o+">"+s.content+""};if(!self.document){self.addEventListener("message",function(e){var n=JSON.parse(e.data),r=n.language,i=n.code;self.postMessage(JSON.stringify(t.tokenize(i,t.languages[r])));self.close()},!1);return}var r=document.getElementsByTagName("script");r=r[r.length-1];if(r){t.filename=r.src;document.addEventListener&&!r.hasAttribute("data-manual")&&document.addEventListener("DOMContentLoaded",t.highlightAll)}})();; 6 | Prism.languages.markup={comment:/<!--[\w\W]*?-->/g,prolog:/<\?.+?\?>/,doctype:/<!DOCTYPE.+?>/,cdata:/<!\[CDATA\[[\w\W]*?]]>/i,tag:{pattern:/<\/?[\w:-]+\s*(?:\s+[\w:-]+(?:=(?:("|')(\\?[\w\W])*?\1|\w+))?\s*)*\/?>/gi,inside:{tag:{pattern:/^<\/?[\w:-]+/i,inside:{punctuation:/^<\/?/,namespace:/^[\w-]+?:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/gi,inside:{punctuation:/=|>|"/g}},punctuation:/\/?>/g,"attr-name":{pattern:/[\w:-]+/g,inside:{namespace:/^[\w-]+?:/}}}},entity:/&#?[\da-z]{1,8};/gi};Prism.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&/,"&"))});; 7 | Prism.languages.css={comment:/\/\*[\w\W]*?\*\//g,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*{))/gi,inside:{punctuation:/[;:]/g}},url:/url\((["']?).*?\1\)/gi,selector:/[^\{\}\s][^\{\};]*(?=\s*\{)/g,property:/(\b|\B)[\w-]+(?=\s*:)/ig,string:/("|')(\\?.)*?\1/g,important:/\B!important\b/gi,ignore:/&(lt|gt|amp);/gi,punctuation:/[\{\};:]/g};Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{style:{pattern:/(<|<)style[\w\W]*?(>|>)[\w\W]*?(<|<)\/style(>|>)/ig,inside:{tag:{pattern:/(<|<)style[\w\W]*?(>|>)|(<|<)\/style(>|>)/ig,inside:Prism.languages.markup.tag.inside},rest:Prism.languages.css}}});; 8 | Prism.languages.clike={comment:{pattern:/(^|[^\\])(\/\*[\w\W]*?\*\/|(^|[^:])\/\/.*?(\r?\n|$))/g,lookbehind:!0},string:/("|')(\\?.)*?\1/g,"class-name":{pattern:/((?:(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/ig,lookbehind:!0,inside:{punctuation:/(\.|\\)/}},keyword:/\b(if|else|while|do|for|return|in|instanceof|function|new|try|catch|finally|null|break|continue)\b/g,"boolean":/\b(true|false)\b/g,"function":{pattern:/[a-z0-9_]+\(/ig,inside:{punctuation:/\(/}}, number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/g,operator:/[-+]{1,2}|!|<=?|>=?|={1,3}|(&){1,2}|\|?\||\?|\*|\/|\~|\^|\%/g,ignore:/&(lt|gt|amp);/gi,punctuation:/[{}[\];(),.:]/g};; 9 | Prism.languages.javascript=Prism.languages.extend("clike",{keyword:/\b(var|let|if|else|while|do|for|return|in|instanceof|function|new|with|typeof|try|catch|finally|null|break|continue)\b/g,number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?|NaN|-?Infinity)\b/g});Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/g,lookbehind:!0}});Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{script:{pattern:/(<|<)script[\w\W]*?(>|>)[\w\W]*?(<|<)\/script(>|>)/ig,inside:{tag:{pattern:/(<|<)script[\w\W]*?(>|>)|(<|<)\/script(>|>)/ig,inside:Prism.languages.markup.tag.inside},rest:Prism.languages.javascript}}});; 10 | -------------------------------------------------------------------------------- /assets/libs/geocoder/mapbox-gl-geocoder.css: -------------------------------------------------------------------------------- 1 | /* Basics */ 2 | .mapboxgl-ctrl-geocoder, 3 | .mapboxgl-ctrl-geocoder *, 4 | .mapboxgl-ctrl-geocoder *:after, 5 | .mapboxgl-ctrl-geocoder *:before { 6 | -webkit-box-sizing: border-box; 7 | -moz-box-sizing: border-box; 8 | box-sizing: border-box; 9 | } 10 | 11 | .mapboxgl-ctrl-geocoder { 12 | font: 15px/20px 'Helvetica Neue', Arial, Helvetica, sans-serif; 13 | position: relative; 14 | background-color: white; 15 | /*width:33.3333%; 16 | min-width:240px; 17 | max-width:360px;*/ 18 | z-index: 1; 19 | border-radius: 3px; 20 | } 21 | 22 | .mapboxgl-ctrl-geocoder input[type='text'] { 23 | font-size: 12px; 24 | width: 100%; 25 | background-color: rgb(255, 255, 255); 26 | height: 30px; 27 | margin: 0; 28 | color: rgba(0,0,0,.5); 29 | padding: 10px 10px 10px 40px; 30 | text-overflow: ellipsis; 31 | white-space: nowrap; 32 | overflow: hidden; 33 | border: 1px solid rgb(208, 208, 208); 34 | border-radius: 4px; 35 | -webkit-appearance: none; 36 | } 37 | 38 | .mapboxgl-ctrl-geocoder input:focus { 39 | color: rgba(0,0,0,.75); 40 | outline: 0; 41 | box-shadow: none; 42 | outline: thin dotted\8; 43 | } 44 | 45 | .mapboxgl-ctrl-geocoder .geocoder-icon-search { 46 | position: absolute; 47 | top: 5px; 48 | left: 10px; 49 | } 50 | 51 | .mapboxgl-ctrl-geocoder button { 52 | padding: 0; 53 | margin: 0; 54 | background-color: #fff; 55 | border: none; 56 | cursor: pointer; 57 | } 58 | 59 | .mapboxgl-ctrl-geocoder .geocoder-pin-right * { 60 | background-color: #fff; 61 | z-index: 2; 62 | position: absolute; 63 | right: 10px; 64 | top: 5px; 65 | display: none; 66 | } 67 | 68 | .mapboxgl-ctrl-geocoder, 69 | .mapboxgl-ctrl-geocoder ul { 70 | /*box-shadow: 0 0 0 2px rgba(0,0,0,0.1);*/ 71 | } 72 | 73 | /* Suggestions */ 74 | .mapboxgl-ctrl-geocoder ul { 75 | background-color: #fff; 76 | border-radius: 0 0 3px 3px; 77 | left: 0; 78 | list-style: none; 79 | margin: 0; 80 | padding: 0; 81 | position: absolute; 82 | width: 100%; 83 | top: 100%; 84 | z-index: 1000; 85 | overflow: hidden; 86 | font-size: 12px; 87 | border: 1px solid #828282; 88 | border-radius: 4px; 89 | } 90 | 91 | .mapboxgl-ctrl-bottom-left .mapboxgl-ctrl-geocoder ul, 92 | .mapboxgl-ctrl-bottom-right .mapboxgl-ctrl-geocoder ul { 93 | top: auto; 94 | bottom: 100%; 95 | } 96 | 97 | .mapboxgl-ctrl-geocoder ul > li > a { 98 | clear: both; 99 | cursor: default; 100 | display: block; 101 | padding: 5px 10px; 102 | white-space: nowrap; 103 | overflow: hidden; 104 | text-overflow: ellipsis; 105 | white-space: nowrap; 106 | border-bottom: 1px solid rgba(0,0,0,0.1); 107 | color: #404040; 108 | } 109 | 110 | .mapboxgl-ctrl-geocoder ul > li:last-child > a { 111 | border-bottom: none; 112 | } 113 | 114 | .mapboxgl-ctrl-geocoder ul > li.active > a, 115 | .mapboxgl-ctrl-geocoder ul > li > a:hover { 116 | color: #202020; 117 | background-color: #eee; 118 | text-decoration: none; 119 | cursor: pointer; 120 | } 121 | 122 | @-webkit-keyframes rotate { 123 | from { 124 | -webkit-transform: rotate(0deg); 125 | } 126 | 127 | to { 128 | -webkit-transform: rotate(360deg); 129 | } 130 | } 131 | 132 | @-moz-keyframes rotate { 133 | from { 134 | -moz-transform: rotate(0deg); 135 | } 136 | 137 | to { 138 | -moz-transform: rotate(360deg); 139 | } 140 | } 141 | 142 | @-ms-keyframes rotate { 143 | from { 144 | -ms-transform: rotate(0deg); 145 | } 146 | 147 | to { 148 | -ms-transform: rotate(360deg); 149 | } 150 | } 151 | 152 | @keyframes rotate { 153 | from { 154 | transform: rotate(0deg); 155 | } 156 | 157 | to { 158 | transform: rotate(360deg); 159 | } 160 | } 161 | 162 | /* icons */ 163 | .geocoder-icon { 164 | display: inline-block; 165 | width: 20px; 166 | height: 20px; 167 | vertical-align: middle; 168 | speak: none; 169 | background-repeat: no-repeat; 170 | } 171 | 172 | .geocoder-icon-search { 173 | background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxuczpzdmc9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgdmVyc2lvbj0iMS4xIj4NCiAgPHBhdGggZD0iTTguNSA0QzYgNCA0IDYgNCA4LjUgNCAxMSA2IDEzIDguNSAxMyA5LjQgMTMgMTAuMiAxMi44IDEwLjggMTIuM0wxMC45IDEyLjMgMTQuMyAxNS43QzE0LjUgMTUuOSAxNC43IDE2IDE1IDE2IDE1LjYgMTYgMTYgMTUuNiAxNiAxNSAxNiAxNC43IDE1LjkgMTQuNSAxNS43IDE0LjNMMTIuMyAxMC45IDEyLjMgMTAuOEMxMi44IDEwLjIgMTMgOS40IDEzIDguNSAxMyA2IDExIDQgOC41IDR6TTguNSA1LjVDMTAuMiA1LjUgMTEuNSA2LjggMTEuNSA4LjUgMTEuNSAxMC4yIDEwLjIgMTEuNSA4LjUgMTEuNSA2LjggMTEuNSA1LjUgMTAuMiA1LjUgOC41IDUuNSA2LjggNi44IDUuNSA4LjUgNS41eiIgZmlsbD0iIzAwMCIvPg0KPC9zdmc+); 174 | } 175 | 176 | .geocoder-icon-close { 177 | background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxuczpzdmc9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAyMCIgdmVyc2lvbj0iMS4xIiBoZWlnaHQ9IjIwIiB3aWR0aD0iMjAiPg0KICA8cGF0aCBkPSJtNSA1IDAgMS41IDMuNSAzLjUtMy41IDMuNSAwIDEuNSAxLjUgMCAzLjUtMy41IDMuNSAzLjUgMS41IDAgMC0xLjUtMy41LTMuNSAzLjUtMy41IDAtMS41LTEuNSAwLTMuNSAzLjUtMy41LTMuNS0xLjUgMHoiIGZpbGw9IiMwMDAiLz4NCjwvc3ZnPg==); 178 | } 179 | 180 | .geocoder-icon-loading { 181 | background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxuczpzdmc9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgd2lkdGg9IjIwIiBoZWlnaHQ9IjIwIiB2aWV3Qm94PSIwIDAgMjAgMjAiPjxwYXRoIGQ9Im0xMCAyIDAgMy4zYzIuNiAwIDQuNyAyLjEgNC43IDQuN2wzLjMgMGMwLTQuNC0zLjYtOC04LTh6IiBmaWxsPSIjMDAwIi8+PHBhdGggZD0iTTEwIDJDNi44IDIgMy43IDQuMSAyLjYgNy4xIDEuNCAxMCAyLjEgMTMuNiA0LjUgMTUuOGMyLjQgMi40IDYuNCAyLjkgOS40IDEuMiAyLjUtMS40IDQuMi00LjIgNC4yLTctMS4xIDAtMi4yIDAtMy4zIDAgMC4xIDIuMi0xLjcgNC4zLTMuOCA0LjZDOC43IDE1IDYuNCAxMy44IDUuNyAxMS43IDQuOCA5LjcgNS42IDcuMSA3LjYgNiA4LjMgNS42IDkuMSA1LjMgMTAgNS4zYzAtMS4xIDAtMi4yIDAtMy4zeiIgc3R5bGU9ImZpbGw6IzAwMDtvcGFjaXR5OjAuMiIvPjwvc3ZnPg==); 182 | -webkit-animation: rotate 400ms linear infinite; 183 | -moz-animation: rotate 400ms linear infinite; 184 | -ms-animation: rotate 400ms linear infinite; 185 | animation: rotate 400ms linear infinite; 186 | } 187 | -------------------------------------------------------------------------------- /assets/json/octo.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "FeatureCollection", 3 | "crs": { 4 | "type": "name", 5 | "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } 6 | }, 7 | "features": [ 8 | { 9 | "type": "Feature", 10 | "properties": { "Id": 0 }, 11 | "geometry": { 12 | "type": "Polygon", 13 | "coordinates": [ 14 | [ 15 | [ 16 | -84.4189453125, 17 | -25.085598897064763 18 | ], 19 | [ 20 | -85.25390625, 21 | -25.52261464762328 22 | ], 23 | [ 24 | -86.3525390625, 25 | -25.324166525738384 26 | ], 27 | [ 28 | -87.1875, 29 | -24.96614015991296 30 | ], 31 | [ 32 | -87.8466796875, 33 | -24.367113562651262 34 | ], 35 | [ 36 | -88.76953125, 37 | -22.958393318086337 38 | ], 39 | [ 40 | -90.263671875, 41 | -21.820707853875017 42 | ], 43 | [ 44 | -91.8017578125, 45 | -21.207458730482642 46 | ], 47 | [ 48 | -93.55957031249999, 49 | -21.4121622297254 50 | ], 51 | [ 52 | -94.0869140625, 53 | -22.146707780012616 54 | ], 55 | [ 56 | -93.4716796875, 57 | -23.805449612314614 58 | ], 59 | [ 60 | -93.3837890625, 61 | -22.43134015636061 62 | ], 63 | [ 64 | -92.3291015625, 65 | -22.39071391683855 66 | ], 67 | [ 68 | -90.87890625, 69 | -22.63429269379352 70 | ], 71 | [ 72 | -89.5166015625, 73 | -23.84564988765934 74 | ], 75 | [ 76 | -88.59374999999999, 77 | -24.846565348219734 78 | ], 79 | [ 80 | -87.71484375, 81 | -25.60190226111573 82 | ], 83 | [ 84 | -87.5830078125, 85 | -27.059125784374054 86 | ], 87 | [ 88 | -86.1328125, 89 | -26.35249785815401 90 | ], 91 | [ 92 | -85.7373046875, 93 | -27.137368359795584 94 | ], 95 | [ 96 | -83.671875, 97 | -26.391869671769022 98 | ], 99 | [ 100 | -82.4853515625, 101 | -27.098253906137884 102 | ], 103 | [ 104 | -80.85937499999999, 105 | -26.35249785815401 106 | ], 107 | [ 108 | -79.365234375, 109 | -27.059125784374054 110 | ], 111 | [ 112 | -77.95898437499999, 113 | -26.11598592533351 114 | ], 115 | [ 116 | -75.6298828125, 117 | -26.706359857633526 118 | ], 119 | [ 120 | -76.1572265625, 121 | -25.997549919572098 122 | ], 123 | [ 124 | -75.8056640625, 125 | -24.726874870506972 126 | ], 127 | [ 128 | -75.6298828125, 129 | -23.88583769986199 130 | ], 131 | [ 132 | -75.3662109375, 133 | -22.67484735118852 134 | ], 135 | [ 136 | -74.53125, 137 | -21.207458730482642 138 | ], 139 | [ 140 | -73.1689453125, 141 | -20.3034175184893 142 | ], 143 | [ 144 | -72.0703125, 145 | -20.715015145512087 146 | ], 147 | [ 148 | -71.6748046875, 149 | -21.453068633086772 150 | ], 151 | [ 152 | -71.5869140625, 153 | -20.055931265194438 154 | ], 155 | [ 156 | -72.3779296875, 157 | -19.476950206488414 158 | ], 159 | [ 160 | -73.95996093749999, 161 | -19.808054128088575 162 | ], 163 | [ 164 | -75.2783203125, 165 | -20.67390526467283 166 | ], 167 | [ 168 | -75.9814453125, 169 | -21.57571893245848 170 | ], 171 | [ 172 | -76.3330078125, 173 | -22.75592068148639 174 | ], 175 | [ 176 | -76.6845703125, 177 | -23.76523688975866 178 | ], 179 | [ 180 | -77.34374999999999, 181 | -24.647017162630352 182 | ], 183 | [ 184 | -78.3984375, 185 | -25.125392611512016 186 | ], 187 | [ 188 | -80.33203125, 189 | -25.28443774698303 190 | ], 191 | [ 192 | -80.33203125, 193 | -24.8864364907877 194 | ], 195 | [ 196 | -79.8046875, 197 | -24.44714958973082 198 | ], 199 | [ 200 | -78.75, 201 | -23.926013033021192 202 | ], 203 | [ 204 | -79.013671875, 205 | -23.281719175600006 206 | ], 207 | [ 208 | -82.177734375, 209 | -22.75592068148639 210 | ], 211 | [ 212 | -78.8818359375, 213 | -21.657428197370642 214 | ], 215 | [ 216 | -78.8818359375, 217 | -20.879342971957897 218 | ], 219 | [ 220 | -78.75, 221 | -19.932041306115526 222 | ], 223 | [ 224 | -79.89257812499999, 225 | -18.895892559415024 226 | ], 227 | [ 228 | -80.8154296875, 229 | -18.271086109608863 230 | ], 231 | [ 232 | -82.96875, 233 | -18.35452552912664 234 | ], 235 | [ 236 | -84.462890625, 237 | -19.145168196205297 238 | ], 239 | [ 240 | -85.1220703125, 241 | -20.591652120829167 242 | ], 243 | [ 244 | -85.1220703125, 245 | -21.943045533438166 246 | ], 247 | [ 248 | -84.7705078125, 249 | -23.24134610238612 250 | ], 251 | [ 252 | -84.5947265625, 253 | -23.88583769986199 254 | ], 255 | [ 256 | -84.4189453125, 257 | -25.085598897064763 258 | ] 259 | ] 260 | ] 261 | } 262 | } 263 | ] 264 | } 265 | -------------------------------------------------------------------------------- /assets/libs/jsonSearch/chosen/docsupport/style.css: -------------------------------------------------------------------------------- 1 | /* Reset */ 2 | html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp, small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, figcaption, figure, footer, header, hgroup, menu, nav, section, summary, time, mark, audio, video { margin: 0; padding: 0; border: 0; font-size: 100%; font: inherit; vertical-align: baseline; } 3 | 4 | article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { display: block; } 5 | 6 | blockquote, q { quotes: none; } 7 | blockquote:before, blockquote:after, q:before, q:after { content: ""; content: none; } 8 | ins { background-color: #ff9; color: #000; text-decoration: none; } 9 | mark { background-color: #ff9; color: #000; font-style: italic; font-weight: bold; } 10 | del { text-decoration: line-through; } 11 | abbr[title], dfn[title] { border-bottom: 1px dotted; cursor: help; } 12 | table { border-collapse: collapse; border-spacing: 0; } 13 | hr { display: block; height: 1px; border: 0; border-top: 1px solid #ccc; margin: 1em 0; padding: 0; } 14 | input, select { vertical-align: middle; } 15 | 16 | body { font:13px/1.231 sans-serif; *font-size:small; } /* Hack retained to preserve specificity */ 17 | select, input, textarea, button { font:99% sans-serif; } 18 | pre, code, kbd, samp { font-family: monospace, sans-serif; } 19 | 20 | 21 | body { background: #EEE; color: #444; line-height: 1.4em; } 22 | 23 | header h1 { color: black; font-size: 2em; line-height: 1.1em; display: inline-block; height: 27px; margin: 20px 0 25px; } 24 | header h1 small { font-size: 0.6em; } 25 | 26 | div#content { background: white; border: 1px solid #ccc; border-width: 0 1px 1px; margin: 0 auto; padding: 40px 50px 40px; width: 738px; } 27 | 28 | footer { color: #999; padding-top: 40px; font-size: 0.8em; text-align: center; } 29 | 30 | body { font-family: sans-serif; font-size: 1em; } 31 | 32 | p { margin: 0 0 .7em; max-width: 700px; } 33 | table+p { margin-top: 1em; } 34 | 35 | h2 { border-bottom: 1px solid #ccc; font-size: 1.2em; margin: 3em 0 1em 0; font-weight: bold;} 36 | h3 { font-weight: bold; } 37 | 38 | h2.intro { border-bottom: none; font-size: 1em; font-weight: normal; margin-top:0; } 39 | 40 | ul li { list-style: disc; margin-left: 1em; margin-bottom: 1.25em; } 41 | ol li { margin-left: 1.25em; } 42 | ol ul, ul ul { margin: .25em 0 0; } 43 | ol ul li, ul ul li { list-style-type: circle; margin: 0 0 .25em 1em; } 44 | 45 | li > p { margin-top: .25em; } 46 | 47 | div.side-by-side { width: 100%; margin-bottom: 1em; } 48 | div.side-by-side > div { float: left; width: 49%; } 49 | div.side-by-side > div > em { margin-bottom: 10px; display: block; } 50 | 51 | .faqs em { display: block; } 52 | 53 | .clearfix:after { 54 | content: "\0020"; 55 | display: block; 56 | height: 0; 57 | clear: both; 58 | overflow: hidden; 59 | visibility: hidden; 60 | } 61 | 62 | a { color: #F36C00; outline: none; text-decoration: none; } 63 | a:hover { text-decoration: underline; } 64 | 65 | ul.credits li { margin-bottom: .25em; } 66 | 67 | strong { font-weight: bold; } 68 | i { font-style: italic; } 69 | 70 | .button { 71 | background: #fafafa; 72 | background: -webkit-linear-gradient(top, #ffffff, #eeeeee); 73 | background: -moz-linear-gradient(top, #ffffff, #eeeeee); 74 | background: -o-linear-gradient(top, #ffffff, #eeeeee); 75 | background: linear-gradient(to bottom, #ffffff, #eeeeee); 76 | border: 1px solid #bbbbbb; 77 | border-radius: 4px; 78 | box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2); 79 | color: #555555; 80 | cursor: pointer; 81 | display: inline-block; 82 | font-family: "Helvetica Neue", Arial, Verdana, "Nimbus Sans L", sans-serif; 83 | font-size: 13px; 84 | font-weight: 500; 85 | height: 31px; 86 | line-height: 28px; 87 | outline: none; 88 | padding: 0 13px; 89 | text-shadow: 0 1px 0 white; 90 | text-decoration: none; 91 | vertical-align: middle; 92 | white-space: nowrap; 93 | -webkit-font-smoothing: antialiased; 94 | -webkit-box-sizing: border-box; 95 | -moz-box-sizing: border-box; 96 | box-sizing: border-box; 97 | } 98 | 99 | .button-blue { 100 | background: #1385e5; 101 | background: -webkit-linear-gradient(top, #53b2fc, #1385e5); 102 | background: -moz-linear-gradient(top, #53b2fc, #1385e5); 103 | background: -o-linear-gradient(top, #53b2fc, #1385e5); 104 | background: linear-gradient(to bottom, #53b2fc, #1385e5); 105 | border-color: #075fa9; 106 | color: white; 107 | font-weight: bold; 108 | text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.4); 109 | } 110 | 111 | 112 | /* Tweak navbar brand link to be super sleek 113 | -------------------------------------------------- */ 114 | .oss-bar { 115 | top: 0; 116 | right: 20px; 117 | position: fixed; 118 | z-index: 1030; 119 | } 120 | .oss-bar ul { 121 | float: right; 122 | margin: 0; 123 | list-style: none; 124 | } 125 | .oss-bar ul li { 126 | list-style: none; 127 | float: left; 128 | line-height: 0; 129 | margin: 0; 130 | } 131 | .oss-bar ul li a { 132 | -moz-box-sizing: border-box; 133 | -webkit-box-sizing: border-box; 134 | -ms-box-sizing: border-box; 135 | box-sizing: border-box; 136 | border: 0; 137 | margin-top: -10px; 138 | display: block; 139 | height: 58px; 140 | background: #F36C00 url(oss-credit.png) no-repeat 20px 22px; 141 | padding: 22px 20px 12px 20px; 142 | text-indent: 120%; /* stupid padding */ 143 | white-space: nowrap; 144 | overflow: hidden; 145 | -webkit-transition: all 0.10s ease-in-out; 146 | -moz-transition: all 0.10s ease-in-out; 147 | transition: all 0.15s ease-in-out; 148 | } 149 | .oss-bar ul li a:hover { 150 | margin-top: 0px; 151 | } 152 | .oss-bar a.harvest { 153 | width: 196px; 154 | background-color: #F36C00; 155 | background-position: -142px 22px; 156 | padding-right: 22px; /* optical illusion */ 157 | } 158 | .oss-bar a.fork { 159 | width: 162px; 160 | background-color: #333333; 161 | } 162 | 163 | .docs-table th, .docs-table td { 164 | border: 1px solid #000; 165 | padding: 4px 6px; 166 | white-space: nowrap; 167 | } 168 | 169 | .docs-table td:last-child { 170 | white-space: normal; 171 | } 172 | 173 | .docs-table th { 174 | font-weight: bold; 175 | text-align: left; 176 | } 177 | 178 | #content pre[class*=language-] { 179 | font-size: 14px; 180 | margin-bottom: 20px; 181 | } 182 | 183 | #content pre[class*=language-] code { 184 | font-size: 14px; 185 | padding: 0; 186 | } 187 | 188 | #content code[class*=language-] { 189 | font-size: 12px; 190 | padding: 2px 4px; 191 | } 192 | 193 | .anchor { 194 | color: inherit; 195 | position: relative; 196 | } 197 | 198 | .anchor:hover { 199 | background: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSI3Ij48ZyBmaWxsPSIjNDE0MDQyIj48cGF0aCBkPSJNOS44IDdoLS45bC0uOS0uMWMtLjctLjMtMS40LS43LTEuOC0xLjMtLjItLjEtLjMtLjMtLjMtLjVsLS4zLS40Yy0uMS0uNC0uMi0uOC0uMi0xLjIgMC0uNC4xLS44LjItMS4yaDEuN2MtLjMuNC0uNC44LS40IDEuMiAwIC40LjEuOC4zIDEuMS4xLjIuMi4zLjQuNC4xLjEuMi4yLjQuMy4zLjIuNy4zIDEgLjNoMy40YzEuMiAwIDIuMi0uOSAyLjItMi4xcy0xLTIuMS0yLjItMi4xaC0xLjRjLS4zLS42LS43LTEtMS4yLTEuNGgyLjZjMiAwIDMuNiAxLjYgMy42IDMuNXMtMS42IDMuNS0zLjYgMy41aC0yLjZ6TTguNCAyYy0uMS0uMS0uMi0uMy0uNC0uMy0uMy0uMi0uNy0uMy0xLS4zaC0zLjRjLTEuMiAwLTIuMi45LTIuMiAyLjEgMCAxLjIgMSAyLjEgMi4yIDIuMWgxLjRjLjMuNS43IDEgMS4yIDEuNGgtMi42Yy0yIDAtMy42LTEuNi0zLjYtMy41czEuNi0zLjUgMy42LTMuNWgzLjUwMDAwMDAwMDAwMDAwMDRsLjkuMWMuNy4yIDEuNC43IDEuOCAxLjMuMS4xLjIuMy4zLjUuMS4xLjIuMy4yLjUuMS40LjIuOC4yIDEuMiAwIC40LS4xLjgtLjIgMS4yaC0xLjZjLjMtLjUuNC0uOS40LTEuM3MtLjEtLjgtLjMtMS4xYy0uMS0uMi0uMi0uMy0uNC0uNHoiLz48L2c+PC9zdmc+) 0 50% no-repeat; 200 | background-size: 21px 9px; 201 | margin-left: -27px; 202 | padding-left: 27px; 203 | text-decoration: none; 204 | } 205 | -------------------------------------------------------------------------------- /assets/libs/jsonSearch/layerSearch.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function () { 2 | 3 | getBaseUrl = function () { 4 | 5 | var getUrl = window.location; 6 | var host = getUrl.host; 7 | var protocol = getUrl.protocol; 8 | var urlParts = getUrl.pathname.split('/'); 9 | var path = ""; 10 | 11 | if (host.indexOf("localhost") == -1) path = "/" + urlParts[1]; // + "/" + urlParts[2]; 12 | 13 | return protocol + "//" + host + path; 14 | } 15 | 16 | function getHost() { 17 | 18 | var getUrl = window.location; 19 | var host = getUrl.host; 20 | 21 | return host; 22 | } 23 | 24 | refreshJsonSource = function (source) { 25 | 26 | //ignore these properties 27 | var ignoreProperties = [ ]; 28 | 29 | var geoJsonFile = source.split("-")[0]; 30 | 31 | var props = new Array(); 32 | 33 | var sourcePath = "assets/json/"; 34 | 35 | var filepath = sourcePath + geoJsonFile + ".geojson"; 36 | 37 | //Grab geoJson properties and store in array. 38 | $.getJSON(filepath, function (data) { 39 | 40 | $.each(data, function (key, val) { 41 | 42 | if (key == "features") { 43 | 44 | var items = val; 45 | var agreement = ""; 46 | 47 | var prop = ""; 48 | var propval = ""; 49 | var foo = {}; 50 | 51 | for (i = 0; i < items.length; i++) { 52 | 53 | var properties = items[i].properties; 54 | 55 | $.each(properties, (key, value) => { 56 | 57 | //store label/value/desc tuple in props array 58 | if (value !== "" && value != null && !ignoreProperties.includes(key)) { 59 | 60 | foo = {}; 61 | prop = "label"; 62 | propval = value; 63 | foo[prop] = propval; 64 | 65 | prop = "value"; 66 | propval = key + ":" + value; 67 | foo[prop] = propval; 68 | 69 | prop = "desc"; 70 | propval = key; 71 | foo[prop] = propval; 72 | 73 | props.push(foo); 74 | } 75 | 76 | }); 77 | } 78 | 79 | } 80 | 81 | }); 82 | 83 | setPropsList(props); 84 | 85 | }); 86 | 87 | }; 88 | 89 | function setPropsList(props) { 90 | 91 | var props_sort = props.sort(custom_compare); 92 | 93 | var props_unique = new Array(); 94 | 95 | //create an empty property object 96 | var foo = {}; 97 | var prop = "label"; 98 | var propval = ""; 99 | foo[prop] = propval; 100 | 101 | prop = "value"; 102 | propval = ":"; 103 | foo[prop] = propval; 104 | 105 | prop = "desc"; 106 | propval = ""; 107 | foo[prop] = propval; 108 | 109 | var curr_prop = foo; 110 | 111 | for (i = 0; i < props_sort.length; i++) { 112 | 113 | //store unique values in props_unique 114 | if (props_sort[i].value != curr_prop.value) { 115 | 116 | props_unique.push(props_sort[i]); 117 | curr_prop = props_sort[i]; 118 | } 119 | } 120 | 121 | //No results Label var 122 | var NoResultsLabel = "No Results"; 123 | 124 | //bind to search input field 125 | $("#general_search").autocomplete({ 126 | 127 | // autoFocus True prevents mouse click function 128 | // autoFocus: true, 129 | 130 | open: function (event, ui) { 131 | $('.ui-autocomplete').off('menufocus hover mouseover mouseenter'); 132 | }, 133 | 134 | source: props_unique, 135 | delay: 350, 136 | focus: function (event, ui) { 137 | $("#general_search").val(ui.item.label); 138 | $("#property-descr").html("" + ui.item.desc + ""); 139 | 140 | return false; 141 | 142 | }, 143 | select: function (event, ui) { 144 | $("#general_search").val(ui.item.label); 145 | $("#project-value").val(ui.item.value); 146 | $("#property-descr").html("" + ui.item.desc + ""); 147 | 148 | return false; 149 | }, 150 | 151 | //No Results Response 152 | 153 | source: function (request, response) { 154 | var results = $.ui.autocomplete.filter(props_unique, request.term); 155 | if (!results.length) { 156 | results = [NoResultsLabel]; 157 | } 158 | 159 | response(results); 160 | }, 161 | 162 | //End No Results Response 163 | 164 | 165 | }); //this requires newer version of jquery-ui. I found that it was much slower. 166 | // .autocomplete("instance")._renderItem = function (ul, item) { 167 | 168 | // return $( "
  • " ) 169 | // .append( "
    " + item.desc + "
    " + item.label + "
    " ) 170 | // .appendTo( ul ); 171 | //}; 172 | 173 | 174 | } 175 | 176 | function custom_compare(a, b) { 177 | 178 | return a.value.toString() < b.value.toString() ? -1 : a.value.toString() > b.value.toString() ? 1 : 0; 179 | } 180 | 181 | 182 | 183 | }); 184 | 185 | 186 | function clearFilterLayer() { 187 | if (typeof map.getLayer('filter_layer') !== "undefined") { 188 | map.removeLayer("filter_layer"); 189 | map.removeSource("filter_layer"); 190 | } 191 | } 192 | 193 | function addJsonLayerFilter(source, property, search_criteria) { 194 | 195 | clearFilterLayer(); 196 | 197 | var layer_mapfile = source.split("-")[0]; 198 | 199 | var feature_type = source.split("-")[1]; 200 | 201 | var sourcePath = "assets/json/"; 202 | 203 | var filepath = sourcePath + layer_mapfile + ".geojson"; 204 | 205 | 206 | map.addSource('filter_layer', { 207 | 'type': 'geojson', 208 | 'data': filepath 209 | }); 210 | 211 | 212 | var type = "line"; 213 | var paint = { 214 | "line-color": "cyan", 215 | "line-width": 3 216 | } 217 | 218 | var layer_name = layer_mapfile.split(".")[1]; 219 | 220 | if (feature_type === "point") { 221 | type = "circle"; 222 | paint = { 223 | "circle-color": "cyan", 224 | "circle-radius": 8 225 | } 226 | } 227 | 228 | map.addLayer({ 229 | 'id': 'filter_layer', 230 | 'type': type, 231 | 'source': 'filter_layer', 232 | 'layout': {}, 233 | 'paint': paint 234 | }); 235 | 236 | //Highlight found element 237 | //Number types need to be handled 238 | if (isNaN(search_criteria)) { 239 | map.setFilter('filter_layer', ["==", property, search_criteria]); 240 | } else { 241 | map.setFilter('filter_layer', ["any", ["==", property, search_criteria], ["==", property, parseFloat(search_criteria)]]); 242 | } 243 | 244 | $.getJSON(filepath, function (data) { 245 | 246 | var result = L.geoJson(data, { 247 | 248 | filter: function (feature, layer) { 249 | 250 | var property_val = feature.properties[property]; 251 | 252 | if (isNaN(feature.properties[property])) { 253 | 254 | if (property_val === search_criteria) { 255 | return true; 256 | } 257 | } else { 258 | var float_criteria = parseFloat(search_criteria); 259 | if (property_val == float_criteria) { 260 | return true; 261 | } 262 | 263 | } 264 | 265 | } 266 | } 267 | ); 268 | 269 | var b = result.getBounds(); 270 | 271 | var sw = new mapboxgl.LngLat(b._southWest.lng, b._southWest.lat); 272 | var ne = new mapboxgl.LngLat(b._northEast.lng, b._northEast.lat); 273 | var llb = new mapboxgl.LngLatBounds(sw, ne); 274 | 275 | 276 | if (b._southWest.lng === b._northEast.lng && b._southWest.lat === b._northEast.lat) { //zoom to point if only one point 277 | 278 | map.flyTo({ 279 | center: sw, 280 | zoom: 19 281 | }); 282 | 283 | } else { 284 | 285 | map.fitBounds(llb, { padding: 100 }); 286 | } 287 | 288 | 289 | }); 290 | 291 | function isInt(n) { 292 | return n % 1 === 0; 293 | } 294 | 295 | } 296 | 297 | 298 | -------------------------------------------------------------------------------- /assets/libs/jsonSearch/chosen/chosen.min.css: -------------------------------------------------------------------------------- 1 | /* Chosen v1.6.2 | (c) 2011-2016 by Harvest | MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md */ 2 | 3 | .chosen-container{position:relative;display:inline-block;vertical-align:middle;font-size:13px;-webkit-user-select:none;-moz-user-select:none;user-select:none}.chosen-container *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.chosen-container .chosen-drop{position:absolute;top:100%;left:-9999px;z-index:1010;width:100%;border:1px solid #aaa;border-top:0;background:#fff;box-shadow:0 4px 5px rgba(0,0,0,.15)}.chosen-container.chosen-with-drop .chosen-drop{left:0}.chosen-container a{cursor:pointer}.chosen-container .search-choice .group-name,.chosen-container .chosen-single .group-name{margin-right:4px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:400;color:#999}.chosen-container .search-choice .group-name:after,.chosen-container .chosen-single .group-name:after{content:":";padding-left:2px;vertical-align:top}.chosen-container-single .chosen-single{position:relative;display:block;overflow:hidden;padding:0 0 0 8px;height:25px;border:1px solid #aaa;border-radius:5px;background-color:#fff;background:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#fff),color-stop(50%,#f6f6f6),color-stop(52%,#eee),color-stop(100%,#f4f4f4));background:-webkit-linear-gradient(#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background:-moz-linear-gradient(#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background:-o-linear-gradient(#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background:linear-gradient(#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background-clip:padding-box;box-shadow:0 0 3px #fff inset,0 1px 1px rgba(0,0,0,.1);color:#444;text-decoration:none;white-space:nowrap;line-height:24px}.chosen-container-single .chosen-default{color:#999}.chosen-container-single .chosen-single span{display:block;overflow:hidden;margin-right:26px;text-overflow:ellipsis;white-space:nowrap}.chosen-container-single .chosen-single-with-deselect span{margin-right:38px}.chosen-container-single .chosen-single abbr{position:absolute;top:6px;right:26px;display:block;width:12px;height:12px;background:url(chosen-sprite.png) -42px 1px no-repeat;font-size:1px}.chosen-container-single .chosen-single abbr:hover{background-position:-42px -10px}.chosen-container-single.chosen-disabled .chosen-single abbr:hover{background-position:-42px -10px}.chosen-container-single .chosen-single div{position:absolute;top:0;right:0;display:block;width:18px;height:100%}.chosen-container-single .chosen-single div b{display:block;width:100%;height:100%;background:url(chosen-sprite.png) no-repeat 0 2px}.chosen-container-single .chosen-search{position:relative;z-index:1010;margin:0;padding:3px 4px;white-space:nowrap}.chosen-container-single .chosen-search input[type=text]{margin:1px 0;padding:4px 20px 4px 5px;width:100%;height:auto;outline:0;border:1px solid #aaa;background:#fff url(chosen-sprite.png) no-repeat 100% -20px;background:url(chosen-sprite.png) no-repeat 100% -20px;font-size:1em;font-family:sans-serif;line-height:normal;border-radius:0}.chosen-container-single .chosen-drop{margin-top:-1px;border-radius:0 0 4px 4px;background-clip:padding-box}.chosen-container-single.chosen-container-single-nosearch .chosen-search{position:absolute;left:-9999px}.chosen-container .chosen-results{color:#444;position:relative;overflow-x:hidden;overflow-y:auto;margin:0 4px 4px 0;padding:0 0 0 4px;max-height:240px;-webkit-overflow-scrolling:touch}.chosen-container .chosen-results li{display:none;margin:0;padding:5px 6px;list-style:none;line-height:15px;word-wrap:break-word;-webkit-touch-callout:none}.chosen-container .chosen-results li.active-result{display:list-item;cursor:pointer}.chosen-container .chosen-results li.disabled-result{display:list-item;color:#ccc;cursor:default}.chosen-container .chosen-results li.highlighted{background-color:#3875d7;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#3875d7),color-stop(90%,#2a62bc));background-image:-webkit-linear-gradient(#3875d7 20%,#2a62bc 90%);background-image:-moz-linear-gradient(#3875d7 20%,#2a62bc 90%);background-image:-o-linear-gradient(#3875d7 20%,#2a62bc 90%);background-image:linear-gradient(#3875d7 20%,#2a62bc 90%);color:#fff}.chosen-container .chosen-results li.no-results{color:#777;display:list-item;background:#f4f4f4}.chosen-container .chosen-results li.group-result{display:list-item;font-weight:700;cursor:default}.chosen-container .chosen-results li.group-option{padding-left:15px}.chosen-container .chosen-results li em{font-style:normal;text-decoration:underline}.chosen-container-multi .chosen-choices{position:relative;overflow:hidden;margin:0;padding:0 5px;width:100%;height:auto;border:1px solid #aaa;background-color:#fff;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(1%,#eee),color-stop(15%,#fff));background-image:-webkit-linear-gradient(#eee 1%,#fff 15%);background-image:-moz-linear-gradient(#eee 1%,#fff 15%);background-image:-o-linear-gradient(#eee 1%,#fff 15%);background-image:linear-gradient(#eee 1%,#fff 15%);cursor:text}.chosen-container-multi .chosen-choices li{float:left;list-style:none}.chosen-container-multi .chosen-choices li.search-field{margin:0;padding:0;white-space:nowrap}.chosen-container-multi .chosen-choices li.search-field input[type=text]{margin:1px 0;padding:0;height:25px;outline:0;border:0!important;background:transparent!important;box-shadow:none;color:#999;font-size:100%;font-family:sans-serif;line-height:normal;border-radius:0}.chosen-container-multi .chosen-choices li.search-choice{position:relative;margin:3px 5px 3px 0;padding:3px 20px 3px 5px;border:1px solid #aaa;max-width:100%;border-radius:3px;background-color:#eee;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#f4f4f4),color-stop(50%,#f0f0f0),color-stop(52%,#e8e8e8),color-stop(100%,#eee));background-image:-webkit-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:-moz-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:-o-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-size:100% 19px;background-repeat:repeat-x;background-clip:padding-box;box-shadow:0 0 2px #fff inset,0 1px 0 rgba(0,0,0,.05);color:#333;line-height:13px;cursor:default}.chosen-container-multi .chosen-choices li.search-choice span{word-wrap:break-word}.chosen-container-multi .chosen-choices li.search-choice .search-choice-close{position:absolute;top:4px;right:3px;display:block;width:12px;height:12px;background:url(chosen-sprite.png) -42px 1px no-repeat;font-size:1px}.chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover{background-position:-42px -10px}.chosen-container-multi .chosen-choices li.search-choice-disabled{padding-right:5px;border:1px solid #ccc;background-color:#e4e4e4;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#f4f4f4),color-stop(50%,#f0f0f0),color-stop(52%,#e8e8e8),color-stop(100%,#eee));background-image:-webkit-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:-moz-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:-o-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);color:#666}.chosen-container-multi .chosen-choices li.search-choice-focus{background:#d4d4d4}.chosen-container-multi .chosen-choices li.search-choice-focus .search-choice-close{background-position:-42px -10px}.chosen-container-multi .chosen-results{margin:0;padding:0}.chosen-container-multi .chosen-drop .result-selected{display:list-item;color:#ccc;cursor:default}.chosen-container-active .chosen-single{border:1px solid #5897fb;box-shadow:0 0 5px rgba(0,0,0,.3)}.chosen-container-active.chosen-with-drop .chosen-single{border:1px solid #aaa;-moz-border-radius-bottomright:0;border-bottom-right-radius:0;-moz-border-radius-bottomleft:0;border-bottom-left-radius:0;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#eee),color-stop(80%,#fff));background-image:-webkit-linear-gradient(#eee 20%,#fff 80%);background-image:-moz-linear-gradient(#eee 20%,#fff 80%);background-image:-o-linear-gradient(#eee 20%,#fff 80%);background-image:linear-gradient(#eee 20%,#fff 80%);box-shadow:0 1px 0 #fff inset}.chosen-container-active.chosen-with-drop .chosen-single div{border-left:0;background:transparent}.chosen-container-active.chosen-with-drop .chosen-single div b{background-position:-18px 2px}.chosen-container-active .chosen-choices{border:1px solid #5897fb;box-shadow:0 0 5px rgba(0,0,0,.3)}.chosen-container-active .chosen-choices li.search-field input[type=text]{color:#222!important}.chosen-disabled{opacity:.5!important;cursor:default}.chosen-disabled .chosen-single{cursor:default}.chosen-disabled .chosen-choices .search-choice .search-choice-close{cursor:default}.chosen-rtl{text-align:right}.chosen-rtl .chosen-single{overflow:visible;padding:0 8px 0 0}.chosen-rtl .chosen-single span{margin-right:0;margin-left:26px;direction:rtl}.chosen-rtl .chosen-single-with-deselect span{margin-left:38px}.chosen-rtl .chosen-single div{right:auto;left:3px}.chosen-rtl .chosen-single abbr{right:auto;left:26px}.chosen-rtl .chosen-choices li{float:right}.chosen-rtl .chosen-choices li.search-field input[type=text]{direction:rtl}.chosen-rtl .chosen-choices li.search-choice{margin:3px 5px 3px 0;padding:3px 5px 3px 19px}.chosen-rtl .chosen-choices li.search-choice .search-choice-close{right:auto;left:4px}.chosen-rtl.chosen-container-single-nosearch .chosen-search,.chosen-rtl .chosen-drop{left:9999px}.chosen-rtl.chosen-container-single .chosen-results{margin:0 0 4px 4px;padding:0 4px 0 0}.chosen-rtl .chosen-results li.group-option{padding-right:15px;padding-left:0}.chosen-rtl.chosen-container-active.chosen-with-drop .chosen-single div{border-right:0}.chosen-rtl .chosen-search input[type=text]{padding:4px 5px 4px 20px;background:#fff url(chosen-sprite.png) no-repeat -30px -20px;background:url(chosen-sprite.png) no-repeat -30px -20px;direction:rtl}.chosen-rtl.chosen-container-single .chosen-single div b{background-position:6px 2px}.chosen-rtl.chosen-container-single.chosen-with-drop .chosen-single div b{background-position:-12px 2px}@media only screen and (-webkit-min-device-pixel-ratio:1.5),only screen and (min-resolution:144dpi),only screen and (min-resolution:1.5dppx){.chosen-rtl .chosen-search input[type=text],.chosen-container-single .chosen-single abbr,.chosen-container-single .chosen-single div b,.chosen-container-single .chosen-search input[type=text],.chosen-container-multi .chosen-choices .search-choice .search-choice-close,.chosen-container .chosen-results-scroll-down span,.chosen-container .chosen-results-scroll-up span{background-image:url(chosen-sprite@2x.png)!important;background-size:52px 37px!important;background-repeat:no-repeat!important}} -------------------------------------------------------------------------------- /assets/css/styles-custom.css: -------------------------------------------------------------------------------- 1 | input:focus, select:focus, textarea:focus, button:focus { 2 | outline: none; 3 | } 4 | 5 | #element1 { 6 | display: inline-block; 7 | margin-right: 10px; 8 | width: 200px; 9 | background-color: red; 10 | } 11 | 12 | #element2 { 13 | display: inline-block; 14 | width: 200px; 15 | background-color: red; 16 | } 17 | 18 | 19 | #threeDbutton { 20 | position: absolute; 21 | color: #000; 22 | background-color: white; 23 | font-size: 11px; 24 | right: 10px; 25 | top: 187px; 26 | height: 28px; 27 | width: 28px; 28 | text-align: center; 29 | display: inline-block; 30 | z-index: 1; 31 | border-radius: 4px; 32 | border: none; 33 | box-shadow: 0 0 0 2px rgb(0 0 0 / 10%); 34 | } 35 | 36 | #info { 37 | height: 30px; 38 | width: 100%; 39 | background-color: #ffffff; 40 | border: 1px solid rgb(208, 208, 208); 41 | border-radius: 4px; 42 | color: #333; 43 | padding: 6px; 44 | cursor: pointer; 45 | margin-bottom: 10px; 46 | font-size: 10px; 47 | } 48 | 49 | #getElevation { 50 | height: 30px; 51 | width: 100%; 52 | background-color: #ffffff; 53 | border: 1px solid rgb(208, 208, 208); 54 | border-radius: 4px; 55 | color: #333; 56 | padding: 6px; 57 | cursor: pointer; 58 | margin-bottom: 10px; 59 | font-size: 10px; 60 | } 61 | 62 | #lngInput { 63 | height: 30px; 64 | width: 100%; 65 | background-color: #ffffff; 66 | border: 1px solid rgb(208, 208, 208); 67 | border-radius: 4px; 68 | color: #333; 69 | padding: 6px; 70 | cursor: pointer; 71 | margin-bottom: 10px; 72 | font-size: 10px; 73 | } 74 | 75 | #latInput { 76 | height: 30px; 77 | width: 100%; 78 | background-color: #ffffff; 79 | border: 1px solid rgb(208, 208, 208); 80 | border-radius: 4px; 81 | color: #333; 82 | padding: 6px; 83 | cursor: pointer; 84 | margin-bottom: 10px; 85 | font-size: 10px; 86 | } 87 | 88 | #customDrawPalette { 89 | padding: 0; 90 | margin: 0; 91 | } 92 | 93 | .draw-color-change { 94 | height: 18px; 95 | width: 18px; 96 | border-radius: 0px; 97 | margin-right: 2px; 98 | display: inline-flex; 99 | cursor: pointer; 100 | } 101 | 102 | #customDrawPalette { 103 | padding: 0; 104 | margin: 0; 105 | } 106 | 107 | .draw-color-change { 108 | height: 18px; 109 | width: 18px; 110 | border-radius: 0px; 111 | margin-right: 2px; 112 | display: inline-flex; 113 | cursor: pointer; 114 | } 115 | 116 | #calculate { 117 | background-color: none; 118 | color: #4a4a4a; 119 | cursor: pointer; 120 | } 121 | 122 | #calculated-area, #calculated-length { 123 | height: 30px; 124 | width: 100%; 125 | background-color: #ffffff; 126 | border: 1px solid rgb(208, 208, 208); 127 | border-radius: 4px; 128 | color: #333; 129 | padding: 6px; 130 | cursor: pointer; 131 | margin-bottom: 10px; 132 | font-size: 12px; 133 | } 134 | 135 | .no-js #loader { 136 | display: none; 137 | } 138 | 139 | .js #loader { 140 | display: block; 141 | position: absolute; 142 | left: 100px; 143 | top: 0; 144 | } 145 | 146 | .se-pre-con { 147 | position: fixed; 148 | left: 0px; 149 | top: 0px; 150 | width: 100%; 151 | height: 100%; 152 | z-index: 9999; 153 | background: rgba(61, 68, 72, 1.0); 154 | } 155 | 156 | /* #saveButton { 157 | max-height: 40px; 158 | width: 40px; 159 | background-color: #c5c5c5; 160 | color: #4a4a4a; 161 | padding: 10px; 162 | cursor: pointer; 163 | margin: 10px 0; 164 | } */ 165 | 166 | #urlCopied { 167 | width: 70%; 168 | background-color: #ffffff; 169 | padding: 10px; 170 | border-radius: 4px; 171 | cursor: pointer; 172 | margin-left: 10px; 173 | border: solid 1px #bdbdbd; 174 | font-size: smaller; 175 | white-space: nowrap; 176 | overflow: hidden; 177 | text-overflow: ellipsis; 178 | } 179 | 180 | #copyButton { 181 | height: 41px; 182 | background-color: #ffffff; 183 | padding: 10px; 184 | border-radius: 4px; 185 | cursor: pointer; 186 | margin-left: 10px; 187 | border: solid 1px #bdbdbd; 188 | font-size: 11px; 189 | } 190 | 191 | #export-map { 192 | height: 35px; 193 | font-size: 12px; 194 | border: 1px solid rgb(208, 208, 208); 195 | /* padding: 10px; */ 196 | cursor: pointer; 197 | border-radius: 4px; 198 | background: white; 199 | } 200 | 201 | #search_general { 202 | min-height: 40px; 203 | width: 40px; 204 | background-color: #ffffff; 205 | border: solid 1px #b1b1b1; 206 | border-bottom-left-radius: 4px; 207 | border-top-left-radius: 4px; 208 | cursor: pointer; 209 | } 210 | 211 | #clear_general { 212 | min-height: 40px; 213 | width: 25px; 214 | background-color: #ffffff; 215 | border: solid 1px #b1b1b1; 216 | border-bottom-right-radius: 4px; 217 | border-top-right-radius: 4px; 218 | border-left: none; 219 | cursor: pointer; 220 | } 221 | 222 | .ui-autocomplete { 223 | max-height: 300px; 224 | max-width: 195px; 225 | width: 244px; 226 | overflow-y: auto; 227 | overflow-x: hidden; 228 | padding-left: 5px; 229 | padding-top: 5px; 230 | border: 2px solid #e8e8e8; 231 | border-radius: 4px; 232 | z-index: 2000; 233 | font-size: small; 234 | color: #636363; 235 | white-space: nowrap; 236 | } 237 | 238 | .ui-autocomplete .ui-menu-item a.ui-state-focus { 239 | background: #c2f0ff !important; 240 | padding-right: 100%; 241 | border: none; 242 | color: #353535; 243 | text-decoration: none; 244 | font-weight: 600; 245 | white-space: nowrap; 246 | font-size: small; 247 | } 248 | 249 | a { 250 | color: #1182e2; 251 | text-decoration: none; 252 | /* display: block; */ 253 | } 254 | 255 | a:focus, a:hover { 256 | color: black; 257 | text-decoration: underline; 258 | } 259 | 260 | .clickable { 261 | cursor: pointer; 262 | } 263 | 264 | .layer-picker { 265 | /* padding: 8px 8px; 266 | width: 100%; 267 | background: #ffffff; 268 | border: none; 269 | border-right: none; 270 | font-size: 9pt; 271 | border-radius: 0; 272 | -webkit-appearance: none; */ 273 | position: relative; 274 | display: inline-block; 275 | vertical-align: middle; 276 | font-size: 9pt; 277 | -webkit-user-select: none; 278 | -moz-user-select: none; 279 | user-select: none; 280 | background-color: white; 281 | border-radius: 4px; 282 | border: solid 1px #b1b1b1; 283 | width: 100% !important; 284 | } 285 | 286 | .layer-picker .mapboxgl-ctrl-group { 287 | -moz-box-shadow: 0 0 0px rgba(0, 0, 0, 0.1); 288 | -webkit-box-shadow: 0 0 0px rgba(0, 0, 0, 0.1); 289 | box-shadow: 0 0 0 0px rgba(0, 0, 0, 0.1); 290 | } 291 | 292 | /* Bootstrap custom css */ 293 | 294 | /* @media(min-width:1025px) { */ 295 | #searchModal { 296 | position: absolute; 297 | left: 0px; 298 | right: auto; 299 | bottom: auto; 300 | width: auto; 301 | } 302 | #drawModal { 303 | position: absolute; 304 | left: 0px; 305 | right: auto; 306 | bottom: auto; 307 | width: auto; 308 | } 309 | #layersModal { 310 | position: absolute; 311 | left: 0px; 312 | right: auto; 313 | bottom: auto; 314 | width: auto; 315 | } 316 | #geolocationModal { 317 | position: absolute; 318 | left: 0px; 319 | right: auto; 320 | bottom: auto; 321 | width: auto; 322 | } 323 | #attributesModal { 324 | position: absolute; 325 | left: 0px; 326 | right: auto; 327 | bottom: auto; 328 | width: auto; 329 | } 330 | /* } */ 331 | 332 | #menu { 333 | background: #f9f9f9; 334 | position: absolute; 335 | z-index: 1; 336 | top: 10px; 337 | left: 10px; 338 | font-family: 'Open Sans', sans-serif; 339 | } 340 | 341 | #menu a { 342 | font-size: 14px; 343 | color: #484848; 344 | display: block; 345 | margin: 0; 346 | padding: 4px; 347 | padding-top: 1px; 348 | text-decoration: none; 349 | text-transform: capitalize; 350 | } 351 | 352 | #menu a:before { 353 | font-family: FontAwesome; 354 | content: "\f204"; 355 | display: inline-block; 356 | padding-right: 20px; 357 | vertical-align: middle; 358 | width: 12px; 359 | margin-bottom: 3px; 360 | } 361 | 362 | #menu a:last-child { 363 | border: none; 364 | } 365 | 366 | #menu a.active::before { 367 | content: "\f205"; 368 | color: #579857; 369 | } 370 | 371 | /* ----- MODAL LEFT ----- */ 372 | 373 | .modal.left .modal-dialog { 374 | position: fixed; 375 | margin: auto; 376 | width: 275px; 377 | height: 100%; 378 | padding: 49px 0px 10px 10px; 379 | -webkit-transform: translate3d(0%, 0, 0); 380 | -ms-transform: translate3d(0%, 0, 0); 381 | -o-transform: translate3d(0%, 0, 0); 382 | transform: translate3d(0%, 0, 0); 383 | } 384 | 385 | .modal.left .modal-content { 386 | height: 100%; 387 | overflow-y: auto; 388 | border-radius: 4px; 389 | box-shadow: 0 0 0 2px rgb(0 0 0 / 10%); 390 | background-color: #f9f9f9; 391 | } 392 | 393 | .modal.left .modal-body { 394 | padding: 15px 15px 80px; 395 | } 396 | 397 | .modal.left.fade .modal-dialog { 398 | left: -250px; 399 | -webkit-transition: opacity 0.3s linear, left 0.3s ease-out; 400 | -moz-transition: opacity 0.3s linear, left 0.3s ease-out; 401 | -o-transition: opacity 0.3s linear, left 0.3s ease-out; 402 | transition: opacity 0.3s linear, left 0.3s ease-out; 403 | } 404 | 405 | .modal.left.fade.in .modal-dialog { 406 | left: 0; 407 | padding: 48px 10px 10px 8px; 408 | } 409 | 410 | /* ----- MODAL STYLE ----- */ 411 | 412 | .modal-content { 413 | border-radius: 4px; 414 | } 415 | 416 | .modal-header { 417 | border-bottom-color: #EEEEEE; 418 | background-color: #ffffff; 419 | border-top-right-radius: 4px; 420 | border-top-left-radius: 4px; 421 | } 422 | 423 | /* Global Styles */ 424 | 425 | body { 426 | margin-top: 100px; 427 | background-color: #222; 428 | } 429 | 430 | @media(min-width:768px) { 431 | body { 432 | margin-top: 50px; 433 | } 434 | } 435 | 436 | #wrapper { 437 | padding-left: 0; 438 | } 439 | 440 | #page-wrapper { 441 | width: 100%; 442 | padding: 0; 443 | background-color: #fff; 444 | } 445 | 446 | .huge { 447 | font-size: 50px; 448 | line-height: normal; 449 | } 450 | 451 | @media(min-width:768px) { 452 | #wrapper { 453 | padding-left: 0px; 454 | } 455 | #page-wrapper { 456 | padding: 10px; 457 | } 458 | } 459 | 460 | /* Top Navigation */ 461 | 462 | .top-nav { 463 | padding: 0px 5px; 464 | } 465 | 466 | .top-nav>li { 467 | display: inline-block; 468 | float: left; 469 | } 470 | 471 | .top-nav>li>a { 472 | /* padding-left: 20px; */ 473 | color: #fff; 474 | } 475 | 476 | .top-nav>li>a:hover, .top-nav>li>a:focus, .top-nav>.open>a, .top-nav>.open>a:hover, .top-nav>.open>a:focus { 477 | color: #fff; 478 | background-color: #d2d2d242; 479 | border: 0; 480 | border-radius: 4px; 481 | } 482 | 483 | .top-nav>.open>.dropdown-menu { 484 | float: left; 485 | position: absolute; 486 | margin-top: 0; 487 | border-radius: 4px; 488 | box-shadow: 0 0 0 2px rgb(0 0 0 / 10%); 489 | } 490 | 491 | .top-nav>.open>.dropdown-menu>li>a { 492 | white-space: normal; 493 | } 494 | 495 | ul.message-dropdown { 496 | padding: 0; 497 | max-height: 250px; 498 | overflow-x: hidden; 499 | overflow-y: auto; 500 | } 501 | 502 | li.message-preview { 503 | width: 275px; 504 | border-bottom: 1px solid rgba(0, 0, 0, .15); 505 | } 506 | 507 | li.message-preview>a { 508 | padding-top: 15px; 509 | padding-bottom: 15px; 510 | } 511 | 512 | li.message-footer { 513 | margin: 5px 0; 514 | } 515 | 516 | ul.alert-dropdown { 517 | width: 200px; 518 | } 519 | 520 | /* Side Navigation */ 521 | 522 | .side-nav { 523 | position: fixed; 524 | background-color: #ffffff; 525 | ; 526 | width: 45px; 527 | font-size: 14px; 528 | left: 10px; 529 | margin-top: 50px; 530 | /* padding: 4px; */ 531 | border-radius: 4px; 532 | box-shadow: 0 0 0 2px rgb(0 0 0 / 10%); 533 | } 534 | 535 | .side-nav>li>a { 536 | width: 45px; 537 | height: 45px; 538 | } 539 | 540 | .side-nav li a:hover, .side-nav li a:focus { 541 | outline: none; 542 | background-color: rgba(97, 133, 144, 0.36) !important; 543 | } 544 | 545 | .side-nav>li>ul { 546 | padding: 0; 547 | } 548 | 549 | .side-nav>li>ul>li>a { 550 | display: block; 551 | padding: 10px 15px 10px 15px; 552 | text-decoration: none; 553 | color: #999; 554 | } 555 | 556 | .side-nav>li>ul>li>a:hover { 557 | color: #fff; 558 | } -------------------------------------------------------------------------------- /assets/libs/jsonSearch/chosen/options.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Chosen: A jQuery Plugin by Harvest to Tame Unwieldy Select Boxes 6 | 7 | 8 | 9 | 13 | 14 | 15 |
    16 |
    17 |
    18 |

    Chosen (v1.6.2)

    19 |
    20 |

    Chosen has a number of options and attributes that allow you to have full control of your select boxes.

    21 | 22 |

    Options

    23 |

    The following options are available to pass into Chosen on instantiation.

    24 | 25 |

    Example:

    26 |
     27 |   $(".my_select_box").chosen({
     28 |     disable_search_threshold: 10,
     29 |     no_results_text: "Oops, nothing found!",
     30 |     width: "95%"
     31 |   });
     32 | 
    33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 111 | 112 | 113 | 114 | 115 | 118 | 119 | 120 | 121 | 122 | 125 | 126 | 127 | 128 | 129 | 132 | 133 |
    OptionDefaultDescription
    allow_single_deselectfalseWhen set to true on a single select, Chosen adds a UI element which selects the first element (if it is blank).
    disable_searchfalseWhen set to true, Chosen will not display the search field (single selects only).
    disable_search_threshold0Hide the search input on single selects if there are n or fewer options.
    enable_split_word_searchtrueBy default, searching will match on any word within an option tag. Set this option to false if you want to only match on the entire text of an option tag.
    inherit_select_classesfalseWhen set to true, Chosen will grab any classes on the original select field and add them to Chosen’s container div.
    max_selected_optionsInfinityLimits how many options the user can select. When the limit is reached, the chosen:maxselected event is triggered.
    no_results_text"No results match"The text to be displayed when no matching results are found. The current search is shown at the end of the text (e.g., 72 | No results match "Bad Search").
    placeholder_text_multiple"Select Some Options"The text to be displayed as a placeholder when no options are selected for a multiple select.
    placeholder_text_single"Select an Option"The text to be displayed as a placeholder when no options are selected for a single select.
    search_containsfalseBy default, Chosen’s search matches starting at the beginning of a word. Setting this option to true allows matches starting from anywhere within a word. This is especially useful for options that include a lot of special characters or phrases in ()s and []s.
    single_backstroke_deletetrueBy default, pressing delete/backspace on multiple selects will remove a selected choice. When false, pressing delete/backspace will highlight the last choice, and a second press deselects it.
    widthOriginal select width.The width of the Chosen select box. By default, Chosen attempts to match the width of the select box you are replacing. If your select is hidden when Chosen is instantiated, you must specify a width or the select will show up with a width of 0.
    display_disabled_optionstrueBy default, Chosen includes disabled options in search results with a special styling. Setting this option to false will hide disabled results and exclude them from searches.
    display_selected_optionstrue 108 |

    By default, Chosen includes selected options in search results with a special styling. Setting this option to false will hide selected results and exclude them from searches.

    109 |

    Note: this is for multiple selects only. In single selects, the selected result will always be displayed.

    110 |
    include_group_label_in_selectedfalse 116 |

    By default, Chosen only shows the text of a selected option. Setting this option to true will show the text and group (if any) of the selected option.

    117 |
    max_shown_resultsInfinity 123 |

    Only show the first (n) matching options in the results. This can be used to increase performance for selects with very many options.

    124 |
    case_sensitive_searchfalse 130 |

    By default Chosen's search is case-insensitive. Setting this option to true makes the search case-sensitive.

    131 |
    134 | 135 |

    Attributes

    136 |

    Certain attributes placed on the select tag or its options can be used to configure Chosen.

    137 | 138 |

    Example:

    139 | 140 |
    141 |   <select class="my_select_box" data-placeholder="Select Your Options">
    142 |     <option value="1">Option 1</option>
    143 |     <option value="2" selected>Option 2</option>
    144 |     <option value="3" disabled>Option 3</option>
    145 |   </select>
    146 | 
    147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 |
    AttributeDescription
    data-placeholder 155 |

    The text to be displayed as a placeholder when no options are selected for a select. Defaults to "Select an Option" for single selects or "Select Some Options" for multiple selects.

    156 |

    Note:This attribute overrides anything set in the placeholder_text_multiple or placeholder_text_single options.

    157 |
    multipleThe attribute multiple on your select box dictates whether Chosen will render a multiple or single select.
    selected, disabledChosen automatically highlights selected options and disables disabled options.
    168 | 169 |

    Classes

    170 |

    Classes placed on the select tag can be used to configure Chosen.

    171 | 172 |

    Example:

    173 | 174 |
    175 |   <select class="my_select_box chosen-rtl">
    176 |     <option value="1">Option 1</option>
    177 |     <option value="2">Option 2</option>
    178 |     <option value="3">Option 3</option>
    179 |   </select>
    180 | 
    181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 193 | 194 |
    ClassnameDescription
    chosen-rtl 190 |

    Chosen supports right-to-left text in select boxes. Add the class chosen-rtl to your select tag to support right-to-left text options.

    191 |

    Note: The chosen-rtl class will pass through to the Chosen select even when the inherit_select_classes option is set to false.

    192 |
    195 | 196 |

    Triggered Events

    197 |

    Chosen triggers a number of standard and custom events on the original select field.

    198 | 199 |

    Example:

    200 | 201 |
    202 |   $('.my_select_box').on('change', function(evt, params) {
    203 |     do_something(evt, params);
    204 |   });
    205 | 
    206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 |
    EventDescription
    change 214 |

    Chosen triggers the standard DOM event whenever a selection is made (it also sends a selected or deselected parameter that tells you which option was changed).

    215 |

    Note: in order to use change in the Prototype version, you have to include the Event.simulate class. The selected and deselected parameters are not available for Prototype.

    216 |
    chosen:readyTriggered after Chosen has been fully instantiated.
    chosen:maxselectedTriggered if max_selected_options is set and that total is broken.
    chosen:showing_dropdownTriggered when Chosen’s dropdown is opened.
    chosen:hiding_dropdownTriggered when Chosen’s dropdown is closed.
    chosen:no_resultsTriggered when a search returns no matching results.
    239 | 240 |

    241 | Note: all custom Chosen events (those that begin with chosen:) also include the chosen object as a parameter. 242 |

    243 | 244 |

    Triggerable Events

    245 |

    You can trigger several events on the original select field to invoke a behavior in Chosen.

    246 | 247 |

    Example:

    248 | 249 |
    250 |   // tell Chosen that a select has changed
    251 |   $('.my_select_box').trigger('chosen:updated');
    252 | 
    253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 |
    EventDescription
    chosen:updatedThis event should be triggered whenever Chosen’s underlying select element changes (such as a change in selected options).
    chosen:activateThis is the equivalant of focusing a standard HTML select field. When activated, Chosen will capure keypress events as if you had clicked the field directly.
    chosen:openThis event activates Chosen and also displays the search results.
    chosen:closeThis event deactivates Chosen and hides the search results.
    275 | 276 | 279 | 280 |
    281 |
    282 |
    283 | 287 |
    288 | 289 | 290 | 291 | -------------------------------------------------------------------------------- /assets/libs/jsonSearch/chosen/chosen.css: -------------------------------------------------------------------------------- 1 | /*! 2 | Chosen, a Select Box Enhancer for jQuery and Prototype 3 | by Patrick Filler for Harvest, http://getharvest.com 4 | 5 | Version 1.6.2 6 | Full source at https://github.com/harvesthq/chosen 7 | Copyright (c) 2011-2016 Harvest http://getharvest.com 8 | 9 | MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md 10 | This file is generated by `grunt build`, do not edit it by hand. 11 | */ 12 | 13 | /* @group Base */ 14 | 15 | .chosen-container { 16 | position: relative; 17 | display: inline-block; 18 | vertical-align: middle; 19 | font-size: 9pt; 20 | -webkit-user-select: none; 21 | -moz-user-select: none; 22 | user-select: none; 23 | background-color: white; 24 | border-radius: 4px; 25 | border: solid 1px #b1b1b1; 26 | width: 100% !important; 27 | } 28 | 29 | .chosen-container * { 30 | -webkit-box-sizing: border-box; 31 | -moz-box-sizing: border-box; 32 | box-sizing: border-box; 33 | } 34 | 35 | .chosen-container .chosen-drop { 36 | position: absolute; 37 | top: 100%; 38 | left: -9999px; 39 | z-index: 1010; 40 | width: 100%; 41 | border: solid 1px #b1b1b1; 42 | border-radius: 4px; 43 | background: #fff; 44 | /*box-shadow: 0 4px 5px rgba(0, 0, 0, 0.15);*/ 45 | } 46 | 47 | .chosen-container.chosen-with-drop .chosen-drop { 48 | left: 0; 49 | } 50 | 51 | .chosen-container a { 52 | cursor: pointer; 53 | } 54 | 55 | .chosen-container .search-choice .group-name, .chosen-container .chosen-single .group-name { 56 | margin-right: 4px; 57 | overflow: hidden; 58 | white-space: nowrap; 59 | text-overflow: ellipsis; 60 | font-weight: normal; 61 | color: #999999; 62 | } 63 | 64 | .chosen-container .search-choice .group-name:after, .chosen-container .chosen-single .group-name:after { 65 | content: ":"; 66 | padding-left: 2px; 67 | vertical-align: top; 68 | } 69 | 70 | /* @end */ 71 | 72 | /* @group Single Chosen */ 73 | 74 | .chosen-container-single .chosen-single { 75 | position: relative; 76 | display: block; 77 | overflow: hidden; 78 | padding: 8px 10px 10px 10px; 79 | height: 40px; 80 | background-color: #ffffff; 81 | /* border: solid 1px #b1b1b1; */ 82 | border-radius: 4px; 83 | color: #444; 84 | text-decoration: none; 85 | white-space: nowrap; 86 | line-height: 24px; 87 | } 88 | 89 | .chosen-container-single .chosen-default { 90 | color: #757575; 91 | } 92 | 93 | .chosen-container-single .chosen-single span { 94 | display: block; 95 | overflow: hidden; 96 | margin-right: 26px; 97 | text-overflow: ellipsis; 98 | white-space: nowrap; 99 | border-radius: 0; 100 | -webkit-appearance: none; 101 | } 102 | 103 | .chosen-container-single .chosen-single-with-deselect span { 104 | margin-right: 38px; 105 | } 106 | 107 | .chosen-container-single .chosen-single abbr { 108 | position: absolute; 109 | top: 6px; 110 | right: 26px; 111 | display: block; 112 | width: 12px; 113 | height: 12px; 114 | background: url('chosen-sprite.png') -42px 1px no-repeat; 115 | font-size: 1px; 116 | } 117 | 118 | .chosen-container-single .chosen-single abbr:hover { 119 | background-position: -42px -10px; 120 | } 121 | 122 | .chosen-container-single.chosen-disabled .chosen-single abbr:hover { 123 | background-position: -42px -10px; 124 | } 125 | 126 | .chosen-container-single .chosen-single div { 127 | position: absolute; 128 | top: 8px; 129 | right: 0; 130 | display: block; 131 | width: 16px; 132 | height: 100%; 133 | } 134 | 135 | .chosen-container-single .chosen-single div b { 136 | display: block; 137 | width: 100%; 138 | height: 100%; 139 | background: url('chosen-sprite.png') no-repeat 0px 2px; 140 | } 141 | 142 | .chosen-container-single .chosen-search { 143 | position: relative; 144 | z-index: 1010; 145 | margin: 0; 146 | padding: 3px 4px; 147 | white-space: nowrap; 148 | } 149 | 150 | .chosen-container-single .chosen-search input[type="text"] { 151 | margin: 1px 0; 152 | padding: 4px 20px 4px 5px; 153 | width: 100%; 154 | height: auto; 155 | outline: 0; 156 | border: 2px solid #e2e2e2; 157 | background: white url('chosen-sprite.png') no-repeat 100% -20px; 158 | background: url('chosen-sprite.png') no-repeat 100% -20px; 159 | font-size: 1em; 160 | font-family: sans-serif; 161 | line-height: normal; 162 | border-radius: 0; 163 | } 164 | 165 | .chosen-container-single .chosen-drop { 166 | margin-top: -1px; 167 | /*border-radius: 0 0 5px 5px;*/ 168 | background-clip: padding-box; 169 | } 170 | 171 | .chosen-container-single.chosen-container-single-nosearch .chosen-search { 172 | position: absolute; 173 | left: -9999px; 174 | } 175 | 176 | /* @end */ 177 | 178 | /* @group Results */ 179 | 180 | .chosen-container .chosen-results { 181 | color: #444; 182 | position: relative; 183 | overflow-x: hidden; 184 | overflow-y: auto; 185 | margin: 0 4px 4px 0; 186 | padding: 0 0 0 4px; 187 | max-height: 240px; 188 | -webkit-overflow-scrolling: touch; 189 | } 190 | 191 | .chosen-container .chosen-results li { 192 | display: none; 193 | margin: 0; 194 | padding: 5px 6px; 195 | list-style: none; 196 | line-height: 15px; 197 | word-wrap: break-word; 198 | -webkit-touch-callout: none; 199 | } 200 | 201 | .chosen-container .chosen-results li.active-result { 202 | display: list-item; 203 | cursor: pointer; 204 | } 205 | 206 | .chosen-container .chosen-results li.disabled-result { 207 | display: list-item; 208 | color: #ccc; 209 | cursor: default; 210 | } 211 | 212 | .chosen-container .chosen-results li.highlighted { 213 | background-color: #c2f0ff; 214 | /*background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #3875d7), color-stop(90%, #2a62bc)); 215 | background-image: -webkit-linear-gradient(#3875d7 20%, #2a62bc 90%); 216 | background-image: -moz-linear-gradient(#3875d7 20%, #2a62bc 90%); 217 | background-image: -o-linear-gradient(#3875d7 20%, #2a62bc 90%); 218 | background-image: linear-gradient(#3875d7 20%, #2a62bc 90%);*/ 219 | color: #fff; 220 | } 221 | 222 | .chosen-container .chosen-results li.no-results { 223 | color: #777; 224 | display: list-item; 225 | background: #f4f4f4; 226 | } 227 | 228 | .chosen-container .chosen-results li.group-result { 229 | display: list-item; 230 | font-weight: bold; 231 | cursor: default; 232 | color: #2b2b2b; 233 | font-size: small; 234 | background-color: #e6e6e6; 235 | } 236 | 237 | .chosen-container .chosen-results li.group-option { 238 | padding-left: 10px; 239 | color: #808080; 240 | font-size: 9pt; 241 | } 242 | 243 | .chosen-container .chosen-results li em { 244 | font-style: normal; 245 | text-decoration: underline; 246 | } 247 | 248 | /* @end */ 249 | 250 | /* @group Multi Chosen */ 251 | 252 | .chosen-container-multi .chosen-choices { 253 | position: relative; 254 | overflow: hidden; 255 | margin: 0; 256 | padding: 0 5px; 257 | width: 100%; 258 | height: auto; 259 | border: 1px solid #aaa; 260 | background-color: #fff; 261 | /*background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff)); 262 | background-image: -webkit-linear-gradient(#eeeeee 1%, #ffffff 15%); 263 | background-image: -moz-linear-gradient(#eeeeee 1%, #ffffff 15%); 264 | background-image: -o-linear-gradient(#eeeeee 1%, #ffffff 15%); 265 | background-image: linear-gradient(#eeeeee 1%, #ffffff 15%);*/ 266 | cursor: text; 267 | } 268 | 269 | .chosen-container-multi .chosen-choices li { 270 | float: left; 271 | list-style: none; 272 | } 273 | 274 | .chosen-container-multi .chosen-choices li.search-field { 275 | margin: 0; 276 | padding: 0; 277 | white-space: nowrap; 278 | } 279 | 280 | .chosen-container-multi .chosen-choices li.search-field input[type="text"] { 281 | margin: 1px 0; 282 | padding: 0; 283 | height: 25px; 284 | outline: 0; 285 | border: 0 !important; 286 | background: transparent !important; 287 | box-shadow: none; 288 | color: #999; 289 | font-size: 100%; 290 | font-family: sans-serif; 291 | line-height: normal; 292 | border-radius: 0; 293 | } 294 | 295 | .chosen-container-multi .chosen-choices li.search-choice { 296 | position: relative; 297 | margin: 3px 5px 3px 0; 298 | padding: 3px 20px 3px 5px; 299 | border: 1px solid #aaa; 300 | max-width: 100%; 301 | /*border-radius: 3px;*/ 302 | background-color: #eeeeee; 303 | background-size: 100% 19px; 304 | background-repeat: repeat-x; 305 | background-clip: padding-box; 306 | color: #333; 307 | line-height: 13px; 308 | cursor: default; 309 | } 310 | 311 | .chosen-container-multi .chosen-choices li.search-choice span { 312 | word-wrap: break-word; 313 | } 314 | 315 | .chosen-container-multi .chosen-choices li.search-choice .search-choice-close { 316 | position: absolute; 317 | top: 4px; 318 | right: 3px; 319 | display: block; 320 | width: 12px; 321 | height: 12px; 322 | background: url('chosen-sprite.png') -42px 1px no-repeat; 323 | font-size: 1px; 324 | } 325 | 326 | .chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover { 327 | background-position: -42px -10px; 328 | } 329 | 330 | .chosen-container-multi .chosen-choices li.search-choice-disabled { 331 | padding-right: 5px; 332 | border: 1px solid #ccc; 333 | background-color: #e4e4e4; 334 | color: #666; 335 | } 336 | 337 | .chosen-container-multi .chosen-choices li.search-choice-focus { 338 | background: #d4d4d4; 339 | } 340 | 341 | .chosen-container-multi .chosen-choices li.search-choice-focus .search-choice-close { 342 | background-position: -42px -10px; 343 | } 344 | 345 | .chosen-container-multi .chosen-results { 346 | margin: 0; 347 | padding: 0; 348 | } 349 | 350 | .chosen-container-multi .chosen-drop .result-selected { 351 | display: list-item; 352 | color: #ccc; 353 | cursor: default; 354 | } 355 | 356 | /* @end */ 357 | 358 | /* @group Active */ 359 | 360 | /* .chosen-container-active .chosen-single { 361 | border: 1px solid #5897fb; 362 | box-shadow: 0 0 5px rgba(0, 0, 0, 0.3); 363 | } */ 364 | 365 | .chosen-container-active.chosen-with-drop .chosen-single { 366 | border: none; 367 | border-radius: 4; 368 | -moz-border-radius-bottomright: 0; 369 | border-bottom-right-radius: 0; 370 | -moz-border-radius-bottomleft: 0; 371 | border-bottom-left-radius: 0; 372 | background-color: white; 373 | } 374 | 375 | .chosen-container-active.chosen-with-drop .chosen-single div { 376 | border-left: none; 377 | background: transparent; 378 | } 379 | 380 | .chosen-container-active.chosen-with-drop .chosen-single div b { 381 | background-position: -18px 2px; 382 | } 383 | 384 | .chosen-container-active .chosen-choices { 385 | border: 1px solid #5897fb; 386 | /*box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);*/ 387 | } 388 | 389 | .chosen-container-active .chosen-choices li.search-field input[type="text"] { 390 | color: #222 !important; 391 | } 392 | 393 | /* @end */ 394 | 395 | /* @group Disabled Support */ 396 | 397 | .chosen-disabled { 398 | opacity: 0.5 !important; 399 | cursor: default; 400 | } 401 | 402 | .chosen-disabled .chosen-single { 403 | cursor: default; 404 | } 405 | 406 | .chosen-disabled .chosen-choices .search-choice .search-choice-close { 407 | cursor: default; 408 | } 409 | 410 | /* @end */ 411 | 412 | /* @group Right to Left */ 413 | 414 | .chosen-rtl { 415 | text-align: right; 416 | } 417 | 418 | .chosen-rtl .chosen-single { 419 | overflow: visible; 420 | padding: 0 8px 0 0; 421 | } 422 | 423 | .chosen-rtl .chosen-single span { 424 | margin-right: 0; 425 | margin-left: 26px; 426 | direction: rtl; 427 | } 428 | 429 | .chosen-rtl .chosen-single-with-deselect span { 430 | margin-left: 38px; 431 | } 432 | 433 | .chosen-rtl .chosen-single div { 434 | right: auto; 435 | left: 3px; 436 | } 437 | 438 | .chosen-rtl .chosen-single abbr { 439 | right: auto; 440 | left: 26px; 441 | } 442 | 443 | .chosen-rtl .chosen-choices li { 444 | float: right; 445 | } 446 | 447 | .chosen-rtl .chosen-choices li.search-field input[type="text"] { 448 | direction: rtl; 449 | } 450 | 451 | .chosen-rtl .chosen-choices li.search-choice { 452 | margin: 3px 5px 3px 0; 453 | padding: 3px 5px 3px 19px; 454 | } 455 | 456 | .chosen-rtl .chosen-choices li.search-choice .search-choice-close { 457 | right: auto; 458 | left: 4px; 459 | } 460 | 461 | .chosen-rtl.chosen-container-single-nosearch .chosen-search, .chosen-rtl .chosen-drop { 462 | left: 9999px; 463 | } 464 | 465 | .chosen-rtl.chosen-container-single .chosen-results { 466 | margin: 0 0 4px 4px; 467 | padding: 0 4px 0 0; 468 | } 469 | 470 | .chosen-rtl .chosen-results li.group-option { 471 | padding-right: 15px; 472 | padding-left: 0; 473 | } 474 | 475 | .chosen-rtl.chosen-container-active.chosen-with-drop .chosen-single div { 476 | border-right: none; 477 | } 478 | 479 | .chosen-rtl .chosen-search input[type="text"] { 480 | padding: 4px 5px 4px 20px; 481 | background: white url('chosen-sprite.png') no-repeat -30px -20px; 482 | background: url('chosen-sprite.png') no-repeat -30px -20px; 483 | direction: rtl; 484 | } 485 | 486 | .chosen-rtl.chosen-container-single .chosen-single div b { 487 | background-position: 6px 2px; 488 | } 489 | 490 | .chosen-rtl.chosen-container-single.chosen-with-drop .chosen-single div b { 491 | background-position: -12px 2px; 492 | } 493 | 494 | /* @end */ 495 | 496 | /* @group Retina compatibility */ 497 | 498 | @media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-resolution: 144dpi), only screen and (min-resolution: 1.5dppx) { 499 | .chosen-rtl .chosen-search input[type="text"], .chosen-container-single .chosen-single abbr, .chosen-container-single .chosen-single div b, .chosen-container-single .chosen-search input[type="text"], .chosen-container-multi .chosen-choices .search-choice .search-choice-close, .chosen-container .chosen-results-scroll-down span, .chosen-container .chosen-results-scroll-up span { 500 | background-image: url('chosen-sprite@2x.png') !important; 501 | background-size: 52px 37px !important; 502 | background-repeat: no-repeat !important; 503 | } 504 | } 505 | 506 | /* @end */ -------------------------------------------------------------------------------- /assets/json/test.json: -------------------------------------------------------------------------------- 1 | { 2 | "type" : "FeatureCollection", 3 | "name" : "pavementSections", 4 | "features" : [ 5 | { 6 | "type" : "Feature", 7 | "geometry" : { 8 | "type" : "Polygon", 9 | "coordinates" : [ 10 | [ 11 | [ -122.60682255, 45.58511936 ], 12 | [ -122.6068226, 45.58539435 ], 13 | [ -122.60713747, 45.58539423 ], 14 | [ -122.60717741, 45.58539581 ], 15 | [ -122.60737621, 45.58540193 ], 16 | [ -122.60760977, 45.58539695 ], 17 | [ -122.60767653, 45.58535184 ], 18 | [ -122.60776312, 45.5851924 ], 19 | [ -122.60791987, 45.58490376 ], 20 | [ -122.60794446, 45.58488635 ], 21 | [ -122.60795331, 45.58487691 ], 22 | [ -122.60795924, 45.5848642 ], 23 | [ -122.6079593, 45.58485613 ], 24 | [ -122.60796032, 45.5847286 ], 25 | [ -122.60756884, 45.5847275 ], 26 | [ -122.60717825, 45.5847264 ], 27 | [ -122.60678765, 45.5847253 ], 28 | [ -122.6065908, 45.58472475 ], 29 | [ -122.6065736, 45.58473565 ], 30 | [ -122.60657344, 45.58480336 ], 31 | [ -122.6064877, 45.58485305 ], 32 | [ -122.60629569, 45.58496431 ], 33 | [ -122.60629838, 45.58498973 ], 34 | [ -122.60629743, 45.58508598 ], 35 | [ -122.60624264, 45.58508629 ], 36 | [ -122.60624561, 45.58539475 ], 37 | [ -122.60635896, 45.58539473 ], 38 | [ -122.60643397, 45.58539472 ], 39 | [ -122.60643383, 45.58536595 ], 40 | [ -122.60643256, 45.58511913 ], 41 | [ -122.60682255, 45.58511936 ] 42 | ], 43 | [ 44 | [ -122.60661158, 45.58482308 ], 45 | [ -122.60661129, 45.58478518 ], 46 | [ -122.60698481, 45.58478385 ], 47 | [ -122.60698505, 45.58482176 ], 48 | [ -122.60661158, 45.58482308 ] 49 | ] 50 | ] 51 | }, 52 | "properties" : { 53 | "asset_id" : "PPAVP0006148", 54 | "facility_cd" : "ATC", 55 | "rev_user" : "colema", 56 | "lifecycle_status_cd" : "AC", 57 | "uniqueid" : "091205153-ODVI6R>LR2", 58 | "pid" : "PDX,AC,01", 59 | "branch_id" : "AC", 60 | "section_id" : "01", 61 | "network_id" : "PDX", 62 | "PCI" : 90, 63 | "Last_inspect" : "20160815", 64 | "Shape.STLength()" : 1679.61804240631, 65 | "FMEArea" : "81913.21", 66 | "Feature_Type" : "PORT.pavement_sections", 67 | "Folder" : "Pavement", 68 | "OBJECTID" : 18944, 69 | "geodb_feature_dataset" : "gisdb.PORT.Pavement", 70 | "facility_cd_resolved" : "Airtrans Center", 71 | "lifecycle_status_cd_resolved" : "Active", 72 | "rev_date" : "2018-07-11 07:26:44", 73 | "FMEAcres" : "1.88", 74 | "comments" : " ", 75 | "WorkHistory_1" : "1988-09-01,Base Course - Aggregate Well-Graded 4(in) PDX 87-510, sht. C-6", 76 | "WorkHistory_2" : "1988-09-02,Base Course - Bituminous Asphalt Concrete 17(in) PDX 87-510, sht. C-6", 77 | "WorkHistory_3" : "1988-09-03,New Construction - AC Asphalt Concrete 5(in) PDX 87-510, sht. C-6", 78 | "WorkHistory_4" : "2013-09-01,Surface Course - AC Asphalt Concrete 0(in) work was done bu UPS contractor", 79 | "WorkHistory_5" : "2013-09-02,Cold Milling Asphalt Concrete -2.999999999988(in) ", 80 | "WorkHistory_6" : "2013-09-03,Surface Course - AC Asphalt Concrete 2.999999999988(in) work done by UPS contractor" 81 | } 82 | }, 83 | { 84 | "type" : "Feature", 85 | "geometry" : { 86 | "type" : "Polygon", 87 | "coordinates" : [ 88 | [ 89 | [ -122.61814294, 45.59200132 ], 90 | [ -122.61819845, 45.59202288 ], 91 | [ -122.61829948, 45.59206075 ], 92 | [ -122.61852054, 45.5921436 ], 93 | [ -122.61854213, 45.59215054 ], 94 | [ -122.61856475, 45.59215559 ], 95 | [ -122.61858808, 45.59215868 ], 96 | [ -122.61861176, 45.59215976 ], 97 | [ -122.61863547, 45.59215881 ], 98 | [ -122.61865883, 45.59215585 ], 99 | [ -122.6186815, 45.59215092 ], 100 | [ -122.61880883, 45.59211193 ], 101 | [ -122.61900792, 45.59205095 ], 102 | [ -122.61900958, 45.59204886 ], 103 | [ -122.61899845, 45.59204407 ], 104 | [ -122.61904981, 45.59197883 ], 105 | [ -122.61889063, 45.59191674 ], 106 | [ -122.61868853, 45.5918379 ], 107 | [ -122.61839701, 45.59172417 ], 108 | [ -122.61846005, 45.59193707 ], 109 | [ -122.61839031, 45.59194568 ], 110 | [ -122.61832134, 45.59170544 ], 111 | [ -122.61834179, 45.59170166 ], 112 | [ -122.61832497, 45.59169514 ], 113 | [ -122.61816005, 45.59163123 ], 114 | [ -122.61822236, 45.59184529 ], 115 | [ -122.61815071, 45.59185409 ], 116 | [ -122.61808319, 45.59161243 ], 117 | [ -122.61810463, 45.59160953 ], 118 | [ -122.61806867, 45.59159548 ], 119 | [ -122.61792193, 45.59153819 ], 120 | [ -122.6179794, 45.59175282 ], 121 | [ -122.61791279, 45.59176179 ], 122 | [ -122.61784499, 45.59151994 ], 123 | [ -122.61786674, 45.5915169 ], 124 | [ -122.61781245, 45.59149573 ], 125 | [ -122.61768544, 45.59144619 ], 126 | [ -122.61774362, 45.59166085 ], 127 | [ -122.61767373, 45.59167006 ], 128 | [ -122.6176104, 45.59142769 ], 129 | [ -122.61762972, 45.59142498 ], 130 | [ -122.6175923, 45.59141178 ], 131 | [ -122.61753732, 45.59148013 ], 132 | [ -122.61756215, 45.59162725 ], 133 | [ -122.61756379, 45.59163697 ], 134 | [ -122.61758445, 45.59172482 ], 135 | [ -122.61758925, 45.5917399 ], 136 | [ -122.61759643, 45.5917545 ], 137 | [ -122.61760591, 45.59176844 ], 138 | [ -122.61761756, 45.59178154 ], 139 | [ -122.61763124, 45.59179364 ], 140 | [ -122.61764677, 45.59180459 ], 141 | [ -122.61766396, 45.59181424 ], 142 | [ -122.61768258, 45.59182246 ], 143 | [ -122.61782323, 45.59187711 ], 144 | [ -122.61796388, 45.59193175 ], 145 | [ -122.61814294, 45.59200132 ] 146 | ] 147 | ] 148 | }, 149 | "properties" : { 150 | "asset_id" : "PPAVP0005702", 151 | "facility_cd" : "PDX", 152 | "rev_user" : "colema", 153 | "lifecycle_status_cd" : "AC", 154 | "pavement_loc_cd" : "Airside - Apron", 155 | "uniqueid" : "IITDB8(4W(=3N;\\$QB45", 156 | "pid" : "PDX,AARM,01", 157 | "branch_id" : "AARM", 158 | "section_id" : "01", 159 | "network_id" : "PDX", 160 | "PCI" : 68, 161 | "Last_inspect" : "20160926", 162 | "Shape.STLength()" : 1706.0056691005, 163 | "FMEArea" : "38808.39", 164 | "Feature_Type" : "PORT.pavement_sections", 165 | "Folder" : "Pavement", 166 | "OBJECTID" : 18484, 167 | "geodb_feature_dataset" : "gisdb.PORT.Pavement", 168 | "facility_cd_resolved" : "Portland International Airport", 169 | "lifecycle_status_cd_resolved" : "Active", 170 | "pavement_loc_cd_resolved" : "Airside - Apron", 171 | "rev_date" : "2018-07-13 15:25:06", 172 | "FMEAcres" : "0.89", 173 | "comments" : "TAXIWAY B", 174 | "WorkHistory_1" : "1991-09-01,New Construction - Initial Asphalt Concrete 5(in) PDX 1991, sht. C-10", 175 | "WorkHistory_2" : "1991-09-02,Subbase - Sand Sand 24(in) PDX 1991, sht. C-10", 176 | "WorkHistory_3" : "1991-09-03,Base Course - Aggregate Crushed Stone - Well Graded 4(in) PDX 1991, sht. C-10", 177 | "WorkHistory_4" : "1991-09-04,Base Course - Bituminous Asphalt Concrete 9.5(in) PDX 1991, sht. C-10", 178 | "WorkHistory_5" : "1995-09-01,Surface Seal - Fog Seal Fog Seal 0(in) PDX 1995-12, sht. C-17", 179 | "WorkHistory_6" : "2003-09-01,Overlay - AC Thin (Global) Asphalt Concrete 2.5(in) PDX 2003-1, sht. C-35, C-84", 180 | "WorkHistory_7" : "2003-09-02,Surface Seal - Fog Seal Fog Seal 0(in) PDX 2003-1, sht. C-35, C-84", 181 | "WorkHistory_8" : "2012-09-01,Cold Milling Asphalt Concrete -2.999999999988(in) CD PDX 2012 0500\n", 182 | "WorkHistory_9" : "2012-09-02,Surface Course - AC Asphalt Concrete 2.999999999988(in) CD PDX 2012 0500\n" 183 | } 184 | }, 185 | { 186 | "type" : "Feature", 187 | "geometry" : { 188 | "type" : "Polygon", 189 | "coordinates" : [ 190 | [ 191 | [ -122.60513146, 45.58375364 ], 192 | [ -122.60513111, 45.58386142 ], 193 | [ -122.60513089, 45.58392724 ], 194 | [ -122.60513067, 45.58399306 ], 195 | [ -122.60513028, 45.5841097 ], 196 | [ -122.60570247, 45.58411096 ], 197 | [ -122.60570764, 45.58372168 ], 198 | [ -122.60555337, 45.58372142 ], 199 | [ -122.60550651, 45.58372135 ], 200 | [ -122.60536591, 45.58372112 ], 201 | [ -122.60527217, 45.58372097 ], 202 | [ -122.60517844, 45.58372081 ], 203 | [ -122.60513157, 45.58372074 ], 204 | [ -122.60513146, 45.58375364 ] 205 | ] 206 | ] 207 | }, 208 | "properties" : { 209 | "asset_id" : "PPAVP0005917", 210 | "facility_cd" : "ATC", 211 | "rev_user" : "colema", 212 | "lifecycle_status_cd" : "AC", 213 | "uniqueid" : "091205153P+*W%962TGT", 214 | "pid" : "PDX,AC,04", 215 | "branch_id" : "AC", 216 | "section_id" : "04", 217 | "network_id" : "PDX", 218 | "PCI" : 95, 219 | "Last_inspect" : "20160815", 220 | "Shape.STLength()" : 577.74554140355, 221 | "FMEArea" : "20855.11", 222 | "Feature_Type" : "PORT.pavement_sections", 223 | "Folder" : "Pavement", 224 | "OBJECTID" : 18708, 225 | "geodb_feature_dataset" : "gisdb.PORT.Pavement", 226 | "facility_cd_resolved" : "Airtrans Center", 227 | "lifecycle_status_cd_resolved" : "Active", 228 | "rev_date" : "2018-07-11 07:26:39", 229 | "FMEAcres" : "0.48", 230 | "comments" : " ", 231 | "WorkHistory_1" : "1999-09-02,Subbase - Aggregate Well-Graded 3.999999999984(in) CD PDX 1999 0500 SHT 08", 232 | "WorkHistory_2" : "1999-09-03,New Construction - PCC Portland Cement Concrete 7.999999999968(in) CD PDX 1999 0500 00 Sht C-8\n\n" 233 | } 234 | }, 235 | { 236 | "type" : "Feature", 237 | "geometry" : { 238 | "type" : "MultiPolygon", 239 | "coordinates" : [ 240 | [ 241 | [ 242 | [ -122.61810463, 45.59160953 ], 243 | [ -122.61808319, 45.59161243 ], 244 | [ -122.61815071, 45.59185409 ], 245 | [ -122.61822236, 45.59184529 ], 246 | [ -122.61816005, 45.59163123 ], 247 | [ -122.61815193, 45.59160318 ], 248 | [ -122.61810463, 45.59160953 ] 249 | ] 250 | ], 251 | [ 252 | [ 253 | [ -122.61762972, 45.59142498 ], 254 | [ -122.6176104, 45.59142769 ], 255 | [ -122.61767373, 45.59167006 ], 256 | [ -122.61774362, 45.59166085 ], 257 | [ -122.61767769, 45.59141858 ], 258 | [ -122.61762972, 45.59142498 ] 259 | ] 260 | ], 261 | [ 262 | [ 263 | [ -122.61834179, 45.59170166 ], 264 | [ -122.61832134, 45.59170544 ], 265 | [ -122.61839031, 45.59194568 ], 266 | [ -122.61846005, 45.59193707 ], 267 | [ -122.6183885, 45.59169538 ], 268 | [ -122.61834179, 45.59170166 ] 269 | ] 270 | ], 271 | [ 272 | [ 273 | [ -122.61786674, 45.5915169 ], 274 | [ -122.61784499, 45.59151994 ], 275 | [ -122.61791279, 45.59176179 ], 276 | [ -122.6179794, 45.59175282 ], 277 | [ -122.61792193, 45.59153819 ], 278 | [ -122.61791442, 45.59151066 ], 279 | [ -122.61786674, 45.5915169 ] 280 | ] 281 | ] 282 | ] 283 | }, 284 | "properties" : { 285 | "asset_id" : "PPAVP0002324", 286 | "facility_cd" : "PDX", 287 | "rev_user" : "colema", 288 | "lifecycle_status_cd" : "AC", 289 | "uniqueid" : "IITDB*HMZ_&1GGZ-1M.8", 290 | "pid" : "PDX,AARM,02", 291 | "branch_id" : "AARM", 292 | "section_id" : "02", 293 | "network_id" : "PDX", 294 | "PCI" : 84, 295 | "Last_inspect" : "20160926", 296 | "Shape.STLength()" : 862.203024837529, 297 | "FMEArea" : "6446.86", 298 | "Feature_Type" : "PORT.pavement_sections", 299 | "Folder" : "Pavement", 300 | "OBJECTID" : 18866, 301 | "geodb_feature_dataset" : "gisdb.PORT.Pavement", 302 | "facility_cd_resolved" : "Portland International Airport", 303 | "lifecycle_status_cd_resolved" : "Active", 304 | "rev_date" : "2018-07-11 07:26:42", 305 | "FMEAcres" : "0.15", 306 | "comments" : " ", 307 | "WorkHistory_1" : "1991-09-01,New Construction - Initial Asphalt Concrete 5(in) PDX 1991, sht. C-10", 308 | "WorkHistory_2" : "1991-09-02,Subbase - Sand Sand 24(in) PDX 1991, sht. C-10", 309 | "WorkHistory_3" : "1991-09-03,Base Course - Aggregate Crushed Stone - Well Graded 4(in) PDX 1991, sht. C-10", 310 | "WorkHistory_4" : "1991-09-04,Base Course - Bituminous Asphalt Concrete 2.999999999988(in) PDX 1991, sht. C-10", 311 | "WorkHistory_5" : "1991-09-09,Overlay - PCC Unbonded Portland Cement Concrete 8.999999999964(in) This work done by MX" 312 | } 313 | }, 314 | { 315 | "type" : "Feature", 316 | "geometry" : { 317 | "type" : "Polygon", 318 | "coordinates" : [ 319 | [ 320 | [ -122.60661129, 45.58478518 ], 321 | [ -122.60661158, 45.58482308 ], 322 | [ -122.60678755, 45.58482246 ], 323 | [ -122.60698505, 45.58482176 ], 324 | [ -122.60698481, 45.58478385 ], 325 | [ -122.60678759, 45.58478455 ], 326 | [ -122.60661129, 45.58478518 ] 327 | ] 328 | ] 329 | }, 330 | "properties" : { 331 | "asset_id" : "PPAVP0006147", 332 | "facility_cd" : "ATC", 333 | "rev_user" : "colema", 334 | "lifecycle_status_cd" : "AC", 335 | "uniqueid" : "091205153(Q;&A6Q#JQP", 336 | "pid" : "PDX,AC,02", 337 | "branch_id" : "AC", 338 | "section_id" : "02", 339 | "network_id" : "PDX", 340 | "PCI" : 45, 341 | "Last_inspect" : "20160815", 342 | "Shape.STLength()" : 218.892294069592, 343 | "FMEArea" : "1321.84", 344 | "Feature_Type" : "PORT.pavement_sections", 345 | "Folder" : "Pavement", 346 | "OBJECTID" : 18943, 347 | "geodb_feature_dataset" : "gisdb.PORT.Pavement", 348 | "facility_cd_resolved" : "Airtrans Center", 349 | "lifecycle_status_cd_resolved" : "Active", 350 | "rev_date" : "2018-07-11 07:26:44", 351 | "FMEAcres" : "0.03", 352 | "comments" : " ", 353 | "WorkHistory_1" : "1995-09-01,Subbase - Sand Sand 54(in) PDX 99-3054 - built after 1994", 354 | "WorkHistory_2" : "1995-09-02,Base Course - Aggregate Well-Graded 4(in) PDX 99-3054 - built after 1994", 355 | "WorkHistory_3" : "1995-09-03,New Construction - PCC Portland Cement Concrete 13(in) PDX 99-3054 - built after 1994" 356 | } 357 | } 358 | ] 359 | } -------------------------------------------------------------------------------- /assets/js/print.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | // in inches 3 | var default_height = 7.4, 4 | large_height = 9.6, 5 | legend_width = 3, 6 | CANVAS_RATIO = ''; 7 | 8 | const DEFAULT_HEIGHT = default_height * 72; 9 | const DEFAULT_WIDTH = 792; 10 | const DEFAULT_RATIO = DEFAULT_WIDTH / DEFAULT_HEIGHT; 11 | 12 | const LARGE_HEIGHT = large_height * 72; 13 | const LARGE_WIDTH = 1224 - (legend_width * 72); 14 | const LARGE_RATIO = LARGE_WIDTH / LARGE_HEIGHT; 15 | 16 | const PT_RATIO = 15 / 11; 17 | 18 | const MARGINS = 12; 19 | const BORDER_MARGINS = 9; 20 | 21 | function PrintControl() { } 22 | 23 | PrintControl.prototype.initialize = function (map, options) { 24 | var _this = this; 25 | 26 | _this._map = map; 27 | _this.options = options; 28 | 29 | if ($('.cropper-preview-container').length === 0) { 30 | _this._cropperContainer = document.createElement('div'); 31 | _this._cropperContainer.className = 'cropper-preview-container'; 32 | _this._cropperContainer.style.display = 'none'; 33 | 34 | _this._exportView = document.createElement('img'); 35 | _this._exportView.id = 'export-view'; 36 | 37 | _this._cropperContainer.appendChild(_this._exportView); 38 | document.querySelector('#map-print-modal').appendChild(_this._cropperContainer); 39 | 40 | _this.watchDimensions(); 41 | } 42 | 43 | _this.createCropper(); 44 | } 45 | 46 | 47 | PrintControl.prototype.watchDimensions = function (map) { 48 | var _this = this; 49 | 50 | $(document).ready(function () { 51 | $('input[type=radio][name=dimensions]').change(function () { 52 | if (this.value === 'default') { 53 | _this.cropper.cropper('setAspectRatio', DEFAULT_RATIO) 54 | } else if (this.value == 'large') { 55 | _this.cropper.cropper('setAspectRatio', LARGE_RATIO) 56 | } 57 | }); 58 | }); 59 | } 60 | 61 | PrintControl.prototype.createCropper = function (e) { 62 | if (this.cropper && this.cropper.cropper()) { 63 | this.cropper.cropper('destroy'); 64 | } 65 | 66 | var exportView = $('#export-view'); 67 | exportView.attr('src', map.getCanvas().toDataURL()); 68 | exportView.css('max-width', '100%') 69 | 70 | this.cropper = exportView.cropper({ 71 | zoomable: false, 72 | zoomOnWheel: false, 73 | minContainerHeight: 300, 74 | minContainerWidth: 568, 75 | autoCropArea: 0.99, 76 | aspectRatio: DEFAULT_RATIO, 77 | cropBoxResizable: false, 78 | dragMode: 'none' 79 | }) 80 | } 81 | 82 | PrintControl.prototype.exportMap = function (e) { 83 | var _this = this; 84 | 85 | var type = $("form#print-form .format input[type='radio']:checked").val(); 86 | var size = $("form#print-form .size input[type='radio']:checked").val(); 87 | var mapText = { 88 | title: $('#export-title').val(), 89 | subtitle: $('#export-subtitle').val(), 90 | disclaimer: _this.options.disclaimer 91 | }; 92 | var zoom = map.getZoom(); 93 | var center = map.getCenter(); 94 | var bearing = map.getBearing(); 95 | var isPNG 96 | 97 | type === 'png' ? isPNG = true : isPNG = false 98 | 99 | _this.printPDF(size, mapText, zoom, center, bearing, isPNG) 100 | } 101 | 102 | PrintControl.prototype.printPNG = function (pdf) { 103 | var _this = this; 104 | 105 | PDFJS.getDocument(pdf.output('bloburi')).then(function (doc) { 106 | doc.getPage(1).then(function (page) { 107 | var scale = 1.5; 108 | var viewport = page.getViewport(scale); 109 | 110 | var canvas = document.createElement('canvas'); 111 | var context = canvas.getContext('2d'); 112 | canvas.height = viewport.height; 113 | canvas.width = viewport.width; 114 | 115 | var task = page.render({ canvasContext: context, viewport: viewport }) 116 | task.promise.then(function () { 117 | canvas.toDataURL('image/png'); 118 | canvas.toBlob(function (blob) { 119 | saveAs(blob, 'map.png'); 120 | }) 121 | }); 122 | }) 123 | }); 124 | } 125 | 126 | PrintControl.prototype.printPDF = function (size, mapText, zoom, center, bearing, isPNG) { 127 | var _this = this; 128 | var dimensions = (size === 'default') ? [612, 792] : [792, 1224]; 129 | var pdf = new jsPDF({ 130 | orientation: 'landscape', 131 | unit: 'pt', 132 | format: dimensions 133 | }); 134 | 135 | if (mapText.title === '') { 136 | mapText.title = _this.options.defaultTitle || 'PortMap'; 137 | } 138 | 139 | if (size === 'default') { 140 | if (mapText.disclaimer !== '') { 141 | var height = DEFAULT_HEIGHT + 4; 142 | //map 143 | pdf.addImage(_this.cropper.cropper('getCroppedCanvas').toDataURL('image/png'), 144 | 'png', BORDER_MARGINS, BORDER_MARGINS, DEFAULT_WIDTH - BORDER_MARGINS * 2, height - BORDER_MARGINS * 2); 145 | 146 | //line divider 147 | pdf.setLineWidth(1); 148 | var pad1 = BORDER_MARGINS - 3; 149 | pdf.setDrawColor(214, 214, 214); 150 | pdf.line(BORDER_MARGINS, DEFAULT_HEIGHT + pad1, DEFAULT_WIDTH - BORDER_MARGINS, DEFAULT_HEIGHT + pad1); 151 | 152 | //title 153 | var pad2 = 20; 154 | pdf.setFontSize(12); 155 | pdf.setTextColor(65, 64, 66); 156 | pdf.text(mapText.title, MARGINS, height + pad1 + pad2); 157 | 158 | //disclaimer 159 | var pad3 = 14; 160 | pdf.setFontSize(5); 161 | pdf.setTextColor(109, 110, 113); 162 | var lines = pdf.splitTextToSize(mapText.disclaimer, DEFAULT_WIDTH - (MARGINS * 2)); 163 | pdf.text(MARGINS, height + pad1 + pad2 + pad3, lines); 164 | 165 | //north arrow 166 | _this.addNorthArrow(DEFAULT_HEIGHT, pad1 + pad2, DEFAULT_WIDTH, size, pdf); 167 | 168 | //scalebar 169 | _this.addScaleBar(pdf, size, (height - BORDER_MARGINS * 4), (DEFAULT_WIDTH - BORDER_MARGINS * 2)); 170 | } 171 | } else { 172 | if (mapText.disclaimer !== '') { 173 | var height = LARGE_HEIGHT + 4; 174 | //map 175 | pdf.addImage(_this.cropper.cropper('getCroppedCanvas').toDataURL('image/png'), 176 | 'png', BORDER_MARGINS * PT_RATIO, BORDER_MARGINS * PT_RATIO, LARGE_WIDTH - BORDER_MARGINS * 2 * PT_RATIO, height - BORDER_MARGINS * 2 * PT_RATIO); 177 | 178 | //line divider 179 | pdf.setLineWidth(1.2 * PT_RATIO); 180 | var pad1 = (BORDER_MARGINS * PT_RATIO) - (5.5 * PT_RATIO); 181 | pdf.setDrawColor(214, 214, 214); 182 | pdf.line(BORDER_MARGINS * PT_RATIO, LARGE_HEIGHT + pad1, LARGE_WIDTH - BORDER_MARGINS * PT_RATIO, LARGE_HEIGHT + pad1); 183 | 184 | //title 185 | var pad2 = 18 * PT_RATIO; 186 | pdf.setFontSize(12 * PT_RATIO); 187 | pdf.setTextColor(65, 64, 66); 188 | pdf.text(mapText.title, MARGINS * PT_RATIO, height + pad1 + pad2); 189 | 190 | //disclaimer 191 | var pad3 = 14 * PT_RATIO; 192 | pdf.setFontSize(5 * PT_RATIO); 193 | pdf.setTextColor(109, 110, 113); 194 | var lines = pdf.splitTextToSize(mapText.disclaimer, LARGE_WIDTH - (MARGINS * 2 * PT_RATIO)); 195 | pdf.text(MARGINS * PT_RATIO, height + pad1 + pad2 + pad3, lines); 196 | 197 | //legend 198 | var pad4 = BORDER_MARGINS * 2 * PT_RATIO; 199 | var startLegend = LARGE_WIDTH + BORDER_MARGINS / 2 * PT_RATIO; 200 | pdf.setTextColor(25, 25, 26); 201 | pdf.setFontSize(10 * PT_RATIO); 202 | pdf.text('Legend', startLegend, pad4); 203 | 204 | this.buildLegend(startLegend, pad4, pdf); 205 | 206 | //north arrow 207 | _this.addNorthArrow(LARGE_HEIGHT, pad1 + pad2, LARGE_WIDTH - BORDER_MARGINS * PT_RATIO, size, pdf); 208 | 209 | //scalebar 210 | _this.addScaleBar(pdf, size, (height - BORDER_MARGINS * 4 * PT_RATIO), (LARGE_WIDTH - BORDER_MARGINS * 2 * PT_RATIO)); 211 | } 212 | } 213 | 214 | if (!isPNG) { 215 | setTimeout(function () { 216 | pdf.save('map.pdf'); 217 | }, 2250); 218 | } else { 219 | setTimeout(function () { 220 | _this.printPNG(pdf); 221 | }, 2250) 222 | } 223 | } 224 | 225 | PrintControl.prototype.addNorthArrow = function (height, pad, width, size, pdf) { 226 | var _this = this; 227 | var canvas = document.createElement("canvas"); 228 | canvas.id = 'north-arrow-canvas'; 229 | 230 | if (size === 'default') { 231 | canvas.width = 30; 232 | canvas.height = 30; 233 | } else { 234 | canvas.width = 45; 235 | canvas.height = 45; 236 | } 237 | 238 | canvas.attributes.h = height + pad; 239 | canvas.attributes.w = width; 240 | canvas.attributes.s = size; 241 | 242 | var ctx = canvas.getContext("2d"); 243 | 244 | var img = new Image(); 245 | img.src = _this.options.northArrow; 246 | img.onload = function () { 247 | // roate north arrow 248 | ctx.translate(canvas.width / 2, canvas.height / 2) 249 | ctx.rotate(_this._map.getBearing() * -1 * Math.PI / 180); 250 | ctx.drawImage(img, canvas.width / -2, canvas.height / -2, canvas.width, canvas.height); 251 | 252 | var dataURL = canvas.toDataURL('image/png'); 253 | 254 | if (canvas.attributes.s === 'default') { 255 | var w = canvas.attributes.w - (canvas.width + 40 - BORDER_MARGINS); 256 | var h = canvas.attributes.h - MARGINS; 257 | } else { 258 | var w = canvas.attributes.w - (canvas.width + 40 - BORDER_MARGINS * PT_RATIO); 259 | var h = canvas.attributes.h - MARGINS * PT_RATIO; 260 | } 261 | pdf.addImage(dataURL, 'png', w, h); 262 | } 263 | img.crossOrigin = ''; 264 | } 265 | 266 | PrintControl.prototype.buildLegend = function (width, height, pdf) { 267 | var _this = this; 268 | var map = _this._map; 269 | 270 | // map layers 271 | var layers = map.getStyle().layers.filter(function (lyr) { 272 | if (lyr.hasOwnProperty('layout') && lyr.layout.hasOwnProperty('visibility')) { 273 | return (lyr.source && lyr.source !== 'composite' && lyr.source.indexOf('mapbox-gl-draw') == -1 && lyr.id.indexOf('custom-text-label') == -1 && lyr.layout.visibility === 'visible'); 274 | } else { 275 | return (lyr.source && lyr.source !== 'composite' && lyr.source.indexOf('mapbox-gl-draw') == -1 && lyr.id.indexOf('custom-text-label') == -1); 276 | } 277 | }); 278 | 279 | var tempLayers = []; 280 | // need to only acknowledge visible layers that are within the LT 281 | for (var tl = 0; tl < layers.length; tl++) { 282 | var elm = '#' + layers[tl].id; 283 | if ($('#mapboxgl-legend ' + elm).length) { 284 | tempLayers.push(layers[tl]); 285 | } 286 | } 287 | 288 | layers = tempLayers; 289 | 290 | // layer config 291 | var lyrConfig = map.lyrs; 292 | var labelSize = 7 * PT_RATIO; 293 | var startingWidth = width; 294 | var startingHeight = height + 9 * PT_RATIO; 295 | 296 | var groupLayers = lyrConfig.filter(function (lyr) { 297 | return (lyr.hasOwnProperty('layerGroup')) 298 | }) 299 | 300 | var groupLayerTracker = []; 301 | var groupLoop = false; 302 | 303 | pdf.setTextColor(25, 25, 26); 304 | pdf.setFontSize(8 * PT_RATIO); 305 | 306 | for (var i = layers.length - 1; i >= 0; i--) { 307 | 308 | //only add labelSize if it's the top layer OR it's not a group 309 | if (i === layers.length - 1 || !groupLoop) { 310 | startingHeight = startingHeight + labelSize; 311 | } else { 312 | startingHeight = startingHeight; 313 | } 314 | 315 | var layer = layers[i]; 316 | var nonGroupedLayer = lyrConfig.filter(function (lyr) { 317 | return (lyr.id === layer.id) 318 | }) 319 | 320 | if (nonGroupedLayer.length) { 321 | groupLoop = false; 322 | 323 | var mapLayer = nonGroupedLayer[0]; 324 | var id = mapLayer.id; 325 | 326 | var elm = $('#' + id + '> i'); 327 | var imgElm = $('#' + id + '> img'); 328 | 329 | // font-awesome icon? 330 | if (elm.length) { 331 | _this.addFontAwesome(elm[0], id, pdf, startingWidth, startingHeight + 1); 332 | // custom images? 333 | } else if (imgElm.length) { 334 | _this.addImage(imgElm[0], id, pdf, startingWidth, startingHeight + 1); 335 | } 336 | 337 | pdf.text(mapLayer.name, startingWidth + 18, startingHeight); 338 | startingHeight = startingHeight + labelSize; 339 | 340 | } else { 341 | groupLoop = true; 342 | 343 | for (var gr = 0; gr < groupLayers.length; gr++) { 344 | var found = groupLayers[gr].layerGroup.filter(function (lay) { 345 | return lay.id === layer.id 346 | }) 347 | 348 | if (found.length > 0) { 349 | // have we added this group of layers yet? 350 | if (groupLayerTracker.indexOf(layer.id) === -1) { 351 | 352 | var id = groupLayers[gr].id; 353 | var elm = $('#' + id + '> i'); 354 | var imgElm = $('#' + id + '> img'); 355 | 356 | // font-awesome icon? 357 | if (elm.length) { 358 | _this.addFontAwesome(elm[0], id, pdf, startingWidth, startingHeight + 1); 359 | // custom images? 360 | } else if (imgElm.length) { 361 | _this.addImage(imgElm[0], id, pdf, startingWidth, startingHeight + 1); 362 | } 363 | 364 | pdf.text(groupLayers[gr].name, startingWidth + 18, startingHeight); 365 | 366 | var layerGroup = groupLayers[gr].layerGroup; 367 | var childLayers = []; 368 | 369 | //get childLayers within a specific layerGroup 370 | for (var ml = layers.length - 1; ml >= 0; ml--) { 371 | for (var lg = 0; lg < layerGroup.length; lg++) { 372 | if (layers[ml].id === layerGroup[lg].id) { 373 | childLayers.push(layerGroup[lg]); 374 | } 375 | }; 376 | }; 377 | 378 | for (var c = 0; c < childLayers.length; c++) { 379 | var id = childLayers[c].id; 380 | 381 | var childHeight = startingHeight + (c * labelSize) + ((c + 1) * 6 * PT_RATIO); 382 | groupLayerTracker.push(childLayers[c].id); 383 | 384 | var elm = $('#' + id + '> i'); 385 | var imgElm = $('#' + id + '> img'); 386 | 387 | // font awesome icon? 388 | if (elm.length) { 389 | _this.addFontAwesome(elm[0], id, pdf, startingWidth + 18 * PT_RATIO, childHeight + labelSize + 1); 390 | // custom image icon? 391 | } else if (imgElm.length) { 392 | _this.addImage(imgElm[0], id, pdf, startingWidth + 18 * PT_RATIO, childHeight + labelSize + 1); 393 | } 394 | 395 | pdf.text(childLayers[c].name, startingWidth + 32 * PT_RATIO, childHeight + labelSize); 396 | }; 397 | 398 | //this group layer loop is now complete 399 | groupLoop = false; 400 | startingHeight = childHeight + 2 * labelSize; 401 | } 402 | } 403 | } 404 | } 405 | } 406 | } 407 | 408 | PrintControl.prototype.addScaleBar = function (pdf, size, h, w) { 409 | var _this = this; 410 | var scaleElm = $('.mapboxgl-ctrl.mapboxgl-ctrl-scale')[0]; 411 | 412 | html2canvas(scaleElm).then(function (canvas) { 413 | var dataURL = canvas.toDataURL('image/png'); 414 | if (size === 'default') { 415 | pdf.addImage(dataURL, 'png', (w + BORDER_MARGINS * 2 - canvas.width), (h + BORDER_MARGINS / 2)); 416 | } else { 417 | pdf.addImage(dataURL, 'png', w + (BORDER_MARGINS * 3 * PT_RATIO) - (canvas.width * PT_RATIO), h + (BORDER_MARGINS * PT_RATIO)); 418 | } 419 | }) 420 | } 421 | 422 | PrintControl.prototype.addImage = function (imgElm, id, pdf, startingWidth, startingHeight) { 423 | var canvas = document.createElement("canvas"); 424 | canvas.id = id + '-canvas'; 425 | canvas.width = 18; 426 | canvas.height = 18; 427 | 428 | var ctx = canvas.getContext("2d"); 429 | 430 | var img = new Image(); 431 | img.onload = function () { 432 | ctx.drawImage(img, 0, 0, 18, 18); 433 | var dataURL = canvas.toDataURL('image/png'); 434 | pdf.addImage(dataURL, 'png', startingWidth + 1, startingHeight - (canvas.height / 2) - 2); 435 | } 436 | img.crossOrigin = ''; 437 | img.src = imgElm.src; 438 | } 439 | 440 | PrintControl.prototype.addFontAwesome = function (elm, id, pdf, startingWidth, startingHeight) { 441 | var character = window.getComputedStyle( 442 | elm, ':before' 443 | ).getPropertyValue('content').replace(/['"]+/g, ''); 444 | 445 | var canvas = document.createElement("canvas"); 446 | canvas.id = id + '-canvas'; 447 | canvas.width = 36; 448 | canvas.height = 36; 449 | 450 | var ctx = canvas.getContext("2d"); 451 | ctx.font = "18px FontAwesome"; 452 | ctx.textBaseline = "top"; 453 | ctx.textAlign = "start"; 454 | ctx.fillStyle = elm.style.color; 455 | ctx.fillText(character, 9, 9); 456 | ctx.strokeStyle = elm.style.webkitTextStrokeColor === '' || elm.style.webkitTextStrokeColor === 'initial' ? 'transparent' : elm.style.webkitTextStrokeColor; 457 | ctx.lineWidth = 2; 458 | ctx.strokeText(character, 9, 9); 459 | 460 | var dataURL = canvas.toDataURL('image/png') 461 | pdf.addImage(dataURL, 'png', startingWidth - 4, startingHeight - (canvas.height / 2)); 462 | } -------------------------------------------------------------------------------- /assets/libs/jsonSearch/chosen/chosen.jquery.min.js: -------------------------------------------------------------------------------- 1 | /* Chosen v1.6.2 | (c) 2011-2016 by Harvest | MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md */ 2 | (function(){var a,AbstractChosen,Chosen,SelectParser,b,c={}.hasOwnProperty,d=function(a,b){function d(){this.constructor=a}for(var e in b)c.call(b,e)&&(a[e]=b[e]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a};SelectParser=function(){function SelectParser(){this.options_index=0,this.parsed=[]}return SelectParser.prototype.add_node=function(a){return"OPTGROUP"===a.nodeName.toUpperCase()?this.add_group(a):this.add_option(a)},SelectParser.prototype.add_group=function(a){var b,c,d,e,f,g;for(b=this.parsed.length,this.parsed.push({array_index:b,group:!0,label:this.escapeExpression(a.label),title:a.title?a.title:void 0,children:0,disabled:a.disabled,classes:a.className}),f=a.childNodes,g=[],d=0,e=f.length;e>d;d++)c=f[d],g.push(this.add_option(c,b,a.disabled));return g},SelectParser.prototype.add_option=function(a,b,c){return"OPTION"===a.nodeName.toUpperCase()?(""!==a.text?(null!=b&&(this.parsed[b].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:a.value,text:a.text,html:a.innerHTML,title:a.title?a.title:void 0,selected:a.selected,disabled:c===!0?c:a.disabled,group_array_index:b,group_label:null!=b?this.parsed[b].label:null,classes:a.className,style:a.style.cssText})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1):void 0},SelectParser.prototype.escapeExpression=function(a){var b,c;return null==a||a===!1?"":/[\&\<\>\"\'\`]/.test(a)?(b={"<":"<",">":">",'"':""","'":"'","`":"`"},c=/&(?!\w+;)|[\<\>\"\'\`]/g,a.replace(c,function(a){return b[a]||"&"})):a},SelectParser}(),SelectParser.select_to_array=function(a){var b,c,d,e,f;for(c=new SelectParser,f=a.childNodes,d=0,e=f.length;e>d;d++)b=f[d],c.add_node(b);return c.parsed},AbstractChosen=function(){function AbstractChosen(a,b){this.form_field=a,this.options=null!=b?b:{},AbstractChosen.browser_is_supported()&&(this.is_multiple=this.form_field.multiple,this.set_default_text(),this.set_default_values(),this.setup(),this.set_up_html(),this.register_observers(),this.on_ready())}return AbstractChosen.prototype.set_default_values=function(){var a=this;return this.click_test_action=function(b){return a.test_active_click(b)},this.activate_action=function(b){return a.activate_field(b)},this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.allow_single_deselect=null!=this.options.allow_single_deselect&&null!=this.form_field.options[0]&&""===this.form_field.options[0].text?this.options.allow_single_deselect:!1,this.disable_search_threshold=this.options.disable_search_threshold||0,this.disable_search=this.options.disable_search||!1,this.enable_split_word_search=null!=this.options.enable_split_word_search?this.options.enable_split_word_search:!0,this.group_search=null!=this.options.group_search?this.options.group_search:!0,this.search_contains=this.options.search_contains||!1,this.single_backstroke_delete=null!=this.options.single_backstroke_delete?this.options.single_backstroke_delete:!0,this.max_selected_options=this.options.max_selected_options||1/0,this.inherit_select_classes=this.options.inherit_select_classes||!1,this.display_selected_options=null!=this.options.display_selected_options?this.options.display_selected_options:!0,this.display_disabled_options=null!=this.options.display_disabled_options?this.options.display_disabled_options:!0,this.include_group_label_in_selected=this.options.include_group_label_in_selected||!1,this.max_shown_results=this.options.max_shown_results||Number.POSITIVE_INFINITY,this.case_sensitive_search=this.options.case_sensitive_search||!1},AbstractChosen.prototype.set_default_text=function(){return this.form_field.getAttribute("data-placeholder")?this.default_text=this.form_field.getAttribute("data-placeholder"):this.is_multiple?this.default_text=this.options.placeholder_text_multiple||this.options.placeholder_text||AbstractChosen.default_multiple_text:this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||AbstractChosen.default_single_text,this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||AbstractChosen.default_no_result_text},AbstractChosen.prototype.choice_label=function(a){return this.include_group_label_in_selected&&null!=a.group_label?""+a.group_label+""+a.html:a.html},AbstractChosen.prototype.mouse_enter=function(){return this.mouse_on_container=!0},AbstractChosen.prototype.mouse_leave=function(){return this.mouse_on_container=!1},AbstractChosen.prototype.input_focus=function(a){var b=this;if(this.is_multiple){if(!this.active_field)return setTimeout(function(){return b.container_mousedown()},50)}else if(!this.active_field)return this.activate_field()},AbstractChosen.prototype.input_blur=function(a){var b=this;return this.mouse_on_container?void 0:(this.active_field=!1,setTimeout(function(){return b.blur_test()},100))},AbstractChosen.prototype.results_option_build=function(a){var b,c,d,e,f,g,h;for(b="",e=0,h=this.results_data,f=0,g=h.length;g>f&&(c=h[f],d="",d=c.group?this.result_add_group(c):this.result_add_option(c),""!==d&&(e++,b+=d),(null!=a?a.first:void 0)&&(c.selected&&this.is_multiple?this.choice_build(c):c.selected&&!this.is_multiple&&this.single_set_selected_text(this.choice_label(c))),!(e>=this.max_shown_results));f++);return b},AbstractChosen.prototype.result_add_option=function(a){var b,c;return a.search_match&&this.include_option_in_results(a)?(b=[],a.disabled||a.selected&&this.is_multiple||b.push("active-result"),!a.disabled||a.selected&&this.is_multiple||b.push("disabled-result"),a.selected&&b.push("result-selected"),null!=a.group_array_index&&b.push("group-option"),""!==a.classes&&b.push(a.classes),c=document.createElement("li"),c.className=b.join(" "),c.style.cssText=a.style,c.setAttribute("data-option-array-index",a.array_index),c.innerHTML=a.search_text,a.title&&(c.title=a.title),this.outerHTML(c)):""},AbstractChosen.prototype.result_add_group=function(a){var b,c;return(a.search_match||a.group_match)&&a.active_options>0?(b=[],b.push("group-result"),a.classes&&b.push(a.classes),c=document.createElement("li"),c.className=b.join(" "),c.innerHTML=a.search_text,a.title&&(c.title=a.title),this.outerHTML(c)):""},AbstractChosen.prototype.results_update_field=function(){return this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing?this.winnow_results():void 0},AbstractChosen.prototype.reset_single_select_options=function(){var a,b,c,d,e;for(d=this.results_data,e=[],b=0,c=d.length;c>b;b++)a=d[b],a.selected?e.push(a.selected=!1):e.push(void 0);return e},AbstractChosen.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},AbstractChosen.prototype.results_search=function(a){return this.results_showing?this.winnow_results():this.results_show()},AbstractChosen.prototype.winnow_results=function(){var a,b,c,d,e,f,g,h,i,j,k,l;for(this.no_results_clear(),d=0,f=this.get_search_text(),a=f.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),i=new RegExp(a,"i"),c=this.get_search_regex(a),l=this.results_data,j=0,k=l.length;k>j;j++)b=l[j],b.search_match=!1,e=null,this.include_option_in_results(b)&&(b.group&&(b.group_match=!1,b.active_options=0),null!=b.group_array_index&&this.results_data[b.group_array_index]&&(e=this.results_data[b.group_array_index],0===e.active_options&&e.search_match&&(d+=1),e.active_options+=1),b.search_text=b.group?b.label:b.html,(!b.group||this.group_search)&&(b.search_match=this.search_string_match(b.search_text,c),b.search_match&&!b.group&&(d+=1),b.search_match?(f.length&&(g=b.search_text.search(i),h=b.search_text.substr(0,g+f.length)+""+b.search_text.substr(g+f.length),b.search_text=h.substr(0,g)+""+h.substr(g)),null!=e&&(e.group_match=!0)):null!=b.group_array_index&&this.results_data[b.group_array_index].search_match&&(b.search_match=!0)));return this.result_clear_highlight(),1>d&&f.length?(this.update_results_content(""),this.no_results(f)):(this.update_results_content(this.results_option_build()),this.winnow_results_set_highlight())},AbstractChosen.prototype.get_search_regex=function(a){var b,c;return b=this.search_contains?"":"^",c=this.case_sensitive_search?"":"i",new RegExp(b+a,c)},AbstractChosen.prototype.search_string_match=function(a,b){var c,d,e,f;if(b.test(a))return!0;if(this.enable_split_word_search&&(a.indexOf(" ")>=0||0===a.indexOf("["))&&(d=a.replace(/\[|\]/g,"").split(" "),d.length))for(e=0,f=d.length;f>e;e++)if(c=d[e],b.test(c))return!0},AbstractChosen.prototype.choices_count=function(){var a,b,c,d;if(null!=this.selected_option_count)return this.selected_option_count;for(this.selected_option_count=0,d=this.form_field.options,b=0,c=d.length;c>b;b++)a=d[b],a.selected&&(this.selected_option_count+=1);return this.selected_option_count},AbstractChosen.prototype.choices_click=function(a){return a.preventDefault(),this.results_showing||this.is_disabled?void 0:this.results_show()},AbstractChosen.prototype.keyup_checker=function(a){var b,c;switch(b=null!=(c=a.which)?c:a.keyCode,this.search_field_scale(),b){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices_count()>0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:if(a.preventDefault(),this.results_showing)return this.result_select(a);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:case 18:break;default:return this.results_search()}},AbstractChosen.prototype.clipboard_event_checker=function(a){var b=this;return setTimeout(function(){return b.results_search()},50)},AbstractChosen.prototype.container_width=function(){return null!=this.options.width?this.options.width:""+this.form_field.offsetWidth+"px"},AbstractChosen.prototype.include_option_in_results=function(a){return this.is_multiple&&!this.display_selected_options&&a.selected?!1:!this.display_disabled_options&&a.disabled?!1:a.empty?!1:!0},AbstractChosen.prototype.search_results_touchstart=function(a){return this.touch_started=!0,this.search_results_mouseover(a)},AbstractChosen.prototype.search_results_touchmove=function(a){return this.touch_started=!1,this.search_results_mouseout(a)},AbstractChosen.prototype.search_results_touchend=function(a){return this.touch_started?this.search_results_mouseup(a):void 0},AbstractChosen.prototype.outerHTML=function(a){var b;return a.outerHTML?a.outerHTML:(b=document.createElement("div"),b.appendChild(a),b.innerHTML)},AbstractChosen.browser_is_supported=function(){return"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:/iP(od|hone)/i.test(window.navigator.userAgent)||/IEMobile/i.test(window.navigator.userAgent)||/Windows Phone/i.test(window.navigator.userAgent)||/BlackBerry/i.test(window.navigator.userAgent)||/BB10/i.test(window.navigator.userAgent)||/Android.*Mobile/i.test(window.navigator.userAgent)?!1:!0},AbstractChosen.default_multiple_text="Select Some Options",AbstractChosen.default_single_text="Select an Option",AbstractChosen.default_no_result_text="No results match",AbstractChosen}(),a=jQuery,a.fn.extend({chosen:function(b){return AbstractChosen.browser_is_supported()?this.each(function(c){var d,e;return d=a(this),e=d.data("chosen"),"destroy"===b?void(e instanceof Chosen&&e.destroy()):void(e instanceof Chosen||d.data("chosen",new Chosen(this,b)))}):this}}),Chosen=function(c){function Chosen(){return b=Chosen.__super__.constructor.apply(this,arguments)}return d(Chosen,c),Chosen.prototype.setup=function(){return this.form_field_jq=a(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex,this.is_rtl=this.form_field_jq.hasClass("chosen-rtl")},Chosen.prototype.set_up_html=function(){var b,c;return b=["chosen-container"],b.push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&b.push(this.form_field.className),this.is_rtl&&b.push("chosen-rtl"),c={"class":b.join(" "),style:"width: "+this.container_width()+";",title:this.form_field.title},this.form_field.id.length&&(c.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=a("
    ",c),this.is_multiple?this.container.html('
      '):this.container.html(''+this.default_text+'
        '),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.results_build(),this.set_tab_index(),this.set_label_behavior()},Chosen.prototype.on_ready=function(){return this.form_field_jq.trigger("chosen:ready",{chosen:this})},Chosen.prototype.register_observers=function(){var a=this;return this.container.bind("touchstart.chosen",function(b){return a.container_mousedown(b),b.preventDefault()}),this.container.bind("touchend.chosen",function(b){return a.container_mouseup(b),b.preventDefault()}),this.container.bind("mousedown.chosen",function(b){a.container_mousedown(b)}),this.container.bind("mouseup.chosen",function(b){a.container_mouseup(b)}),this.container.bind("mouseenter.chosen",function(b){a.mouse_enter(b)}),this.container.bind("mouseleave.chosen",function(b){a.mouse_leave(b)}),this.search_results.bind("mouseup.chosen",function(b){a.search_results_mouseup(b)}),this.search_results.bind("mouseover.chosen",function(b){a.search_results_mouseover(b)}),this.search_results.bind("mouseout.chosen",function(b){a.search_results_mouseout(b)}),this.search_results.bind("mousewheel.chosen DOMMouseScroll.chosen",function(b){a.search_results_mousewheel(b)}),this.search_results.bind("touchstart.chosen",function(b){a.search_results_touchstart(b)}),this.search_results.bind("touchmove.chosen",function(b){a.search_results_touchmove(b)}),this.search_results.bind("touchend.chosen",function(b){a.search_results_touchend(b)}),this.form_field_jq.bind("chosen:updated.chosen",function(b){a.results_update_field(b)}),this.form_field_jq.bind("chosen:activate.chosen",function(b){a.activate_field(b)}),this.form_field_jq.bind("chosen:open.chosen",function(b){a.container_mousedown(b)}),this.form_field_jq.bind("chosen:close.chosen",function(b){a.input_blur(b)}),this.search_field.bind("blur.chosen",function(b){a.input_blur(b)}),this.search_field.bind("keyup.chosen",function(b){a.keyup_checker(b)}),this.search_field.bind("keydown.chosen",function(b){a.keydown_checker(b)}),this.search_field.bind("focus.chosen",function(b){a.input_focus(b)}),this.search_field.bind("cut.chosen",function(b){a.clipboard_event_checker(b)}),this.search_field.bind("paste.chosen",function(b){a.clipboard_event_checker(b)}),this.is_multiple?this.search_choices.bind("click.chosen",function(b){a.choices_click(b)}):this.container.bind("click.chosen",function(a){a.preventDefault()})},Chosen.prototype.destroy=function(){return a(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},Chosen.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field_jq[0].disabled,this.is_disabled?(this.container.addClass("chosen-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus.chosen",this.activate_action),this.close_field()):(this.container.removeClass("chosen-disabled"),this.search_field[0].disabled=!1,this.is_multiple?void 0:this.selected_item.bind("focus.chosen",this.activate_action))},Chosen.prototype.container_mousedown=function(b){return this.is_disabled||(b&&"mousedown"===b.type&&!this.results_showing&&b.preventDefault(),null!=b&&a(b.target).hasClass("search-choice-close"))?void 0:(this.active_field?this.is_multiple||!b||a(b.target)[0]!==this.selected_item[0]&&!a(b.target).parents("a.chosen-single").length||(b.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),a(this.container[0].ownerDocument).bind("click.chosen",this.click_test_action),this.results_show()),this.activate_field())},Chosen.prototype.container_mouseup=function(a){return"ABBR"!==a.target.nodeName||this.is_disabled?void 0:this.results_reset(a)},Chosen.prototype.search_results_mousewheel=function(a){var b;return a.originalEvent&&(b=a.originalEvent.deltaY||-a.originalEvent.wheelDelta||a.originalEvent.detail),null!=b?(a.preventDefault(),"DOMMouseScroll"===a.type&&(b=40*b),this.search_results.scrollTop(b+this.search_results.scrollTop())):void 0},Chosen.prototype.blur_test=function(a){return!this.active_field&&this.container.hasClass("chosen-container-active")?this.close_field():void 0},Chosen.prototype.close_field=function(){return a(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},Chosen.prototype.activate_field=function(){return this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},Chosen.prototype.test_active_click=function(b){var c;return c=a(b.target).closest(".chosen-container"),c.length&&this.container[0]===c[0]?this.active_field=!0:this.close_field()},Chosen.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=SelectParser.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():this.is_multiple||(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},Chosen.prototype.result_do_highlight=function(a){var b,c,d,e,f;if(a.length){if(this.result_clear_highlight(),this.result_highlight=a,this.result_highlight.addClass("highlighted"),d=parseInt(this.search_results.css("maxHeight"),10),f=this.search_results.scrollTop(),e=d+f,c=this.result_highlight.position().top+this.search_results.scrollTop(),b=c+this.result_highlight.outerHeight(),b>=e)return this.search_results.scrollTop(b-d>0?b-d:0);if(f>c)return this.search_results.scrollTop(c)}},Chosen.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},Chosen.prototype.results_show=function(){return this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.container.addClass("chosen-with-drop"),this.results_showing=!0,this.search_field.focus(),this.search_field.val(this.search_field.val()),this.winnow_results(),this.form_field_jq.trigger("chosen:showing_dropdown",{chosen:this}))},Chosen.prototype.update_results_content=function(a){return this.search_results.html(a)},Chosen.prototype.results_hide=function(){return this.results_showing&&(this.result_clear_highlight(),this.container.removeClass("chosen-with-drop"),this.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:this})),this.results_showing=!1},Chosen.prototype.set_tab_index=function(a){var b;return this.form_field.tabIndex?(b=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field[0].tabIndex=b):void 0},Chosen.prototype.set_label_behavior=function(){var b=this;return this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=a("label[for='"+this.form_field.id+"']")),this.form_field_label.length>0?this.form_field_label.bind("click.chosen",function(a){return b.is_multiple?b.container_mousedown(a):b.activate_field()}):void 0},Chosen.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},Chosen.prototype.search_results_mouseup=function(b){var c;return c=a(b.target).hasClass("active-result")?a(b.target):a(b.target).parents(".active-result").first(),c.length?(this.result_highlight=c,this.result_select(b),this.search_field.focus()):void 0},Chosen.prototype.search_results_mouseover=function(b){var c;return c=a(b.target).hasClass("active-result")?a(b.target):a(b.target).parents(".active-result").first(),c?this.result_do_highlight(c):void 0},Chosen.prototype.search_results_mouseout=function(b){return a(b.target).hasClass("active-result")?this.result_clear_highlight():void 0},Chosen.prototype.choice_build=function(b){var c,d,e=this;return c=a("
      • ",{"class":"search-choice"}).html(""+this.choice_label(b)+""),b.disabled?c.addClass("search-choice-disabled"):(d=a("",{"class":"search-choice-close","data-option-array-index":b.array_index}),d.bind("click.chosen",function(a){return e.choice_destroy_link_click(a)}),c.append(d)),this.search_container.before(c)},Chosen.prototype.choice_destroy_link_click=function(b){return b.preventDefault(),b.stopPropagation(),this.is_disabled?void 0:this.choice_destroy(a(b.target))},Chosen.prototype.choice_destroy=function(a){return this.result_deselect(a[0].getAttribute("data-option-array-index"))?(this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.search_field.val().length<1&&this.results_hide(),a.parents("li").first().remove(),this.search_field_scale()):void 0},Chosen.prototype.results_reset=function(){return this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup(),this.form_field_jq.trigger("change"),this.active_field?this.results_hide():void 0},Chosen.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},Chosen.prototype.result_select=function(a){var b,c;return this.result_highlight?(b=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?b.removeClass("active-result"):this.reset_single_select_options(),b.addClass("result-selected"),c=this.results_data[b[0].getAttribute("data-option-array-index")],c.selected=!0,this.form_field.options[c.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(c):this.single_set_selected_text(this.choice_label(c)),(a.metaKey||a.ctrlKey)&&this.is_multiple||this.results_hide(),this.show_search_field_default(),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&this.form_field_jq.trigger("change",{selected:this.form_field.options[c.options_index].value}),this.current_selectedIndex=this.form_field.selectedIndex,a.preventDefault(),this.search_field_scale())):void 0},Chosen.prototype.single_set_selected_text=function(a){return null==a&&(a=this.default_text),a===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.selected_item.find("span").html(a)},Chosen.prototype.result_deselect=function(a){var b;return b=this.results_data[a],this.form_field.options[b.options_index].disabled?!1:(b.selected=!1,this.form_field.options[b.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.form_field_jq.trigger("change",{deselected:this.form_field.options[b.options_index].value}),this.search_field_scale(),!0)},Chosen.prototype.single_deselect_control_build=function(){return this.allow_single_deselect?(this.selected_item.find("abbr").length||this.selected_item.find("span").first().after(''),this.selected_item.addClass("chosen-single-with-deselect")):void 0},Chosen.prototype.get_search_text=function(){return a("
        ").text(a.trim(this.search_field.val())).html()},Chosen.prototype.winnow_results_set_highlight=function(){var a,b;return b=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),a=b.length?b.first():this.search_results.find(".active-result").first(),null!=a?this.result_do_highlight(a):void 0},Chosen.prototype.no_results=function(b){var c;return c=a('
      • '+this.results_none_found+' ""
      • '),c.find("span").first().html(b),this.search_results.append(c),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},Chosen.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},Chosen.prototype.keydown_arrow=function(){var a;return this.results_showing&&this.result_highlight?(a=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(a):void 0:this.results_show()},Chosen.prototype.keyup_arrow=function(){var a;return this.results_showing||this.is_multiple?this.result_highlight?(a=this.result_highlight.prevAll("li.active-result"),a.length?this.result_do_highlight(a.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight())):void 0:this.results_show()},Chosen.prototype.keydown_backstroke=function(){var a;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(a=this.search_container.siblings("li.search-choice").last(),a.length&&!a.hasClass("search-choice-disabled")?(this.pending_backstroke=a,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0)},Chosen.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},Chosen.prototype.keydown_checker=function(a){var b,c;switch(b=null!=(c=a.which)?c:a.keyCode,this.search_field_scale(),8!==b&&this.pending_backstroke&&this.clear_backstroke(),b){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(a),this.mouse_on_container=!1;break;case 13:this.results_showing&&a.preventDefault();break;case 32:this.disable_search&&a.preventDefault();break;case 38:a.preventDefault(),this.keyup_arrow();break;case 40:a.preventDefault(),this.keydown_arrow()}},Chosen.prototype.search_field_scale=function(){var b,c,d,e,f,g,h,i,j;if(this.is_multiple){for(d=0,h=0,f="position:absolute; left: -1000px; top: -1000px; display:none;",g=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"],i=0,j=g.length;j>i;i++)e=g[i],f+=e+":"+this.search_field.css(e)+";";return b=a("
        ",{style:f}),b.text(this.search_field.val()),a("body").append(b),h=b.width()+25,b.remove(),c=this.container.outerWidth(),h>c-10&&(h=c-10),this.search_field.css({width:h+"px"})}},Chosen}(AbstractChosen)}).call(this); -------------------------------------------------------------------------------- /assets/libs/jsonSearch/chosen/chosen.proto.min.js: -------------------------------------------------------------------------------- 1 | /* Chosen v1.6.2 | (c) 2011-2016 by Harvest | MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md */ 2 | (function(){var AbstractChosen,SelectParser,a,b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};SelectParser=function(){function SelectParser(){this.options_index=0,this.parsed=[]}return SelectParser.prototype.add_node=function(a){return"OPTGROUP"===a.nodeName.toUpperCase()?this.add_group(a):this.add_option(a)},SelectParser.prototype.add_group=function(a){var b,c,d,e,f,g;for(b=this.parsed.length,this.parsed.push({array_index:b,group:!0,label:this.escapeExpression(a.label),title:a.title?a.title:void 0,children:0,disabled:a.disabled,classes:a.className}),f=a.childNodes,g=[],d=0,e=f.length;e>d;d++)c=f[d],g.push(this.add_option(c,b,a.disabled));return g},SelectParser.prototype.add_option=function(a,b,c){return"OPTION"===a.nodeName.toUpperCase()?(""!==a.text?(null!=b&&(this.parsed[b].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:a.value,text:a.text,html:a.innerHTML,title:a.title?a.title:void 0,selected:a.selected,disabled:c===!0?c:a.disabled,group_array_index:b,group_label:null!=b?this.parsed[b].label:null,classes:a.className,style:a.style.cssText})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1):void 0},SelectParser.prototype.escapeExpression=function(a){var b,c;return null==a||a===!1?"":/[\&\<\>\"\'\`]/.test(a)?(b={"<":"<",">":">",'"':""","'":"'","`":"`"},c=/&(?!\w+;)|[\<\>\"\'\`]/g,a.replace(c,function(a){return b[a]||"&"})):a},SelectParser}(),SelectParser.select_to_array=function(a){var b,c,d,e,f;for(c=new SelectParser,f=a.childNodes,d=0,e=f.length;e>d;d++)b=f[d],c.add_node(b);return c.parsed},AbstractChosen=function(){function AbstractChosen(a,b){this.form_field=a,this.options=null!=b?b:{},AbstractChosen.browser_is_supported()&&(this.is_multiple=this.form_field.multiple,this.set_default_text(),this.set_default_values(),this.setup(),this.set_up_html(),this.register_observers(),this.on_ready())}return AbstractChosen.prototype.set_default_values=function(){var a=this;return this.click_test_action=function(b){return a.test_active_click(b)},this.activate_action=function(b){return a.activate_field(b)},this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.allow_single_deselect=null!=this.options.allow_single_deselect&&null!=this.form_field.options[0]&&""===this.form_field.options[0].text?this.options.allow_single_deselect:!1,this.disable_search_threshold=this.options.disable_search_threshold||0,this.disable_search=this.options.disable_search||!1,this.enable_split_word_search=null!=this.options.enable_split_word_search?this.options.enable_split_word_search:!0,this.group_search=null!=this.options.group_search?this.options.group_search:!0,this.search_contains=this.options.search_contains||!1,this.single_backstroke_delete=null!=this.options.single_backstroke_delete?this.options.single_backstroke_delete:!0,this.max_selected_options=this.options.max_selected_options||1/0,this.inherit_select_classes=this.options.inherit_select_classes||!1,this.display_selected_options=null!=this.options.display_selected_options?this.options.display_selected_options:!0,this.display_disabled_options=null!=this.options.display_disabled_options?this.options.display_disabled_options:!0,this.include_group_label_in_selected=this.options.include_group_label_in_selected||!1,this.max_shown_results=this.options.max_shown_results||Number.POSITIVE_INFINITY,this.case_sensitive_search=this.options.case_sensitive_search||!1},AbstractChosen.prototype.set_default_text=function(){return this.form_field.getAttribute("data-placeholder")?this.default_text=this.form_field.getAttribute("data-placeholder"):this.is_multiple?this.default_text=this.options.placeholder_text_multiple||this.options.placeholder_text||AbstractChosen.default_multiple_text:this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||AbstractChosen.default_single_text,this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||AbstractChosen.default_no_result_text},AbstractChosen.prototype.choice_label=function(a){return this.include_group_label_in_selected&&null!=a.group_label?""+a.group_label+""+a.html:a.html},AbstractChosen.prototype.mouse_enter=function(){return this.mouse_on_container=!0},AbstractChosen.prototype.mouse_leave=function(){return this.mouse_on_container=!1},AbstractChosen.prototype.input_focus=function(a){var b=this;if(this.is_multiple){if(!this.active_field)return setTimeout(function(){return b.container_mousedown()},50)}else if(!this.active_field)return this.activate_field()},AbstractChosen.prototype.input_blur=function(a){var b=this;return this.mouse_on_container?void 0:(this.active_field=!1,setTimeout(function(){return b.blur_test()},100))},AbstractChosen.prototype.results_option_build=function(a){var b,c,d,e,f,g,h;for(b="",e=0,h=this.results_data,f=0,g=h.length;g>f&&(c=h[f],d="",d=c.group?this.result_add_group(c):this.result_add_option(c),""!==d&&(e++,b+=d),(null!=a?a.first:void 0)&&(c.selected&&this.is_multiple?this.choice_build(c):c.selected&&!this.is_multiple&&this.single_set_selected_text(this.choice_label(c))),!(e>=this.max_shown_results));f++);return b},AbstractChosen.prototype.result_add_option=function(a){var b,c;return a.search_match&&this.include_option_in_results(a)?(b=[],a.disabled||a.selected&&this.is_multiple||b.push("active-result"),!a.disabled||a.selected&&this.is_multiple||b.push("disabled-result"),a.selected&&b.push("result-selected"),null!=a.group_array_index&&b.push("group-option"),""!==a.classes&&b.push(a.classes),c=document.createElement("li"),c.className=b.join(" "),c.style.cssText=a.style,c.setAttribute("data-option-array-index",a.array_index),c.innerHTML=a.search_text,a.title&&(c.title=a.title),this.outerHTML(c)):""},AbstractChosen.prototype.result_add_group=function(a){var b,c;return(a.search_match||a.group_match)&&a.active_options>0?(b=[],b.push("group-result"),a.classes&&b.push(a.classes),c=document.createElement("li"),c.className=b.join(" "),c.innerHTML=a.search_text,a.title&&(c.title=a.title),this.outerHTML(c)):""},AbstractChosen.prototype.results_update_field=function(){return this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing?this.winnow_results():void 0},AbstractChosen.prototype.reset_single_select_options=function(){var a,b,c,d,e;for(d=this.results_data,e=[],b=0,c=d.length;c>b;b++)a=d[b],a.selected?e.push(a.selected=!1):e.push(void 0);return e},AbstractChosen.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},AbstractChosen.prototype.results_search=function(a){return this.results_showing?this.winnow_results():this.results_show()},AbstractChosen.prototype.winnow_results=function(){var a,b,c,d,e,f,g,h,i,j,k,l;for(this.no_results_clear(),d=0,f=this.get_search_text(),a=f.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),i=new RegExp(a,"i"),c=this.get_search_regex(a),l=this.results_data,j=0,k=l.length;k>j;j++)b=l[j],b.search_match=!1,e=null,this.include_option_in_results(b)&&(b.group&&(b.group_match=!1,b.active_options=0),null!=b.group_array_index&&this.results_data[b.group_array_index]&&(e=this.results_data[b.group_array_index],0===e.active_options&&e.search_match&&(d+=1),e.active_options+=1),b.search_text=b.group?b.label:b.html,(!b.group||this.group_search)&&(b.search_match=this.search_string_match(b.search_text,c),b.search_match&&!b.group&&(d+=1),b.search_match?(f.length&&(g=b.search_text.search(i),h=b.search_text.substr(0,g+f.length)+""+b.search_text.substr(g+f.length),b.search_text=h.substr(0,g)+""+h.substr(g)),null!=e&&(e.group_match=!0)):null!=b.group_array_index&&this.results_data[b.group_array_index].search_match&&(b.search_match=!0)));return this.result_clear_highlight(),1>d&&f.length?(this.update_results_content(""),this.no_results(f)):(this.update_results_content(this.results_option_build()),this.winnow_results_set_highlight())},AbstractChosen.prototype.get_search_regex=function(a){var b,c;return b=this.search_contains?"":"^",c=this.case_sensitive_search?"":"i",new RegExp(b+a,c)},AbstractChosen.prototype.search_string_match=function(a,b){var c,d,e,f;if(b.test(a))return!0;if(this.enable_split_word_search&&(a.indexOf(" ")>=0||0===a.indexOf("["))&&(d=a.replace(/\[|\]/g,"").split(" "),d.length))for(e=0,f=d.length;f>e;e++)if(c=d[e],b.test(c))return!0},AbstractChosen.prototype.choices_count=function(){var a,b,c,d;if(null!=this.selected_option_count)return this.selected_option_count;for(this.selected_option_count=0,d=this.form_field.options,b=0,c=d.length;c>b;b++)a=d[b],a.selected&&(this.selected_option_count+=1);return this.selected_option_count},AbstractChosen.prototype.choices_click=function(a){return a.preventDefault(),this.results_showing||this.is_disabled?void 0:this.results_show()},AbstractChosen.prototype.keyup_checker=function(a){var b,c;switch(b=null!=(c=a.which)?c:a.keyCode,this.search_field_scale(),b){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices_count()>0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:if(a.preventDefault(),this.results_showing)return this.result_select(a);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:case 18:break;default:return this.results_search()}},AbstractChosen.prototype.clipboard_event_checker=function(a){var b=this;return setTimeout(function(){return b.results_search()},50)},AbstractChosen.prototype.container_width=function(){return null!=this.options.width?this.options.width:""+this.form_field.offsetWidth+"px"},AbstractChosen.prototype.include_option_in_results=function(a){return this.is_multiple&&!this.display_selected_options&&a.selected?!1:!this.display_disabled_options&&a.disabled?!1:a.empty?!1:!0},AbstractChosen.prototype.search_results_touchstart=function(a){return this.touch_started=!0,this.search_results_mouseover(a)},AbstractChosen.prototype.search_results_touchmove=function(a){return this.touch_started=!1,this.search_results_mouseout(a)},AbstractChosen.prototype.search_results_touchend=function(a){return this.touch_started?this.search_results_mouseup(a):void 0},AbstractChosen.prototype.outerHTML=function(a){var b;return a.outerHTML?a.outerHTML:(b=document.createElement("div"),b.appendChild(a),b.innerHTML)},AbstractChosen.browser_is_supported=function(){return"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:/iP(od|hone)/i.test(window.navigator.userAgent)||/IEMobile/i.test(window.navigator.userAgent)||/Windows Phone/i.test(window.navigator.userAgent)||/BlackBerry/i.test(window.navigator.userAgent)||/BB10/i.test(window.navigator.userAgent)||/Android.*Mobile/i.test(window.navigator.userAgent)?!1:!0},AbstractChosen.default_multiple_text="Select Some Options",AbstractChosen.default_single_text="Select an Option",AbstractChosen.default_no_result_text="No results match",AbstractChosen}(),this.Chosen=function(b){function Chosen(){return a=Chosen.__super__.constructor.apply(this,arguments)}return c(Chosen,b),Chosen.prototype.setup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.is_rtl=this.form_field.hasClassName("chosen-rtl")},Chosen.prototype.set_default_values=function(){return Chosen.__super__.set_default_values.call(this),this.single_temp=new Template('#{default}
          '),this.multi_temp=new Template('
            '),this.no_results_temp=new Template('
          • '+this.results_none_found+' "#{terms}"
          • ')},Chosen.prototype.set_up_html=function(){var a,b;return a=["chosen-container"],a.push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&a.push(this.form_field.className),this.is_rtl&&a.push("chosen-rtl"),b={"class":a.join(" "),style:"width: "+this.container_width()+";",title:this.form_field.title},this.form_field.id.length&&(b.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=this.is_multiple?new Element("div",b).update(this.multi_temp.evaluate({"default":this.default_text})):new Element("div",b).update(this.single_temp.evaluate({"default":this.default_text})),this.form_field.hide().insert({after:this.container}),this.dropdown=this.container.down("div.chosen-drop"),this.search_field=this.container.down("input"),this.search_results=this.container.down("ul.chosen-results"),this.search_field_scale(),this.search_no_results=this.container.down("li.no-results"),this.is_multiple?(this.search_choices=this.container.down("ul.chosen-choices"),this.search_container=this.container.down("li.search-field")):(this.search_container=this.container.down("div.chosen-search"),this.selected_item=this.container.down(".chosen-single")),this.results_build(),this.set_tab_index(),this.set_label_behavior()},Chosen.prototype.on_ready=function(){return this.form_field.fire("chosen:ready",{chosen:this})},Chosen.prototype.register_observers=function(){var a=this;return this.container.observe("touchstart",function(b){return a.container_mousedown(b),b.preventDefault()}),this.container.observe("touchend",function(b){return a.container_mouseup(b),b.preventDefault()}),this.container.observe("mousedown",function(b){return a.container_mousedown(b)}),this.container.observe("mouseup",function(b){return a.container_mouseup(b)}),this.container.observe("mouseenter",function(b){return a.mouse_enter(b)}),this.container.observe("mouseleave",function(b){return a.mouse_leave(b)}),this.search_results.observe("mouseup",function(b){return a.search_results_mouseup(b)}),this.search_results.observe("mouseover",function(b){return a.search_results_mouseover(b)}),this.search_results.observe("mouseout",function(b){return a.search_results_mouseout(b)}),this.search_results.observe("mousewheel",function(b){return a.search_results_mousewheel(b)}),this.search_results.observe("DOMMouseScroll",function(b){return a.search_results_mousewheel(b)}),this.search_results.observe("touchstart",function(b){return a.search_results_touchstart(b)}),this.search_results.observe("touchmove",function(b){return a.search_results_touchmove(b)}),this.search_results.observe("touchend",function(b){return a.search_results_touchend(b)}),this.form_field.observe("chosen:updated",function(b){return a.results_update_field(b)}),this.form_field.observe("chosen:activate",function(b){return a.activate_field(b)}),this.form_field.observe("chosen:open",function(b){return a.container_mousedown(b)}),this.form_field.observe("chosen:close",function(b){return a.input_blur(b)}),this.search_field.observe("blur",function(b){return a.input_blur(b)}),this.search_field.observe("keyup",function(b){return a.keyup_checker(b)}),this.search_field.observe("keydown",function(b){return a.keydown_checker(b)}),this.search_field.observe("focus",function(b){return a.input_focus(b)}),this.search_field.observe("cut",function(b){return a.clipboard_event_checker(b)}),this.search_field.observe("paste",function(b){return a.clipboard_event_checker(b)}),this.is_multiple?this.search_choices.observe("click",function(b){return a.choices_click(b)}):this.container.observe("click",function(a){return a.preventDefault()})},Chosen.prototype.destroy=function(){return this.container.ownerDocument.stopObserving("click",this.click_test_action),this.form_field.stopObserving(),this.container.stopObserving(),this.search_results.stopObserving(),this.search_field.stopObserving(),null!=this.form_field_label&&this.form_field_label.stopObserving(),this.is_multiple?(this.search_choices.stopObserving(),this.container.select(".search-choice-close").each(function(a){return a.stopObserving()})):this.selected_item.stopObserving(),this.search_field.tabIndex&&(this.form_field.tabIndex=this.search_field.tabIndex),this.container.remove(),this.form_field.show()},Chosen.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field.disabled,this.is_disabled?(this.container.addClassName("chosen-disabled"),this.search_field.disabled=!0,this.is_multiple||this.selected_item.stopObserving("focus",this.activate_action),this.close_field()):(this.container.removeClassName("chosen-disabled"),this.search_field.disabled=!1,this.is_multiple?void 0:this.selected_item.observe("focus",this.activate_action))},Chosen.prototype.container_mousedown=function(a){return this.is_disabled||(a&&"mousedown"===a.type&&!this.results_showing&&a.stop(),null!=a&&a.target.hasClassName("search-choice-close"))?void 0:(this.active_field?this.is_multiple||!a||a.target!==this.selected_item&&!a.target.up("a.chosen-single")||this.results_toggle():(this.is_multiple&&this.search_field.clear(),this.container.ownerDocument.observe("click",this.click_test_action),this.results_show()),this.activate_field())},Chosen.prototype.container_mouseup=function(a){return"ABBR"!==a.target.nodeName||this.is_disabled?void 0:this.results_reset(a)},Chosen.prototype.search_results_mousewheel=function(a){var b;return b=a.deltaY||-a.wheelDelta||a.detail,null!=b?(a.preventDefault(),"DOMMouseScroll"===a.type&&(b=40*b),this.search_results.scrollTop=b+this.search_results.scrollTop):void 0},Chosen.prototype.blur_test=function(a){return!this.active_field&&this.container.hasClassName("chosen-container-active")?this.close_field():void 0},Chosen.prototype.close_field=function(){return this.container.ownerDocument.stopObserving("click",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClassName("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},Chosen.prototype.activate_field=function(){return this.container.addClassName("chosen-container-active"),this.active_field=!0,this.search_field.value=this.search_field.value,this.search_field.focus()},Chosen.prototype.test_active_click=function(a){return a.target.up(".chosen-container")===this.container?this.active_field=!0:this.close_field()},Chosen.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=SelectParser.select_to_array(this.form_field),this.is_multiple?this.search_choices.select("li.search-choice").invoke("remove"):this.is_multiple||(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field.readOnly=!0,this.container.addClassName("chosen-container-single-nosearch")):(this.search_field.readOnly=!1,this.container.removeClassName("chosen-container-single-nosearch"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},Chosen.prototype.result_do_highlight=function(a){var b,c,d,e,f;return this.result_clear_highlight(),this.result_highlight=a,this.result_highlight.addClassName("highlighted"),d=parseInt(this.search_results.getStyle("maxHeight"),10),f=this.search_results.scrollTop,e=d+f,c=this.result_highlight.positionedOffset().top,b=c+this.result_highlight.getHeight(),b>=e?this.search_results.scrollTop=b-d>0?b-d:0:f>c?this.search_results.scrollTop=c:void 0},Chosen.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClassName("highlighted"),this.result_highlight=null},Chosen.prototype.results_show=function(){return this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field.fire("chosen:maxselected",{chosen:this}),!1):(this.container.addClassName("chosen-with-drop"),this.results_showing=!0,this.search_field.focus(),this.search_field.value=this.search_field.value,this.winnow_results(),this.form_field.fire("chosen:showing_dropdown",{chosen:this}))},Chosen.prototype.update_results_content=function(a){return this.search_results.update(a)},Chosen.prototype.results_hide=function(){return this.results_showing&&(this.result_clear_highlight(),this.container.removeClassName("chosen-with-drop"),this.form_field.fire("chosen:hiding_dropdown",{chosen:this})),this.results_showing=!1},Chosen.prototype.set_tab_index=function(a){var b;return this.form_field.tabIndex?(b=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field.tabIndex=b):void 0},Chosen.prototype.set_label_behavior=function(){var a=this;return this.form_field_label=this.form_field.up("label"),null==this.form_field_label&&(this.form_field_label=$$("label[for='"+this.form_field.id+"']").first()),null!=this.form_field_label?this.form_field_label.observe("click",function(b){return a.is_multiple?a.container_mousedown(b):a.activate_field()}):void 0},Chosen.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.value=this.default_text,this.search_field.addClassName("default")):(this.search_field.value="",this.search_field.removeClassName("default"))},Chosen.prototype.search_results_mouseup=function(a){var b;return b=a.target.hasClassName("active-result")?a.target:a.target.up(".active-result"),b?(this.result_highlight=b,this.result_select(a),this.search_field.focus()):void 0},Chosen.prototype.search_results_mouseover=function(a){var b;return b=a.target.hasClassName("active-result")?a.target:a.target.up(".active-result"),b?this.result_do_highlight(b):void 0},Chosen.prototype.search_results_mouseout=function(a){return a.target.hasClassName("active-result")||a.target.up(".active-result")?this.result_clear_highlight():void 0},Chosen.prototype.choice_build=function(a){var b,c,d=this;return b=new Element("li",{"class":"search-choice"}).update(""+this.choice_label(a)+""),a.disabled?b.addClassName("search-choice-disabled"):(c=new Element("a",{href:"#","class":"search-choice-close",rel:a.array_index}),c.observe("click",function(a){return d.choice_destroy_link_click(a)}),b.insert(c)),this.search_container.insert({before:b})},Chosen.prototype.choice_destroy_link_click=function(a){return a.preventDefault(),a.stopPropagation(),this.is_disabled?void 0:this.choice_destroy(a.target)},Chosen.prototype.choice_destroy=function(a){return this.result_deselect(a.readAttribute("rel"))?(this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.search_field.value.length<1&&this.results_hide(),a.up("li").remove(),this.search_field_scale()):void 0},Chosen.prototype.results_reset=function(){return this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup(),"function"==typeof Event.simulate&&this.form_field.simulate("change"),this.active_field?this.results_hide():void 0},Chosen.prototype.results_reset_cleanup=function(){var a;return this.current_selectedIndex=this.form_field.selectedIndex,a=this.selected_item.down("abbr"),a?a.remove():void 0},Chosen.prototype.result_select=function(a){var b,c;return this.result_highlight?(b=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field.fire("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?b.removeClassName("active-result"):this.reset_single_select_options(),b.addClassName("result-selected"),c=this.results_data[b.getAttribute("data-option-array-index")],c.selected=!0,this.form_field.options[c.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(c):this.single_set_selected_text(this.choice_label(c)),(a.metaKey||a.ctrlKey)&&this.is_multiple||this.results_hide(),this.show_search_field_default(),"function"!=typeof Event.simulate||!this.is_multiple&&this.form_field.selectedIndex===this.current_selectedIndex||this.form_field.simulate("change"),this.current_selectedIndex=this.form_field.selectedIndex,a.preventDefault(),this.search_field_scale())):void 0},Chosen.prototype.single_set_selected_text=function(a){return null==a&&(a=this.default_text),a===this.default_text?this.selected_item.addClassName("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClassName("chosen-default")),this.selected_item.down("span").update(a)},Chosen.prototype.result_deselect=function(a){var b;return b=this.results_data[a],this.form_field.options[b.options_index].disabled?!1:(b.selected=!1,this.form_field.options[b.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),"function"==typeof Event.simulate&&this.form_field.simulate("change"),this.search_field_scale(),!0)},Chosen.prototype.single_deselect_control_build=function(){return this.allow_single_deselect?(this.selected_item.down("abbr")||this.selected_item.down("span").insert({after:''}),this.selected_item.addClassName("chosen-single-with-deselect")):void 0},Chosen.prototype.get_search_text=function(){return this.search_field.value.strip().escapeHTML()},Chosen.prototype.winnow_results_set_highlight=function(){var a;return this.is_multiple||(a=this.search_results.down(".result-selected.active-result")),null==a&&(a=this.search_results.down(".active-result")),null!=a?this.result_do_highlight(a):void 0},Chosen.prototype.no_results=function(a){return this.search_results.insert(this.no_results_temp.evaluate({terms:a})),this.form_field.fire("chosen:no_results",{chosen:this})},Chosen.prototype.no_results_clear=function(){var a,b;for(a=null,b=[];a=this.search_results.down(".no-results");)b.push(a.remove());return b},Chosen.prototype.keydown_arrow=function(){var a;return this.results_showing&&this.result_highlight?(a=this.result_highlight.next(".active-result"))?this.result_do_highlight(a):void 0:this.results_show()},Chosen.prototype.keyup_arrow=function(){var a,b,c;return this.results_showing||this.is_multiple?this.result_highlight?(c=this.result_highlight.previousSiblings(),a=this.search_results.select("li.active-result"),b=c.intersect(a),b.length?this.result_do_highlight(b.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight())):void 0:this.results_show()},Chosen.prototype.keydown_backstroke=function(){var a;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.down("a")),this.clear_backstroke()):(a=this.search_container.siblings().last(),a&&a.hasClassName("search-choice")&&!a.hasClassName("search-choice-disabled")?(this.pending_backstroke=a,this.pending_backstroke&&this.pending_backstroke.addClassName("search-choice-focus"),this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClassName("search-choice-focus")):void 0)},Chosen.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClassName("search-choice-focus"),this.pending_backstroke=null},Chosen.prototype.keydown_checker=function(a){var b,c;switch(b=null!=(c=a.which)?c:a.keyCode,this.search_field_scale(),8!==b&&this.pending_backstroke&&this.clear_backstroke(),b){case 8:this.backstroke_length=this.search_field.value.length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(a),this.mouse_on_container=!1;break;case 13:this.results_showing&&a.preventDefault();break;case 32:this.disable_search&&a.preventDefault();break;case 38:a.preventDefault(),this.keyup_arrow();break;case 40:a.preventDefault(),this.keydown_arrow()}},Chosen.prototype.search_field_scale=function(){var a,b,c,d,e,f,g,h,i;if(this.is_multiple){for(c=0,g=0,e="position:absolute; left: -1000px; top: -1000px; display:none;",f=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"],h=0,i=f.length;i>h;h++)d=f[h],e+=d+":"+this.search_field.getStyle(d)+";";return a=new Element("div",{style:e}).update(this.search_field.value.escapeHTML()),document.body.appendChild(a),g=Element.measure(a,"width")+25,a.remove(),b=this.container.getWidth(),g>b-10&&(g=b-10),this.search_field.setStyle({width:g+"px"})}},Chosen}(AbstractChosen)}).call(this); --------------------------------------------------------------------------------