1 line
1.2 MiB
JavaScript
1 line
1.2 MiB
JavaScript
|
function DataSetPoint(e,t,i,n,s,r,a,o,l,h,u){this.id=n,this.latitude=e,this.longitude=t,this.time=i,this.name=n,this.speed=s,this.altitude=r,this.address=a,this.icon=o,this.hasVoice=l,this.hasText=h,this.isInCall=u,DataSetPoint.prototype.merge=function(e){return _.extend(this,e),this},DataSetPoint.prototype.getNewIconsColor=function(){var e="default_size",t="#287aab",i=/_[0-9A-F]{6}_[sml]\./;if(this.icon&&i.test(this.icon)){var n=this.icon.split(/[_\.]/).slice(-3,-1);t="#"+n[0],e=n[1]}return{color:t,size:e}},DataSetPoint.prototype.getNewIconsSize=function(){var e=new google.maps.Point(16,48),t={s:new google.maps.Size(-6,-40),m:new google.maps.Size(-2,-33),l:new google.maps.Size(0,-24),default_size:new google.maps.Size(0,-25)},i=this.getNewIconsColor();return{labelOffset:t[i.size],labelColor:i.color,imageMarkerAnchor:e}}}function _toConsumableArray(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}function getHrefParam(e){var t=location.href.toLowerCase().split("?");return t.length>1&&(t=t[1].split("&").reduce(function(e,t){var i=t.split("=");return e[i[0]]=i[1],e},{})),t[e]||null}function splitString(e,t,i){for(var n=0,s=0;s<e.length;s++)if(e.charAt(s)===t&&n++,n>i)return log("-----------command split at index: "+i+" / "+e.length+" -----------"),e.slice(0,s);return e}function bindEvents(e,t,i,n){function s(i,n){var s=t.get("center"),r=t.get("zoom");e.centerZoom(s[0],s[1],r)}t.on("change:bounds",function(i,n){e.autosizeOnBounds(n),sendExecTimeSince("set-bounds",this.get("lastUpdated")),t.attributes.bounds=[]}),t.on("change:center change:zoom",s),t.on("change:dimmensions",function(t,i){e.resize(i[0],i[1]),console.log("dimmensions changed to:"+i)}),t.on("change:polygonToGet",function(t,i){var n=i.name;e.getPolygon(n)}),t.on("change:openedMarker",function(i,n){n&&(e.openInfoBubble(n),t.set("openedMarker",""))}),t.on("change:isReset",function(t,i){e.resetAll()}),t.on("change:console",function(e,t){var i=t?"show":"hide";$("#log-area")[i]()}),t.on("change:traffic",function(t,i){e.setTraffic(i)}),t.on("change:legacyicons",function(t,i){e.setLegacyIcons(i)}),t.on("change:isVisible",function(t,s){console.log("map visibility: "+s),s&&(i.forEach(function(t){t.get("isVisible")?t.get("isPolyline")?e.setPoly(!0,t.get("color"),t.get("thickness"),t.get("points"),t.id):e.putPoints(t.get("points"),!0,t.get("isShowLabels")):t.get("isPolyline")&&e.deletePoly(t.id)}),n.forEach(function(t){console.log(t.get("points").length),(t.get("points")||0!==t.get("points").length)&&e.setPolygon(t.id,t.get("color"),t.get("points"),t.get("opacity"),t.get("borderColor"),t.get("borderOpacity"),t.get("borderWidth"),t.get("thickness"))}))}),i.on("add",function(t){t.on("change:isVisible change:lastUpdated",function(t,i){var n="";this.get("isVisible")?this.get("isPolyline")||(e.putPoints(this.get("points"),this.get("isAutosize"),this.get("isShowLabels"),this.get("id")),n="put"):(n="lastUpdated"===Object.keys(t.changedAttributes())[0]?"update":"remove",e.removePoints(this.get("points")),this.get("isPolyline")&&e.deletePoly(this.id)),sendExecTimeSince(n,this.get("lastUpdated"))},t),t.on("change:isShowLabels",function(t,i){var n=i?"put":"remove";e[n+"Labels"](this.get("points")),sendExecTimeSince(n+"-labels",t.get("lastUpdated"))},t),t.on("change:isPolyline change:color",function(t,i){i&&(e.setPoly(!0,t.get("color"),t.get("thickness"),t.get("points"),t.id),t.set("isVisible",!0))})}),i.on("remove",function(e){e.attributes.lastUpdated=new Date,e.set("isVisible",!1),console.log("removed dataset ="+e.get("id"))}),n.on("add",function(t){console.log("polygon added"),t.get("points")&&0!=t.get("points").length?e.setPolygon(t.get("id"),t.get("color"),t.get("points"),t.get("opacity"),t.get("borderColor"),t.get("borderOpacity"),t.get("borderWidth")):e.newPolygon(t.get("id"),t.get("color"),t.get("opacity"),t.get("borderColor"),t.get("borderOpacity"),t.get("borderWidth")),t.on("change:isEditing",function(t,i){i?e.startEditPolygon(t.get("id")):e.endEditPolygon(t.get("id"))}),t.on("change:color change:opacity change:bord
|