PageSourceSearch

https://www.wisconsinvision.com/Content/GenCore/scripts/map/map-helpers.js?v=1.0

js wisconsinvision.com collected 2026-10-06 22:39:43 UTC 5,116 bytes, 99 lines download raw bytes

1// functions taken from Underscore.js
2// Underscore.js 1.8.3
3// http://underscorejs.org
4// (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
5// Underscore may be freely distributed under the MIT license.
6var _now=Date.now||function(){return(new Date).getTime()};
7var _debounce=function(func,wait,immediate){var timeout,args,context,timestamp,result;var later=function(){var last=_now()-timestamp;if(last<wait&&last>=0)timeout=setTimeout(later,wait-last);else{timeout=null;if(!immediate){result=func.apply(context,args);if(!timeout)context=args=null}}};return function(){context=this;args=arguments;timestamp=_now();var callNow=immediate&&!timeout;if(!timeout)timeout=setTimeout(later,wait);if(callNow){result=func.apply(context,args);context=args=null}return result}};
8
9/** String.includes polyfill from developer.mozilla.org */
10if(!String.prototype.includes)String.prototype.includes=function(search,start){'use strict';if(typeof start!=="number")start=0;if(start+search.length>this.length)return false;else return this.indexOf(search,start)!==-1};
11
12/* taken from A-Frame v0.4.0 | MIT License | https://github.com/aframevr/aframe */
13function getUrlParameter(name) {
14    name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
15    var regex = new RegExp('[\\?&]' + name + '=([^&#]*)');
16    var results = regex.exec(location.search);
17    return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
18}
19
20var defaultCoordinates = { "lat": 43.5, "lng": -88.7 };
21var biasBounds = { 'north': 47.102293, 'south': 42.486130, 'east': -87.034799, 'west': -92.775380 };
22
23var marker_store = {
24path: "M21,57c-1-1.3-2.1-2.6-3.1-3.9c-3.9-5-7.6-10.1-11-15.4c-2-3.2-4-6.5-5.3-10.1c-1.8-5.2-1.5-10.4,0.8-15.4 C5.4,6,10.2,2.1,16.8,0.7c5.9-1.3,11.4-0.1,16.3,3.5c4.7,3.4,7.5,8.1,8.3,13.8c0.7,4.9-0.4,9.4-2.8,13.7c-5,9-11.2,17-17.5,25.1 C21.2,56.8,21.1,56.8,21,57z M11,20.9C11,26.5,15.5,31,21.1,31c5.6,0,10.2-4.6,10.1-10.2c0-5.7-4.6-10.2-10.2-10.1 C15.5,10.7,11,15.3,11,20.9z",
25    anchor: { "x": 19.82, "y": 55.38 },
26    fillColor: "#bca089",
27    fillOpacity: 1,
28    scale: 1,
29    strokeColor: '#FFF',
30    strokeOpacity: 0.9,
31    strokeWeight: 1
32};
33var marker_user_lead = {
34    path: "M39.67,19.89A20,20,0,0,0,19.83,0,20,20,0,0,0,0,19.89C0,31.19,18,53,19.83,55.22,21.71,53,39.67,31.19,39.67,19.89Zm-32.46,0A12.63,12.63,0,1,1,19.83,32.57,12.68,12.68,0,0,1,7.2,19.89Z",
35    anchor: { "x": 19.82, "y": 55.38 },
36    fillColor: "#7f7f7f",
37    fillOpacity: 1,
38    scale: 0.8,
39    strokeColor: '#000',
40    strokeOpacity: 0.25,
41    strokeWeight: 1
42};
43var map_cluster_options = {
44    minimumClusterSize: 15,
45    maxZoom: 14,
46    styles: [
47        { url: '/Content/images/map/PinGroup1.svg', height: 36, width: 36, anchor: [36, 36], textColor: '#fff', textSize: 8 },
48        { url: '/Content/images/map/PinGroup2.svg', height: 42, width: 42, anchor: [42, 42], textColor: '#fff', textSize: 9 },
49        { url: '/Content/images/map/PinGroup3.svg', height: 48, width: 48, anchor: [48, 48], textColor: '#fff', textSize: 10 },
50        { url: '/Content/images/map/PinGroup4.svg', height: 54, width: 54, anchor: [54, 54], textColor: '#fff', textSize: 10 },
51        { url: '/Content/images/map/PinGroup5.svg', height: 60, width: 60, anchor: [60, 60], textColor: '#fff', textSize: 10 },
52    ]
53};
54
55/**
56 * Create a store representing this data.
57 * @constructor
58 * @param {Object} storedata - store data object sent from server.
59 * @param {boolean} isAdvanced - if advanced operations will be performed on this object, set this to true, otherwise ignore the parameter.
60 */
61function Store(storedata) {
62    this.id = parseInt(storedata["id"]);
63    this.coordinates = {
64        lat: parseFloat(storedata["geo_lat"]),
65        lng: parseFloat(storedata["geo_long"])
66    };
67    this.hasCoordinates = function() {
68        return !(isNaN(this.coordinates.lat) || isNaN(this.coordinates.lng))
69    };
70    this.address = {
71        street: storedata["address_street"],
72        city: storedata["address_city"],
73        state: storedata["address_state"],
74        zip: storedata["address_zip"],
75        formatted: storedata["formatted_address"]
76    };
77    //this.zoom = parseFloat(storedata["zoom"]);
78    this.displayName = storedata["displayName"];
79    this.phone = storedata["phone"];
80    this.genUrl = storedata["genUrl"];
81    this.schedulerLink = storedata["schedulerLink"];
82    this.toDataObject = function() {
83        var obj = {};
84        obj.id = this.id;
85        obj.displayName = this.displayName;
86        obj.geo_lat = this.coordinates.lat;
87        obj.geo_long = this.coordinates.lng;
88        obj.address_street = this.address.street;
89        obj.address_city = this.address.city;
90        obj.address_state = this.address.state;
91        obj.address_zip = this.address.zip;
92        obj.formatted_address = this.address.formatted;
93        obj.phone = this.phone;
94        obj.genUrl = this.genUrl;
95        obj.schedulerLink = this.schedulerLink;
96        //obj.zoom = this.zoom;
97        return obj;
98    }
99}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.