function ab(){this.map;this.selectedOverlays=new Array();this.infoLoadingProcess=new aa("Daten werden geladen...");this.lastSelectedSegmentID=0;};ab.prototype=new GOverlay();ab.prototype.GetCurrentSelection=function(){return this.lastSelectedSegmentID;};ab.prototype.initialize=function(map){this.map=map;this.map.addControl(this.infoLoadingProcess);};ab.prototype.remove=function(){this.map=null;if(this.infoLoadingProcess)this.map.removeControl(this.infoLoadingProcess);this.Clear();};ab.prototype.redraw=function(force){};ab.prototype.copy=function(map){return new ab();};ab.prototype.Clear=function(){if(this.currentRequest)this.currentRequest.transport.abort();this.infoLoadingProcess.hide();for(var i=0;i<this.selectedOverlays.length;i++){this.map.removeOverlay(this.selectedOverlays[i]);}this.selectedOverlays=new Array();};ab.LoadPolyline=function(trackobjectID,callback){var url=aC.urlPortal+"commands.php?cmd=jsonPolyline&id="+trackobjectID;new Ajax.Request(url,{method:'get',onSuccess:function(transport){var json=transport.responseText.evalJSON();var polyline=GPolyline.fromEncoded(json);callback.call(this,polyline);}.bind(this)});};ab.prototype.SelectSegmentByLatLng=function(point){if(this.currentRequest)this.currentRequest.transport.abort();var url=aC.urlPortal+"commands.php?cmd=jsonSegmentByLatLng&lat="+point.lat()+"&lng="+point.lng();this.infoLoadingProcess.show({x:60,y:17});this.currentRequest=new Ajax.Request(url,{method:'get',onFailure:function(transport){this.currentRequest=null;this.infoLoadingProcess.hide();},onSuccess:function(transport){var json=transport.responseText.evalJSON();if(this.lastSelectedSegmentID!=json.segment.id){this.lastSelectedSegmentID=json.segment.id;var polyline=GPolyline.fromEncoded(json.segment.polyline);this.selectedOverlays.push(polyline);if(this.map)this.map.addOverlay(polyline);for(var i=0;i<json.startpoint.NeighbourSegments.length;i++){var polyline=GPolyline.fromEncoded(json.startpoint.NeighbourSegments[i]);this.selectedOverlays.push(polyline);if(this.map)this.map.addOverlay(polyline);}for(var i=0;i<json.endpoint.NeighbourSegments.length;i++){var polyline=GPolyline.fromEncoded(json.endpoint.NeighbourSegments[i]);this.selectedOverlays.push(polyline);if(this.map)this.map.addOverlay(polyline);}var nodeIconUrl="dateien/marker/station.png";var nodeIcon=new GIcon({image:nodeIconUrl});nodeIcon.iconSize=new GSize(11,11);nodeIcon.iconAnchor=new GPoint(5,5);nodeIcon.infoWindowAnchor=new GPoint(5,5);nodeIcon.shadow=null;var startmarker=new GMarker(new GLatLng(json.startpoint.lat,json.startpoint.lng),{icon:nodeIcon});this.selectedOverlays.push(startmarker);if(this.map)this.map.addOverlay(startmarker);var endmarker=new GMarker(new GLatLng(json.endpoint.lat,json.endpoint.lng),{icon:nodeIcon});this.selectedOverlays.push(endmarker);if(this.map)this.map.addOverlay(endmarker);startmarker.bindInfoWindowHtml('<div style:"text-align:middle">'+'<iframe height="130px" frameborder="0" scrolling="no" src="'+aC.urlPortal+'commands.php?cmd=editTrackpointSpecial&id='+json.startpoint.id+'"></iframe>'+'</div>');endmarker.bindInfoWindowHtml('<div>'+'<iframe height="130px" frameborder="0" scrolling="no" src="'+aC.urlPortal+'commands.php?cmd=editTrackpointSpecial&id='+json.endpoint.id+'"></iframe>'+'</div>');}else{this.lastSelectedSegmentID=0;}this.currentRequest=null;this.infoLoadingProcess.hide();}.bind(this)});}