From 5bcca8a1c038754ada486e6961030c9429c58dd0 Mon Sep 17 00:00:00 2001 From: wlx Date: Sat, 31 Jan 2015 07:21:54 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9timemap=E4=B8=BAopenlayers?= =?UTF-8?q?=EF=BC=8C=E8=B0=83=E7=94=A8osm=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../default/views/scripts/data/timemap.phtml | 55 +++++------------- htdocs/images/orange-dot.png | Bin 0 -> 3443 bytes htdocs/js/timemap.2.0.1/timemap.pack.js | 2 +- 3 files changed, 16 insertions(+), 41 deletions(-) create mode 100644 htdocs/images/orange-dot.png diff --git a/application/default/views/scripts/data/timemap.phtml b/application/default/views/scripts/data/timemap.phtml index 365793d9..400683a6 100644 --- a/application/default/views/scripts/data/timemap.phtml +++ b/application/default/views/scripts/data/timemap.phtml @@ -3,62 +3,42 @@ $this->headTitle($this->config->title->site); $this->headTitle($this->config->title->data); $this->headTitle('时空导航'); $this->headTitle()->setSeparator(' - '); -//$this->headLink()->appendStylesheet('/css/metadata.css'); -$this->theme->AppendPlus($this,'google_map_v3'); -$this->theme->AppendPlus($this,'colorbox'); +//$this->theme->AppendPlus($this,'google_map_v3'); +//$this->theme->AppendPlus($this,'colorbox'); +$this->headScript()->appendFile('/js/OpenLayers.js'); $this->headScript()->appendFile('/js/timeline_var.js'); $this->headScript()->appendFile('/js/timeline_js/timeline-api.js'); -$this->headScript()->appendFile('/js/timemap.2.0.1/lib/mxn/mxn.js?(googlev3)'); +$this->headScript()->appendFile('/js/timemap.2.0.1/lib/mxn/mxn.js?(openlayers)'); $this->headScript()->appendFile('/js/timemap.2.0.1/timemap.pack.js'); $this->nav[] = array('link'=>"/data/timemap",'title'=>'时空导航'); ?> -
partial('data/tools.phtml'); ?>
+
render('breadcrumbs.phtml'); ?>partial('data/tools.phtml'); ?>
-
-
+
+
\ No newline at end of file diff --git a/htdocs/images/orange-dot.png b/htdocs/images/orange-dot.png new file mode 100644 index 0000000000000000000000000000000000000000..db63b26a1e3011cbcdd558c976849d4fa426e4da GIT binary patch literal 3443 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[J].eventSource=D[0].eventSource}});I.eventSource=D[0].eventSource;w=(D[0]&&D[0].eventSource)||new h.DefaultEventSource();if(v.bands){v.bands.forEach(function(x){if(x.eventSource!==null){x.eventSource=w}});z=v.bands}else{v.bandInfo.forEach(function(K,J){if(!(("eventSource" in K)&&!K.eventSource)){K.eventSource=w}else{K.eventSource=null}z[J]=h.createBandInfo(K);if(J>0&&b.TimelineVersion()=="1.2"){z[J].eventPainter.setLayout(z[0].eventPainter.getLayout())}})}I.initTimeline(z);var E=l.loadManager,H=function(){E.increment()};E.init(I,v.datasets.length,v);v.datasets.forEach(function(P,K){var Q=D[K],M=P.data||P.options||{},O=P.type||M.type,N=(typeof O=="string")?l.loaders[O]:O,J=new N(M);J.load(Q,H)});return I};l.prototype={initMap:function(){var t=this,u=t.opts,w,v;t.map=w=new s(t.mElement,u.mapProvider);w.setCenterAndZoom(u.mapCenter,u.mapZoom);w.addControls({pan:u.showMapCtrl,zoom:u.showMapCtrl?"large":false,map_type:u.showMapTypeCtrl});w.setMapType(u.mapType);if(u.multipleInfoWindows){w.setOption("enableMultipleBubbles",true)}t.getNativeMap=function(){return w.getMap()}},initTimeline:function(w){var C=this,B,u=C.opts,D=function(x){return x.visible},v=function(x){return x.dataset.visible},y=function(E,G,F){F.item.openInfoWindow()},t,A,z;for(A=1;A0?true:false;switch(t){case"now":break;case"earliest":case"first":if(w){v=u.getEarliestDate()}break;case"latest":case"last":if(w){v=u.getLatestDate()}break;default:v=x(t)}return v},scrollToDate:function(z,A,y){var G=this.timeline,u=G.getBand(0),D,v,E=[],F,w,t;z=this.parseDate(z);if(z){v=z.getTime();for(D=0;Dw&&v=t.target){t.complete()}};t.complete=function(){var u=t.tm,w=t.opts,v=w.dataLoadedFunction;if(v){v(u)}else{u.scrollToDate(w.scrollTo,true);if(u.initState){u.initState()}v=w.dataDisplayedFunction;if(v){v(u)}}}}();l.loaders={cb:{},cancel:function(u){var t=l.loaders.cb;t[u]=function(){delete t[u]}},cancelAll:function(){var t=l.loaders,u=t.cb,v;for(v in u){if(u.hasOwnProperty(v)){t.cancel(v)}}},counter:0,base:function(u){var v=function(w){return w},t=this;t.parse=u.parserFunction||v;t.preload=u.preloadFunction||v;t.transform=u.transformFunction||v;t.scrollTo=u.scrollTo||"earliest";t.getCallbackName=function(y,z){var w=l.loaders.cb,x="_"+l.loaders.counter++;z=z||function(){y.timemap.scrollToDate(t.scrollTo,true)};w[x]=function(A){var B=t.parse(A);B=t.preload(B);y.loadItems(B,t.transform);z();delete w[x]};return x};t.getCallback=function(x,y){var w=t.getCallbackName(x,y);return l.loaders.cb[w]};t.cancel=function(){l.loaders.cancel(t.callbackName)}},basic:function(u){var t=new l.loaders.base(u);t.data=u.items||u.value||[];t.load=function(v,w){(this.getCallback(v,w))(this.data)};return t},remote:function(u){var t=new l.loaders.base(u);t.opts=d.extend({},u,{type:"GET",dataType:"text"});t.load=function(v,w){t.callbackName=t.getCallbackName(v,w);t.opts.success=l.loaders.cb[t.callbackName];d.ajax(t.opts)};return t}};p=function(v,u,t,A,x,w){var y=this,z=d.noop;y.timemap=v;y.chain=w||[];y.on=u||z;y.off=t||z;y.pre=A||z;y.post=x||z};p.prototype={add:function(t){return this.chain.push(t)},remove:function(v){var u=this.chain,t=v?u.indexOf(v):u.length-1;return u.splice(t,1)},run:function(){var u=this,t=u.chain;if(!t.length){return}u.pre();u.timemap.eachItem(function(x){var v,w=t.length;L:while(!v){while(w--){if(!t[w](x)){u.off(x);break L}}u.on(x);v=true}});u.post()}};l.filters={hidePastFuture:function(t){return t.onVisibleTimeline()},hideFuture:function(v){var u=v.timeline.getBand(0).getMaxVisibleDate().getTime(),t=v.getStartTime();if(t!==g){return tx||t>x)}return true}};n=function(t,u){var v=this;v.timemap=t;v.eventSource=new h.DefaultEventSource();v.items=[];v.visible=true;v.opts=u=d.extend({},t.opts,u);u.dateParser=b.lookup(u.dateParser,l.dateParsers);u.theme=m.create(u.theme,u)};n.prototype={getItems:function(u){var t=this.items;return u===g?t:u in t?t[u]:null},getTitle:function(){return this.opts.title},each:function(t){this.items.forEach(t)},loadItems:function(v,t){if(v){var u=this;v.forEach(function(w){u.loadItem(w,t)});d(u).trigger(r)}},loadItem:function(w,t){if(t){w=t(w)}if(w){var v=this,u;w.options=d.extend({},v.opts,{title:null},w.options);u=new e(w,v);v.items.push(u);return u}}};m=function(t){var v={color:"#FE766A",lineOpacity:1,lineWeight:2,fillOpacity:0.4,eventTextColor:null,eventIconPath:"timemap/images/",eventIconImage:"red-circle.png",classicTape:false,icon:k+"red-dot.png",iconSize:[32,32],iconShadow:k+"msmarker.shadow.png",iconShadowSize:[59,32],iconAnchor:[16,33]};var u=d.extend(v,t);v={lineColor:u.color,fillColor:u.color,eventColor:u.color,eventIcon:u.eventIcon||u.eventIconPath+u.eventIconImage};return d.extend(v,u)};m.create=function(v,t){v=b.lookup(v,l.themes);if(!v){return new m(t)}if(t){var w=false,u;for(u in t){if(v.hasOwnProperty(u)){w={};break}}if(w){for(u in v){if(v.hasOwnProperty(u)){w[u]=t[u]||v[u]}}w.eventIcon=t.eventIcon||w.eventIconPath+w.eventIconImage;return w}}return v};e=function(O,F){var M=this,z=d.extend({type:"none",description:"",infoPoint:null,infoHtml:"",infoUrl:"",openInfoWindow:O.options.infoUrl?e.openInfoWindowAjax:e.openInfoWindowBasic,infoTemplate:'
{{title}}
{{description}}
',templatePattern:/\{\{([^}]+)\}\}/g,closeInfoWindow:e.closeInfoWindowBasic},O.options),x=F.timemap,N=z.theme=m.create(z.theme,z),w=z.dateParser,E=h.DefaultEventSource.Event,C=O.start,A=O.end,u=N.eventIcon,B=N.eventTextColor,P=z.title=O.title||"Untitled",J=null,v,D=[],H=[],t=null,y="",I=null,K;M.dataset=F;M.map=x.map;M.timeline=x.timeline;M.opts=z;C=C?w(C):null;A=A?w(A):null;v=!A;if(C!==null){if(b.TimelineVersion()=="1.2"){J=new E(C,A,null,null,v,P,null,null,null,u,N.eventColor,N.eventTextColor)}else{if(!B){B=(N.classicTape&&!v)?"#FFFFFF":"#000000"}J=new E({start:C,end:A,instant:v,text:P,icon:u,color:N.eventColor,textColor:B})}J.item=M;if(!z.noEventLoad){F.eventSource.add(J)}}M.event=J;function G(U){var T=null,W="",Z=null,ac;if(U.point){var V=U.point.lat,Q=U.point.lon;if(V===g||Q===g){return T}Z=new c(parseFloat(V),parseFloat(Q));T=new f(Z);T.setLabel(U.title);T.addData(N);W="marker"}else{if(U.polyline||U.polygon){var aa=[],R="polygon" in U,ab=U.polyline||U.polygon,X;ac=new a();if(ab&&ab.length){for(X=0;X1?"array":y;z.infoPoint=z.infoPoint?new c(parseFloat(z.infoPoint.lat),parseFloat(z.infoPoint.lon)):I;D.forEach(function(Q){Q.item=M;Q.click.addHandler(function(){M.openInfoWindow()});if(!z.noPlacemarkLoad){if(b.getPlacemarkType(Q)=="marker"){x.map.addMarker(Q)}else{x.map.addPolyline(Q)}Q.hide()}});M.placemark=D.length==1?D[0]:D.length?D:null;M.getNativePlacemark=function(){var Q=M.placemark;return Q&&(Q.proprietary_marker||Q.proprietary_polyline)};M.getType=function(){return z.type};M.getTitle=function(){return z.title};M.getInfoPoint=function(){return z.infoPoint||M.map.getCenter()};M.getStart=function(){return M.event?M.event.getStart():null};M.getEnd=function(){return M.event?M.event.getEnd():null};M.getStartTime=function(){var Q=M.getStart();if(Q){return Q.getTime()}};M.getEndTime=function(){var Q=M.getEnd();if(Q){return Q.getTime()}};M.isSelected=function(){return x.getSelected()===M};M.visible=true;M.placemarkVisible=false;M.eventVisible=true;M.openInfoWindow=function(){z.openInfoWindow.call(M);x.setSelected(M)};M.closeInfoWindow=function(){z.closeInfoWindow.call(M);x.setSelected(g)}};e.prototype={showPlacemark:function(){var t=this,u=function(v){if(v.api){v.show()}};if(t.placemark&&!t.placemarkVisible){if(t.getType()=="array"){t.placemark.forEach(u)}else{u(t.placemark)}t.placemarkVisible=true}},hidePlacemark:function(){var t=this,u=function(v){if(v.api){v.hide()}};if(t.placemark&&t.placemarkVisible){if(t.getType()=="array"){t.placemark.forEach(u)}else{u(t.placemark)}t.placemarkVisible=false}t.closeInfoWindow()},showEvent:function(){var u=this,t=u.event;if(t&&!u.eventVisible){u.timeline.getBand(0).getEventSource()._events._events.add(t);u.eventVisible=true}},hideEvent:function(){var u=this,t=u.event;if(t&&u.eventVisible){u.timeline.getBand(0).getEventSource()._events._events.remove(t);u.eventVisible=false}},scrollToStart:function(u){var t=this;if(t.event){t.dataset.timemap.scrollToDate(t.getStart(),false,u)}},getInfoHtml:function(){var v=this.opts,u=v.infoHtml,w=v.templatePattern,t;if(!u){u=v.infoTemplate;t=w.exec(u);while(t){u=u.replace(t[0],v[t[1]]||"");t=w.exec(u)}v.infoHtml=u}return u},onVisibleTimeline:function(){var w=this,y=w.timeline.getBand(0),u=y.getMaxVisibleDate().getTime(),v=y.getMinVisibleDate().getTime(),t=w.getStartTime(),x=w.getEndTime();return t!==g?tv||t>v):true}};e.openInfoWindowBasic=function(){var v=this,u=v.getInfoHtml(),w=v.dataset,t=v.placemark;if(!v.onVisibleTimeline()){w.timemap.scrollToDate(v.getStart())}if(v.getType()=="marker"&&t.api){t.setInfoBubble(u);t.openBubble();v.closeHandler=t.closeInfoBubble.addHandler(function(){w.timemap.setSelected(g);t.closeInfoBubble.removeHandler(v.closeHandler)})}else{v.map.openBubble(v.getInfoPoint(),u);v.map.tmBubbleItem=v}};e.openInfoWindowAjax=function(){var t=this;if(!t.opts.infoHtml&&t.opts.infoUrl){d.get(t.opts.infoUrl,function(u){t.opts.infoHtml=u;t.openInfoWindow()});return}t.openInfoWindow=function(){e.openInfoWindowBasic.call(t);t.dataset.timemap.setSelected(t)};t.openInfoWindow()};e.closeInfoWindowBasic=function(){var t=this;if(t.getType()=="marker"){t.placemark.closeBubble()}else{if(t==t.map.tmBubbleItem){t.map.closeBubble();t.map.tmBubbleItem=null}}};l.util.getTagValue=function(v,t,u){return b.getNodeList(v,t,u).first().text()};l.util.nsMap={};l.util.getNodeList=function(w,u,v){var t=l.util.nsMap;w=w.jquery?w[0]:w;return !w?d():!v?d(u,w):(w.getElementsByTagNameNS&&t[v])?d(w.getElementsByTagNameNS(t[v],u)):d(w.getElementsByTagName(v+":"+u))};l.util.makePoint=function(u,v){var t=null;if(u.lat&&u.lng){t=[u.lat(),u.lng()]}if(d.type(u)=="array"){t=u}if(!t){u=d.trim(u);if(u.indexOf(",")>-1){t=u.split(",")}else{t=u.split(/[\r\n\f ]+/)}}if(t.length>2){t=t.slice(0,2)}if(v){t.reverse()}return{lat:d.trim(t[0]),lon:d.trim(t[1])}};l.util.makePoly=function(w,z){var v=[],u,t,y=d.trim(w).split(/[\r\n\f ]+/);for(t=0;t0)?y[t].split(","):[y[t],y[++t]];if(u.length>2){u=u.slice(0,2)}if(z){u.reverse()}v.push({lat:u[0],lon:u[1]})}return v};l.util.formatDate=function(z,y){y=y||3;var A="";if(z){var x=z.getUTCFullYear(),u=z.getUTCMonth(),B=z.getUTCDate();if(x<1000){return(x<1?(x*-1+"BC"):x+"")}if(z.toISOString&&y==3){return z.toISOString()}var t=function(D){return((D<10)?"0":"")+D};A+=x+"-"+t(u+1)+"-"+t(B);if(y>1){var v=z.getUTCHours(),w=z.getUTCMinutes(),C=z.getUTCSeconds();A+="T"+t(v)+":"+t(w);if(y>2){A+=t(C)}A+="Z"}}return A};l.util.TimelineVersion=function(){return h.version||(h.DurationEventPainter?"1.2":"2.2.0")};l.util.getPlacemarkType=function(t){return t.constructor==f?"marker":t.constructor==o?(t.closed?"polygon":"polyline"):false};l.util.lookup=function(t,u){return typeof t=="string"?u[t]:t};if(!([].indexOf)){Array.prototype.indexOf=function(v){var t=this,u=t.length;while(--u>=0){if(t[u]===v){break}}return u}}if(!([].forEach)){Array.prototype.forEach=function(v){var t=this,u;for(u=0;u0){D[J].eventSource=D[0].eventSource}});I.eventSource=D[0].eventSource;w=(D[0]&&D[0].eventSource)||new h.DefaultEventSource();if(v.bands){v.bands.forEach(function(x){if(x.eventSource!==null){x.eventSource=w}});z=v.bands}else{v.bandInfo.forEach(function(K,J){if(!(("eventSource" in K)&&!K.eventSource)){K.eventSource=w}else{K.eventSource=null}z[J]=h.createBandInfo(K);if(J>0&&b.TimelineVersion()=="1.2"){z[J].eventPainter.setLayout(z[0].eventPainter.getLayout())}})}I.initTimeline(z);var E=l.loadManager,H=function(){E.increment()};E.init(I,v.datasets.length,v);v.datasets.forEach(function(P,K){var Q=D[K],M=P.data||P.options||{},O=P.type||M.type,N=(typeof O=="string")?l.loaders[O]:O,J=new N(M);J.load(Q,H)});return I};l.prototype={initMap:function(){var t=this,u=t.opts,w,v;t.map=w=new s(t.mElement,u.mapProvider);w.setCenterAndZoom(u.mapCenter,u.mapZoom);w.addControls({pan:u.showMapCtrl,zoom:u.showMapCtrl?"large":false,map_type:u.showMapTypeCtrl});w.setMapType(u.mapType);if(u.multipleInfoWindows){w.setOption("enableMultipleBubbles",true)}t.getNativeMap=function(){return w.getMap()}},initTimeline:function(w){var C=this,B,u=C.opts,D=function(x){return x.visible},v=function(x){return x.dataset.visible},y=function(E,G,F){F.item.openInfoWindow()},t,A,z;for(A=1;A0?true:false;switch(t){case"now":break;case"earliest":case"first":if(w){v=u.getEarliestDate()}break;case"latest":case"last":if(w){v=u.getLatestDate()}break;default:v=x(t)}return v},scrollToDate:function(z,A,y){var G=this.timeline,u=G.getBand(0),D,v,E=[],F,w,t;z=this.parseDate(z);if(z){v=z.getTime();for(D=0;Dw&&v=t.target){t.complete()}};t.complete=function(){var u=t.tm,w=t.opts,v=w.dataLoadedFunction;if(v){v(u)}else{u.scrollToDate(w.scrollTo,true);if(u.initState){u.initState()}v=w.dataDisplayedFunction;if(v){v(u)}}}}();l.loaders={cb:{},cancel:function(u){var t=l.loaders.cb;t[u]=function(){delete t[u]}},cancelAll:function(){var t=l.loaders,u=t.cb,v;for(v in u){if(u.hasOwnProperty(v)){t.cancel(v)}}},counter:0,base:function(u){var v=function(w){return w},t=this;t.parse=u.parserFunction||v;t.preload=u.preloadFunction||v;t.transform=u.transformFunction||v;t.scrollTo=u.scrollTo||"earliest";t.getCallbackName=function(y,z){var w=l.loaders.cb,x="_"+l.loaders.counter++;z=z||function(){y.timemap.scrollToDate(t.scrollTo,true)};w[x]=function(A){var B=t.parse(A);B=t.preload(B);y.loadItems(B,t.transform);z();delete w[x]};return x};t.getCallback=function(x,y){var w=t.getCallbackName(x,y);return l.loaders.cb[w]};t.cancel=function(){l.loaders.cancel(t.callbackName)}},basic:function(u){var t=new l.loaders.base(u);t.data=u.items||u.value||[];t.load=function(v,w){(this.getCallback(v,w))(this.data)};return t},remote:function(u){var t=new l.loaders.base(u);t.opts=d.extend({},u,{type:"GET",dataType:"text"});t.load=function(v,w){t.callbackName=t.getCallbackName(v,w);t.opts.success=l.loaders.cb[t.callbackName];d.ajax(t.opts)};return t}};p=function(v,u,t,A,x,w){var y=this,z=d.noop;y.timemap=v;y.chain=w||[];y.on=u||z;y.off=t||z;y.pre=A||z;y.post=x||z};p.prototype={add:function(t){return this.chain.push(t)},remove:function(v){var u=this.chain,t=v?u.indexOf(v):u.length-1;return u.splice(t,1)},run:function(){var u=this,t=u.chain;if(!t.length){return}u.pre();u.timemap.eachItem(function(x){var v,w=t.length;L:while(!v){while(w--){if(!t[w](x)){u.off(x);break L}}u.on(x);v=true}});u.post()}};l.filters={hidePastFuture:function(t){return t.onVisibleTimeline()},hideFuture:function(v){var u=v.timeline.getBand(0).getMaxVisibleDate().getTime(),t=v.getStartTime();if(t!==g){return tx||t>x)}return true}};n=function(t,u){var v=this;v.timemap=t;v.eventSource=new h.DefaultEventSource();v.items=[];v.visible=true;v.opts=u=d.extend({},t.opts,u);u.dateParser=b.lookup(u.dateParser,l.dateParsers);u.theme=m.create(u.theme,u)};n.prototype={getItems:function(u){var t=this.items;return u===g?t:u in t?t[u]:null},getTitle:function(){return this.opts.title},each:function(t){this.items.forEach(t)},loadItems:function(v,t){if(v){var u=this;v.forEach(function(w){u.loadItem(w,t)});d(u).trigger(r)}},loadItem:function(w,t){if(t){w=t(w)}if(w){var v=this,u;w.options=d.extend({},v.opts,{title:null},w.options);u=new e(w,v);v.items.push(u);return u}}};m=function(t){var v={color:"#FE766A",lineOpacity:1,lineWeight:2,fillOpacity:0.4,eventTextColor:null,eventIconPath:"timemap/images/",eventIconImage:"red-circle.png",classicTape:false,icon:k+"red-dot.png",iconSize:[32,32],iconShadow:k+"msmarker.shadow.png",iconShadowSize:[59,32],iconAnchor:[16,33]};var u=d.extend(v,t);v={lineColor:u.color,fillColor:u.color,eventColor:u.color,eventIcon:u.eventIcon||u.eventIconPath+u.eventIconImage};return d.extend(v,u)};m.create=function(v,t){v=b.lookup(v,l.themes);if(!v){return new m(t)}if(t){var w=false,u;for(u in t){if(v.hasOwnProperty(u)){w={};break}}if(w){for(u in v){if(v.hasOwnProperty(u)){w[u]=t[u]||v[u]}}w.eventIcon=t.eventIcon||w.eventIconPath+w.eventIconImage;return w}}return v};e=function(O,F){var M=this,z=d.extend({type:"none",description:"",infoPoint:null,infoHtml:"",infoUrl:"",openInfoWindow:O.options.infoUrl?e.openInfoWindowAjax:e.openInfoWindowBasic,infoTemplate:'
{{title}}
{{description}}
',templatePattern:/\{\{([^}]+)\}\}/g,closeInfoWindow:e.closeInfoWindowBasic},O.options),x=F.timemap,N=z.theme=m.create(z.theme,z),w=z.dateParser,E=h.DefaultEventSource.Event,C=O.start,A=O.end,u=N.eventIcon,B=N.eventTextColor,P=z.title=O.title||"Untitled",J=null,v,D=[],H=[],t=null,y="",I=null,K;M.dataset=F;M.map=x.map;M.timeline=x.timeline;M.opts=z;C=C?w(C):null;A=A?w(A):null;v=!A;if(C!==null){if(b.TimelineVersion()=="1.2"){J=new E(C,A,null,null,v,P,null,null,null,u,N.eventColor,N.eventTextColor)}else{if(!B){B=(N.classicTape&&!v)?"#FFFFFF":"#000000"}J=new E({start:C,end:A,instant:v,text:P,icon:u,color:N.eventColor,textColor:B})}J.item=M;if(!z.noEventLoad){F.eventSource.add(J)}}M.event=J;function G(U){var T=null,W="",Z=null,ac;if(U.point){var V=U.point.lat,Q=U.point.lon;if(V===g||Q===g){return T}Z=new c(parseFloat(V),parseFloat(Q));T=new f(Z);T.setLabel(U.title);T.addData(N);W="marker"}else{if(U.polyline||U.polygon){var aa=[],R="polygon" in U,ab=U.polyline||U.polygon,X;ac=new a();if(ab&&ab.length){for(X=0;X1?"array":y;z.infoPoint=z.infoPoint?new c(parseFloat(z.infoPoint.lat),parseFloat(z.infoPoint.lon)):I;D.forEach(function(Q){Q.item=M;Q.click.addHandler(function(){M.openInfoWindow()});if(!z.noPlacemarkLoad){if(b.getPlacemarkType(Q)=="marker"){x.map.addMarker(Q)}else{x.map.addPolyline(Q)}Q.hide()}});M.placemark=D.length==1?D[0]:D.length?D:null;M.getNativePlacemark=function(){var Q=M.placemark;return Q&&(Q.proprietary_marker||Q.proprietary_polyline)};M.getType=function(){return z.type};M.getTitle=function(){return z.title};M.getInfoPoint=function(){return z.infoPoint||M.map.getCenter()};M.getStart=function(){return M.event?M.event.getStart():null};M.getEnd=function(){return M.event?M.event.getEnd():null};M.getStartTime=function(){var Q=M.getStart();if(Q){return Q.getTime()}};M.getEndTime=function(){var Q=M.getEnd();if(Q){return Q.getTime()}};M.isSelected=function(){return x.getSelected()===M};M.visible=true;M.placemarkVisible=false;M.eventVisible=true;M.openInfoWindow=function(){z.openInfoWindow.call(M);x.setSelected(M)};M.closeInfoWindow=function(){z.closeInfoWindow.call(M);x.setSelected(g)}};e.prototype={showPlacemark:function(){var t=this,u=function(v){if(v.api){v.show()}};if(t.placemark&&!t.placemarkVisible){if(t.getType()=="array"){t.placemark.forEach(u)}else{u(t.placemark)}t.placemarkVisible=true}},hidePlacemark:function(){var t=this,u=function(v){if(v.api){v.hide()}};if(t.placemark&&t.placemarkVisible){if(t.getType()=="array"){t.placemark.forEach(u)}else{u(t.placemark)}t.placemarkVisible=false}t.closeInfoWindow()},showEvent:function(){var u=this,t=u.event;if(t&&!u.eventVisible){u.timeline.getBand(0).getEventSource()._events._events.add(t);u.eventVisible=true}},hideEvent:function(){var u=this,t=u.event;if(t&&u.eventVisible){u.timeline.getBand(0).getEventSource()._events._events.remove(t);u.eventVisible=false}},scrollToStart:function(u){var t=this;if(t.event){t.dataset.timemap.scrollToDate(t.getStart(),false,u)}},getInfoHtml:function(){var v=this.opts,u=v.infoHtml,w=v.templatePattern,t;if(!u){u=v.infoTemplate;t=w.exec(u);while(t){u=u.replace(t[0],v[t[1]]||"");t=w.exec(u)}v.infoHtml=u}return u},onVisibleTimeline:function(){var w=this,y=w.timeline.getBand(0),u=y.getMaxVisibleDate().getTime(),v=y.getMinVisibleDate().getTime(),t=w.getStartTime(),x=w.getEndTime();return t!==g?tv||t>v):true}};e.openInfoWindowBasic=function(){var v=this,u=v.getInfoHtml(),w=v.dataset,t=v.placemark;if(!v.onVisibleTimeline()){w.timemap.scrollToDate(v.getStart())}if(v.getType()=="marker"&&t.api){t.setInfoBubble(u);t.openBubble();v.closeHandler=t.closeInfoBubble.addHandler(function(){w.timemap.setSelected(g);t.closeInfoBubble.removeHandler(v.closeHandler)})}else{v.map.openBubble(v.getInfoPoint(),u);v.map.tmBubbleItem=v}};e.openInfoWindowAjax=function(){var t=this;if(!t.opts.infoHtml&&t.opts.infoUrl){d.get(t.opts.infoUrl,function(u){t.opts.infoHtml=u;t.openInfoWindow()});return}t.openInfoWindow=function(){e.openInfoWindowBasic.call(t);t.dataset.timemap.setSelected(t)};t.openInfoWindow()};e.closeInfoWindowBasic=function(){var t=this;if(t.getType()=="marker"){t.placemark.closeBubble()}else{if(t==t.map.tmBubbleItem){t.map.closeBubble();t.map.tmBubbleItem=null}}};l.util.getTagValue=function(v,t,u){return b.getNodeList(v,t,u).first().text()};l.util.nsMap={};l.util.getNodeList=function(w,u,v){var t=l.util.nsMap;w=w.jquery?w[0]:w;return !w?d():!v?d(u,w):(w.getElementsByTagNameNS&&t[v])?d(w.getElementsByTagNameNS(t[v],u)):d(w.getElementsByTagName(v+":"+u))};l.util.makePoint=function(u,v){var t=null;if(u.lat&&u.lng){t=[u.lat(),u.lng()]}if(d.type(u)=="array"){t=u}if(!t){u=d.trim(u);if(u.indexOf(",")>-1){t=u.split(",")}else{t=u.split(/[\r\n\f ]+/)}}if(t.length>2){t=t.slice(0,2)}if(v){t.reverse()}return{lat:d.trim(t[0]),lon:d.trim(t[1])}};l.util.makePoly=function(w,z){var v=[],u,t,y=d.trim(w).split(/[\r\n\f ]+/);for(t=0;t0)?y[t].split(","):[y[t],y[++t]];if(u.length>2){u=u.slice(0,2)}if(z){u.reverse()}v.push({lat:u[0],lon:u[1]})}return v};l.util.formatDate=function(z,y){y=y||3;var A="";if(z){var x=z.getUTCFullYear(),u=z.getUTCMonth(),B=z.getUTCDate();if(x<1000){return(x<1?(x*-1+"BC"):x+"")}if(z.toISOString&&y==3){return z.toISOString()}var t=function(D){return((D<10)?"0":"")+D};A+=x+"-"+t(u+1)+"-"+t(B);if(y>1){var v=z.getUTCHours(),w=z.getUTCMinutes(),C=z.getUTCSeconds();A+="T"+t(v)+":"+t(w);if(y>2){A+=t(C)}A+="Z"}}return A};l.util.TimelineVersion=function(){return h.version||(h.DurationEventPainter?"1.2":"2.2.0")};l.util.getPlacemarkType=function(t){return t.constructor==f?"marker":t.constructor==o?(t.closed?"polygon":"polyline"):false};l.util.lookup=function(t,u){return typeof t=="string"?u[t]:t};if(!([].indexOf)){Array.prototype.indexOf=function(v){var t=this,u=t.length;while(--u>=0){if(t[u]===v){break}}return u}}if(!([].forEach)){Array.prototype.forEach=function(v){var t=this,u;for(u=0;u