var DMP_AUTH_STATUS ='VALID'; //Generated:5/9/2008 6:21:35 PM //ver0_73 /** * CONFIDENTIAL AND PROPRIETARY * This document is confidential and contains proprietary information. * Neither this document nor any of the information contained herein * may be reproduced or disclosed to any person under any circumstances * without the express written consent of Digital Map Products. * All Rights Reserved. * * Copyright: Copyright (c) 2007 * Company: Digital Map Products **/ var ReturnGeometryType={"NONE":2,"CENTRIOD":3,"CENTROID":3,"GEOMETRY":1,"LATLON":4};function DMCException(_1,_2){this.msgCode=_2;this.description=_1;this.message=_1;this.getMessage=getMsg;this.toString=getMsg;function getMsg(){return _1;}}function DMCQueryControl(_3,_4){var _5="http://parcelstream.com/Query.aspx";if(_3!=null){_5=_3;}var _6="y_coord";var _7="x_coord";var _8=_4;var _9=null;var _a=-1;var _b=1;var _c=0;var _d="@@@@";var _e=_9;var _f=200;var _10=null;var _11=null;var _12=null;var _13="json";var _14=0;var _15=false;var _16=-1;var _17=false;var _18=20;var _id=null;var _1a=null;var _1b=null;var _1c=null;var _1d=null;var _1e=0;var _1f=ReturnGeometryType.GEOMETRY;var _20=null;var _21="APN";this.setKeyField=function(k){_21=k;};this.getKeyField=function(){return _21;};this.setLatitudeField=function(f){_6=f;};this.setLongitudeField=function(f){_7=f;};this.getSelectAttributeName=function(){return "attr";};this.getAttributeCondName=function(){return "attrConds";};this.setSelectAttributes=function(_25){_e=_25;};this.getSelectAttributes=function(){return _e;};this.setMaxOutputRecords=function(_26){_f=_26;};this.setOrderByAttribute=function(_27){_10=_27;};this.setWhereClause=function(_28,_29){_11=_28;_12=_29;};this.setAPNFilter=function(apn,_2b){_1a=apn;_1b=_2b;};this.setID=function(id){_id=id;};this.setGeometryFilter=function(_2d){_1c=_2d;};this.setSpatialReference=function(_2e){_1d=_2e;};this.setGeometryBufferDistance=function(_2f){_1e=_2f;};this.setReturnGeometryType=function(_30){_1f=_30;};this.setOutputType=function(_31){_13=_31;};this.setMinRecords=function(val){_14=val;};this.setNoSchema=function(val){_15=val;};this.setNoRecordsIfOverN=function(val){_16=val;};this.setIsTileOutSearch=function(val){_17=val;};this.setMaxRadius=function(val){_18=val;};this.getQueryServiceUrl=function(){return _5;};this.getResourceName=function(){return _8;};this.getDataSource=function(){return _8;};this.setDataSource=function(d){_8=d;};this.getQuery=function(){var url=_5+"?";if(_11!=null&&_11.length>0){url+="attrConds=";if(typeof (_11)=="string"){url+=this.encodeParameter(_11);}else{for(var i=0;i<_11.length;i++){var _3a=_11[i];if(_3a==null||_3a==""){continue;}url+=this.encodeParameter(_3a);if(i!=_11.length-1){url+=_d;}}}}if(_12!=null){url+="&andCond="+this.encodeParameter(_12);}var _3b=_e;if(_1f!=null&&_1f>=0){if(_1f==ReturnGeometryType.LATLON){_3b=_3b.toUpperCase();_3b=ReplaceString(_3b,"GEOMETRY",_6+" AS _LATFIELD,"+_7+" AS _LONFIELD");}else{url+="&returnGeoType="+_1f;}}if(_3b!=null){url+="&attr="+this.encodeParameter(_3b);}if(_f!=null){url+="&maxRecords="+_f;}if(_8!=null&&_8.length>0){url+="&DataSource="+this.encodeParameter(_8);}if(_10!=null){url+="&orderBy="+this.encodeParameter(_10);}if(_1d!=null&&_1d.length>0){url+="&srs="+this.encodeParameter(_1d);}if(_1e!=null&&_1e>0){url+="&geoBufferDist="+_1e;}if(_1c!=null){url+="&geoFilter="+this.encodeParameter(_1c);}if(_id){url+="&ID="+this.encodeParameter(_id);}else{if(_1a&&_1b){url+="&APN="+this.encodeParameter(_1a);url+="&FIPS="+this.encodeParameter(_1b);}}if(_13!=null&&_13.toLowerCase()!="json"){url+="&output="+this.encodeParameter(_13);}if(_14!=null&&_14>0){url+="&minRecords="+this.encodeParameter(_14);}if(_15!=null&&_15==true){url+="&noSchema=true";}if(_16!=null&&_16>1){url+="&noRecordsIfOverN="+this.encodeParameter(_16);}if(_17!=null&&_17==true&&_1c!=null){url+="&isTileOutSearch=true";if(_18!=null&&_18>1){url+="&maxRadius="+this.encodeParameter(_18);}if(_6!=null){url+="&latField="+this.encodeParameter(_6);}if(_7!=null){url+="&lonField="+this.encodeParameter(_7);}}return url;};this.geocode=function(_3c,_3d,_3e,_3f,_40,_41,_42,zip,_44,_45){if(_20==null){_20=new DMPGeocoder();}_20.geocodeByAddress(_3c,_3d,_3e,_40,_41,_42,zip,_44,_45);};var _46=0;this.execute=function(_47,_48,_49,_4a){var url=this.getQuery();try{var _4c=new _DMCQueryControlObserver(_47,_48,_49,this.getResourceName(),_21);if(_4a==null||typeof (_4a)=="undefined"){_4a="query"+_4a++;}gLoadJSON(url,_4c,"onSuccess","onError",_4a);}catch(ex){alert("Error DMCQueryCOntrol:"+ex.description);}};this.encodeParameter=function(_4d){if(_4d!=null){return encodeURIComponent(_4d);}return "";};}function _DMCQueryControlObserver(_4e,_4f,_50,_51,_52){if(_4e==null){throw new DMCException("DMCQueryControlObserver: observer is undefined");}if(_4e[_4f]==null){throw new DMCException("DMCQueryControlObserver: observer must have a success method '"+_4f+"()' ");}if(_4e[_50]==null){throw new DMCException("DMCQueryControlObserver: observer must have an error method '"+_50+"()' ");}var _53=this;this._observer=_4e;this._onSuccessMethod=_4f;this._onErrorMethod=_50;this._dataSourceName=_51;this.onSuccess=function(_54,url,_56){if(_52==null){_52=_4e.getKeyField();}var _57=_53._dataSourceName;if(_4e["getLayerName"]){_57=_4e.getLayerName();}var _58=JSON2RecordSet(_54,_52,_57);_4e[_4f](_58,_51);};this.onError=function(_59,_5a,url){_4e[_50](_59,_5a,url);};this.tryParse=function(_5c,_5d){if(_5c==null||_5d==null){return _5d;}if(_5c=="int"){return parseInt(_5d);}else{if(_5c=="double"||_5c=="float"){return parseFloat(_5d);}else{if(_5c=="bool"){if(_5d=="1"||_5d=="true"){return true;}else{return false;}}else{return _5d;}}}};}function DMPGeocoder(_5e){var _5f=1;var _60="http://parcelstream.com/Geocode.aspx";if(_5e!=null){_60=_5e;}var _61=["ID","DATASOURCE","ADDRESS","ZIP"];this.geocodeByAddress=function(_62,_63,_64,_65,_66,_67,zip,_69,_6a){if(_6a!=null&&_6a==true){_6a="true";}else{_6a="";}var url=_60+"?";url+=getQueryParameter("address",_65);url+=getQueryParameter("city",_66);url+=getQueryParameter("state",_67);url+=getQueryParameter("zip",zip);url+=getQueryParameter("includeGeo",_6a);url+=getQueryParameter("minScore",_69);try{var _6c=new _DMCQueryControlObserver(_62,_63,_64,"",_61);_5f=_5f++;gLoadJSON(url,_6c,"onSuccess","onError",_5f);}catch(ex){alert("Error DMPGeocoder:"+ex.description);}};function getQueryParameter(_6d,_6e){if(typeof (_6e)!="undefined"&&typeof (_6d)!="undefined"&&_6d!=null&&_6d!=""&&_6e!=""&&_6e!=null){return "&"+_6d+"="+encodeURIComponent(_6e);}return "";}} /** * @class * @constructor * @ignore **/ function CPriority(){ this.LOW = 1000; this.MEDIUM = 20; this.HIGH = 2; this.HIGHEST = 1; } var Priority = new CPriority(); /** * @class * @constructor * @ignore **/ function Event(evtStr, sourceObj, data) { this.eventType = evtStr; // STRING IDENTIFIES THE TYPE OF EVENT this.consumed = false; // true - indicates an observer has used the event this.source = sourceObj; // source object for event this.data = (data? data : sourceObj); this.cancel = false; // true - indicates observer request cancelation of the event this.getSource = function(){ return this.source; } this.getStatus = function(){ return this.eventType; } this.getEventType = function(){ return this.eventType; } this.getData = function(){ return this.data; } } /** * @class * @constructor * @ignore **/ function EventManager(){ //assuming that an event will be notified more frequently than adding observers this._event2PriorityArray = new Array(); //some events are already executed and observers which are added later should be dispatched immediately. this._eventPassed = new Array(); this.notify = function (evtObj){ if (evtObj==null) throw new DMCException("Event object is NULL"); if (evtObj.eventType==null) throw new DMCException("evtObj.eventType is NULL"); if (evtObj.deadEvent){ this.setDispatchedEvent(evtObj.eventType, evtObj); } //Get an array sorted by priority var priorityArray = this._event2PriorityArray[evtObj.eventType]; //nobody listening if (priorityArray==null) return null; //now notify everyone in the list for ( var i=0; ib if (a.priority==null) a.priority = 20; if (b.priority==null) b.priority = 20; if (a.priorityb.priority){ return 1; }else{ return 0; } }//sortByPrirityMethod this.indexOf = function(priorityArray, observer){ if (priorityArray==null || observer==null) return -1; for ( var i=0; i0){_12=_3;}var _13=[];for(var _14 in _5){_13.push(_14);}var _15=new RecordSet(_2,_13);_15.addRecordCollection(_4);return (_15);}function tryParse(_16,_17){if(_16==null||_17==null){return _17;}if(_16=="int"){return parseInt(_17);}else{if(_16=="double"||_16=="float"){return parseFloat(_17);}else{if(_16=="bool"){return (_17=="1"||_17=="true");}else{if(_16=="wkt"){return WKT(_17);}else{if(_16=="date"){if(_17==""){return null;}_17=_17.replace(/00:00:00.0/,"");_17=_17.replace(/-/,"/");_17=new Date(_17);if((_17+"")=="NaN"){return null;}return _17;}else{if(_16=="string"){return _17;}else{return _17;}}}}}}} function OrderedHashtable(){this._columnNames=[];this._columnNameIndices=[];this._fieldArray=[];this._dataTypes=[];this.setByName=function(_1,_2,_3){this._fieldArray[_1]=_2;if(_3&&this._dataTypes[_1]==null){if(_3=="wkt"){this._dataTypes[_1]="geometry";}else{this._dataTypes[_1]=_3;}}if(this._columnNameIndices[_1]==null){this._columnNameIndices[_1]=this._columnNames.length;this._columnNames.push(_1);}};this.getByName=function(_4){return this._fieldArray[_4];};this.getDataTypeByName=function(_5){return this._dataTypes[_5];};this.clear=function(){this._fieldArray=[];this._columnNameIndices=[];this._columnNames=[];};this.getCount=function(){return this._columnNames.length;};this.contains=function(_6){return this._columnNameIndices[_6]!=null;};this.remove=function(_7){var _8;if((_8=this._columnNameIndices[_7])==null){throw new DMCException("GridControl.remove: trying to remove an inexisting field : "+_7);}delete this._fieldArray[_7];delete this._columnNameIndices[_7];this._columnNames.splice(_8,1);for(var i=_8;i0){var _12="GridControl.removeAll: failed to remove "+_c.join()+"\n\twhen removing: "+_b.join();throw new DMCException(_12);}};this.getByIndex=function(i){return this._fieldArray[this._columnNames[i]];};this.getNameByIndex=function(i){return this._columnNames[i];};this.getNames=function(){var _15=[];var k;for(k in this._fieldArray){_15.push(k);}return _15;};} function Record(_1,_2){this.base=OrderedHashtable;this.base();this.FIELD_DELIMITER="+*+";this._resourceName=_2;this._keyArray=_1;this._properties=[];this.setResourceName=function(_3){this._resourceName=_3;};this.getKeyField=function(){return this._keyArray[0];};this.getResourceName=function(){return this._resourceName;};this.getRowNumber=function(){return this.getProperty("RowNumber");};this.setKeyField=function(_4){this._keyArray=[_4];};this.setCompositeKeyField=function(_5){this._keyArray=_5;};this.getCompositeKeyField=function(){return this._keyArray;};this.getKey=function(){var _6=this.getByName(this._keyArray[0]);for(var i=1;i_6){alert(_5);return;}var _c=r.getKey();var _d=this._records.contains(_c);var _e=null;if(_d&&!_b){_e=this._records.getByName(_c).clone();}this._records.setByName(_c,r);if(!_b){if(_d){var _f=new Event("recordUpdated",this,r);_f.oldRecord=_e;_f.newRecord=r;this.notify(_f);}else{this.notify(new Event("recordAdded",this,r));}}return r;};this.getRecord=function(key){var _11=this._records.getByName(key);if(!_11){return null;}else{return _11;}};this.removeRecord=function(key,_13){var r=this._records.getByName(key);if(!r){return;}this._records.remove(key);if(!_13){this.notify(new Event("recordRemoved",this,r));}return r;};this.clone=function(){var _15=new RecordSet(this._keyArray,this.getColumnNames());for(var i=0;i_6){alert(_5);break;}_18.push(_1d);}}if(_18.length>0){this.notify(new Event("recordCollectionAdded",this,_18));}return _19;};this.toArray=function(){var arr=[];for(var i=0;i1){_3b.setCompositeKeyField(this._keyArray);}for(var _3d in _31){var _3e=_3a.getAttribute(_3d);if(_3e!=null){var _3f=_31[_3d];_3e=tryParse(_3f,_3e);}_3b.setByName(_3d,XMLAbstraction.decode(_3e),_3f);}_2f.push(_3b);this.setRecord(_3b,_30);}var _40=_2d.selectNodes("Xml/Properties/Properties");for(var j=0;j<_40.length;j++){var _41=_40[j];var _3b=null;var _42=_41.getAttribute("__key");if(_42==null){continue;}var rec=this.getRecord(_42);if(rec==null){continue;}var _44=_41.attributes;for(var k=0;k<_44.length;k++){var _46=_44[k].nodeName;if(_46=="RowNumber"||_46=="__key"){continue;}rec.setProperty(_46,XMLAbstraction.decode(_41.getAttribute(_46)));}}}catch(e){throw new Exception("RecordSet.importData(): malformatted xmlDOM: "+_2d==null?null:_2d.xml);}this.notify(new Event("recordCollectionAdded",this,_2f));};this.exportData=function(){if(this.getCount()<=0){return null;}var _47=gGetDomFromString("");var _48=_47.createElement("Xml");var _49=_47.createElement("Schema");var _4a=_47.createElement("Data");var _4b=_47.createElement("Properties");_48.appendChild(_49);_48.appendChild(_4a);_48.appendChild(_4b);var _4c=[];for(var i=0;i0){ urlWithOid += "&"; }else{ urlWithOid += "?"; } urlWithOid += "obsId=_gDMCObserverLounge[\""+observerId+"\"]"; urlWithOid += "&obsSuccessMethod="+onSuccessMethod; urlWithOid += "&obsErrorMethod="+onErrorMethod; urlWithOid += "&output=JSON"; //append script node _gDmcLoadScript(urlWithOid, _loadedURL, srcId); }//gLoadJSON var _gDMCLOGIN_URL = "http://maps.digitalmapcentral.com/production/init"; /** * @ignore */ function ProcessError(msg){ //current JSON servlet is not very sophisticated. //we have to listen for some hardcoded values here. if (msg.indexOf("User not found")>=0){ //User not logged in document.location.href = _gDMCLOGIN_URL; return; } alert(msg); } /** * simulating lounge object to support old JSON servlet. * The output of JSON filter or servlets expect global lounge object. **/ var _gDMCObserverLounge = new Array(); /** * @ignore */ function _gDMCNotifyJSON(obsID){ var observer = _gDMCObserverLounge[obsID]; if (observer==null){ //in this case obsID is an observer observer = eval(obsID); } return observer; } // plo todo move to xmlUtils. /** * @ignore */ function _gDmcLoadScript(url, callback, srcId) { if (document.all){ _gDmcLoadScriptIE(url, callback, srcId); }else{ _gDmcLoadScriptMOZILLA(url, callback, srcId); } } // plo todo move to xmlUtils. /** * @ignore */ function _gDmcLoadScriptMOZILLA(url, callback, srcId){ var head = document.getElementsByTagName("head").item(0); // Create object var oScript = document.createElement("script"); oScript.setAttribute("language","JavaScript1.2"); oScript.setAttribute("src",url); if (srcId) oScript.setAttribute("id", srcId); var _loaded = 0; if (callback){ oScript.addEventListener("load", callback, false); }else{ //this is a sync call function _callBack(){ _loaded = 100; } oScript.addEventListener("load", _callBack, false); } head.appendChild(oScript); if (!callback){ //check for existance of the appended js file try{ //to simulate synchronous loading in mozilla, there is no other way except following. //Brace yourself, here comes the hack of all: I will go in a loop and check //the variable which will be set in the callback method. while (_loaded<50){ //Lets sleep for a while before checkin gSleep(200); _loaded++; } }catch(ex){ //i wouldn't worry too much about the exception } } } // plo todo move to xmlUtils. /** * @ignore */ function _gDmcLoadScriptIE(url, callback, srcId){ var head = document.getElementsByTagName("head").item(0); // Create object var oScript = document.createElement("script"); oScript.setAttribute("src",url); if (srcId) oScript.setAttribute("id",srcId); if (callback==null){ //this is a sync call if (oScript.readyState!="loaded"){ var _loaded = 0; oScript.onreadystatechange = function(){ //DEBUG_LOG("this.readyState :"+this.readyState ); if (this.readyState == "loaded"){ oScript.onreadystatechange = null; _loaded = 100; } } while (_loaded<50 && oScript.readyState!="loaded" && oScript.readyState!="complete"){ //DEBUG_LOG(url+" _loaded:"+_loaded + " oScript.readyState:"+oScript.readyState); //Lets sleep for a while before checkin pause(100); _loaded++; } } }else{ if (oScript.readyState=="loaded" || oScript.readyState=="complete"){ callback(); }else if (oScript.readyState!="loaded") { oScript.onreadystatechange = function() { if (this.readyState == "loaded") { callback(); oScript.onreadystatechange = null; } } }else{ alert("Cannot load data url:"+url); } } head.appendChild(oScript); }//_gDmcLoadScriptIE /** * @ignore */ function _gDmcRemoveScriptTagById(srcId){ var head = document.getElementsByTagName("head").item(0); var scrtNode = document.getElementById(srcId); if (scrtNode){ head.removeChild(scrtNode) //alert("Script removed : "+srcId + " / "+document.getElementsByTagName("script").length); return; }else{ //alert("Script not found : "+srcId + " / "+document.getElementsByTagName("script").length); } /* var scripts = document.getElementsByTagName("script"); for ( var i=0; i0){this.xMin=this.xMax=_a[0].x;this.yMin=this.yMax=_a[0].y;for(var i=1;i<_a.length;i++){if(_a[i].xthis.xMax){this.xMax=_a[i].x;}}if(_a[i].ythis.yMax){this.yMax=_a[i].y;}}}}this.min=function(){return new DMCPoint(this.xMin,this.yMin);};this.max=function(){return new DMCPoint(this.xMax,this.yMax);};this.equals=function(_c){return _c.xMin==this.xMin&&_c.xMax==this.xMax&&_c.yMin==this.yMin&&_c.yMax==this.yMax;};this.contains=function(_d){return _d.x>=this.xMin&&_d.x<=this.xMax&&_d.y>=this.yMin&&_d.y<=this.yMax;};this.containsBounds=function(_e){return _e.xMin>=this.xMin&&_e.xMax<=this.xMax&&_e.yMin>=this.yMin&&_e.yMax<=this.yMax;};this.intersects=function(_f){if((!((this.xMax<_f.xMin)||(this.xMin>_f.xMax)))&&(!((this.yMax<_f.yMin)||(this.yMin>_f.yMax)))){return true;}return false;};this.extend=function(_10){if(_10.x>this.xMax){this.xMax=_10.x;}else{if(_10.xthis.yMax){this.yMax=_10.y;}else{if(_10.y=this.xMin&&_11.xMin<=this.xMax){_12=_11.xMin;++n;}if(_11.xMax>=this.xMin&&_11.xMax<=this.xMax){_14=_11.xMax;++n;}if(n<2){if(this.xMin>=_11.xMin&&this.xMin<=_11.xMax){_12=this.xMin;++n;}if(this.xMax>=_11.xMin&&this.xMax<=_11.xMax){_14=this.xMax;++n;}}if(n<2){return new DMCBounds([new DMCPoint(0,0),new DMCPoint(0,0)]);}n=0;if(_11.yMin>=this.yMin&&_11.yMin<=this.yMax){_13=_11.yMin;++n;}if(_11.yMax>=this.yMin&&_11.yMax<=this.yMax){_15=_11.yMax;++n;}if(n<2){if(this.yMin>=_11.yMin&&this.yMin<=_11.yMax){_13=this.yMin;++n;}if(this.yMax>=_11.yMin&&this.yMax<=_11.yMax){_15=this.yMax;++n;}}if(n<2){return new DMCBounds([new DMCPoint(0,0),new DMCPoint(0,0)]);}return new DMCBounds([new DMCPoint(_12,_13),new DMCPoint(_14,_15)]);};this.getSouthEast=function(){return new DMCPoint(this.xMax,this.yMin);};this.getSouthWest=function(){return new DMCPoint(this.xMin,this.yMin);};this.getNorthEast=function(){return new DMCPoint(this.xMax,this.yMax);};this.getNorthWest=function(){return new DMCPoint(this.xMin,this.yMax);};this.toSpan=function(){return new DMCPoint(this.xMax-this.xMin,this.yMax-this.yMin);};this.isFullLat=function(){return this.yMin<=-90&&this.yMax>=90;};this.isFullLng=function(){return this.max<=-180&&this.yMax>=180;};this.isEmpty=function(){return this.xMin>=this.xMax||this.yMin>=this.yMax;};this.getCenter=function(){return new DMCPoint((this.xMax+this.xMin)/2,(this.yMax+this.yMin)/2);};this.getPoints=function(){return [new DMCPoint(this.xMin,this.yMin),new DMCPoint(this.xMin,this.yMax),new DMCPoint(this.xMax,this.yMax),new DMCPoint(this.xMax,this.yMin),new DMCPoint(this.xMin,this.yMin)];};this.toString=function(){var _17=new DMCPolygon(this.getPoints());return _17.toString();};}function DMCPoint(x,y,_1a){this.TYPE="POINT";this.x=x;this.y=y;if(!_1a){this.y=Math.max(-90,this.y);this.y=Math.min(90,this.y);this.x=Math.max(-180,this.x);this.x=Math.min(180,this.x);}this.toString=function(){return "POINT("+this.x+" "+this.y+")";};this.getX=function(){return this.x;};this.getY=function(){return this.y;};this.getLat=function(){return this.y;};this.getLng=function(){return this.x;};this.getPoints=function(){return [this];};this.setPoints=function(_1b){this.x=_1b[0].x;this.y=_1b[0].y;};this.getLatRadians=function(){return this.y*Math.PI/180;};this.getLngRadians=function(){return this.x*Math.PI/180;};this.equals=function(_1c){return this.y==_1c.y&&this.x==_1c.x;};this.intersects=function(_1d){if(_1d==null){throw new DMCException("DMCPoint.intersects can not take a null parameter");}if(_1d.TYPE=="POINT"){return this.equals(_1d);}if(_1d.TYPE=="POLYGON"){var b=_1d.contains(this);return b;}if(_1d.TYPE=="BOUNDS"){var b=_1d.contains(this);return b;}throw new DMCException("Other geometry types no supported.");};this.getCentroid=function(){return new DMCPoint(this.x,this.y,_1a);};}function _pointArray1DtoPointArray(_1f){var _20=[];for(var i=0;i<_1f.length;i+=2){_20.push(new DMCPoint(_1f[i],_1f[i+1]));}return _20;}function DMCLineString(_22){this.TYPE="LINESTRING";this.points=_22;if(!this.points){this.points=[];}this.toString=function(){var s="LINESTRING(";for(var i=0;i=len){_5d-=len;}else{break;}}return this.polygons[i].points[_5d];};this.getPoints=function(){var _60=[];for(var i=0;i0){_67=new Array();for(var i=0;i<_66.length;i++){_67.push(_66[i].substring(1,_66[i].length-1));}}_65=new RegExp(/[^(]*/g);var m1=_65.exec(_64);var _6a=null;if(m1!=null&&m1.length>0){_6a=m1[0].replace(/ /,"");}if(_67==null||_67==""||_6a==null||_6a==""){return null;}var _6b;if(_6a=="MULTIPOLYGON"){_6b=new Array();for(var i=0;i<_67.length;i++){_6b.push(__parseWKTPointsString(_67[i]));if(_6b[i].length<4){throw null;}_6b[i]=_pointArray1DtoPointArray(_6b[i]);}return new DMCMultiPolygon(_6b);}else{_6b=__parseWKTPointsString(_67[0]);if(_6a=="POINT"){if(_6b.length!=2){throw null;}return new DMCPoint(_6b[0],_6b[1]);}else{if(_6a=="LINESTRING"){if(_6b.length<4){throw null;}return new DMCLineString(_pointArray1DtoPointArray(_6b));}else{if(_6a=="POLYGON"){if(_6b.length<4){throw null;}return new DMCPolygon(_pointArray1DtoPointArray(_6b));}else{return null;}}}}}catch(e){return null;}}function __parseWKTPointsString(_6c){var _6d=_6c.split(",");var _6e=[];for(var i=0;i<_6d.length;i++){var _70=_6d[i].split(" ");_70=__deleteBlankStringFromArray(_70);if(_70.length!=2){throw "unsupported/malformatted wkt format:"+_6c;}_6e.push(parseFloat(_70[0]));_6e.push(parseFloat(_70[1]));}return _6e;}function __deleteBlankStringFromArray(_71){var _72=[];for(var j=0;j<_71.length;j++){var _74=true;var arr=_71[j].split(" ");for(var k=0;k=1.5){Msn.Drawing.Graphic.CreateGraphic=function(f,b){return new Msn.Drawing.SVGGraphic(f,b);};}}function SetDMPKey(_6){_DMP_KEY=_6;}var _PARCEL_TILE_LAYER=null;var _G_COUNTER=0;var _DMP_KEY="user";var _OUTPUT_TYPE="PNG";var _G_DMP_SERVER_NAME="http://parcelstream.com";var G_NUM_SERVERS=4;var _G_MULTIDOMAIN_SERVER_NAME=new Array();for(var i=0;i=0){p1.style.filter="";}return this._dmcAppendChild(p1,p2,p3,p4);}function _gOverrideAppendChildIE6(p1,p2,p3,p4){if(p1.tagName=="DIV"&&p1.innerHTML==""){var cls=p1.style.filter;if(cls!=null){cls+="";if(cls!=""){if(cls.indexOf(_gExpectedFilter+_G_DMP_SERVER_NAME)>=0||containsDomainName(cls,_gExpectedFilter,_gExpectedFilter.length)){var _12=cls.indexOf("http://");var _13=cls.indexOf("',",_12);var url=cls.substring(_12,_13);var _15=false;if(url!=null&&url.toLowerCase().indexOf("png")>-1){_15=true;}if(_15){var _16=", alpha(opacity=100)";var _17=""+p1.style.filter;var arr=_17.split(_16);if(arr.length==2){p1.style.filter=arr[0]+arr[1];}}else{var img=document.createElement("IMG");img.src=url;img.style.left=p1.style.left;img.style.top=p1.style.top;img.style.width=p1.style.width;img.style.height=p1.style.height;img.style.border=p1.style.border;img.style.zIndex=p1.style.zIndex;img.style.position=p1.style.position;p1=img;}}}}}this._dmcAppendChild(p1,p2,p3,p4);}var _b_dmc_hasInitCalled=false;function gInitializeDMPLayers(map){if(_b_dmc_hasInitCalled){return;}_b_dmc_hasInitCalled=true;if(document.all){var _1b=document.getElementById(map.ID).firstChild;if(_1b==null){alert("Error in DMP API. Please contact Digital Map Products Inc. Support.");return;}_1b._dmcAppendChild=_1b.appendChild;if(navigator.userAgent.indexOf("MSIE 7.0")>=0){_1b.appendChild=_gOverrideAppendChildIE7;}else{_1b.appendChild=_gOverrideAppendChildIE6;}}}function SetParcelLayerVisibility(_1c,_1d){if(_1c==null){alert("Please pass Virtual Earth map instance as a parameter to the ToggleDMPParcelLayer() function. ");return;}if(_PARCEL_TILE_LAYER){_PARCEL_TILE_LAYER.setVisible(_1d);}}function AddDMPParcelLayer(_1e,_1f){if(_1e==null){alert("Please pass Virtual Earth map instance as a parameter to the AddDMPParcelLayer() function. ");return;}gInitializeDMPLayers(_1e);_PARCEL_TILE_LAYER=new TiledLayer(_1e,["Parcels"]);_PARCEL_TILE_LAYER.setMinZoomLevel(16);_PARCEL_TILE_LAYER.setMaxZoomLevel(19);_PARCEL_TILE_LAYER.setFormat("image/png");if(_1f){_PARCEL_TILE_LAYER.setZIndex(_1f);}_PARCEL_TILE_LAYER.initialize();}function containsDomainName(_20,_21,_22){var _23,_24;if(_21==null){_21="";_22=0;}else{if(_22==null||_22<0){_22=0;}}for(var i=0;i=0&&val<=1){_1b=val;}if(_1c){if(_13!=null){deleteTileLayer();addTileLayer();}}};this.getOpacity=function(){return _1b;};this.setStyleLayerDescriptorUrl=function(val){_1e=val;if(_1c){if(_13!=null){deleteTileLayer();addTileLayer();}}};this.getStyleLayerDescriptorUrl=function(){return _1e;};this.setStyleLayerDescriptorText=function(val){_1f=val;if(_1c){if(_13!=null){deleteTileLayer();addTileLayer();}}};this.getStyleLayerDescriptorText=function(){return _1f;};this.setVisible=function(_2d){try{_17=_2d;if(this.getVisible()){if(isDefined(_13.ShowTileLayer)){_13.ShowTileLayer(_22);}else{if(isDefined(_13.ShowLayer)){deleteTileLayer();addTileLayer();}}}else{if(isDefined(_13.HideTileLayer)){_13.HideTileLayer(_22);}else{if(isDefined(_13.HideLayer)){deleteTileLayer();}}}}catch(e){}};_this=this;this.initialize=function(){if(_1c){return;}addTileLayer();_1c=true;};function addTileLayer(){var _2e=getTileServerPath();var _2f=new VETileSourceSpecification(_22,_2e);_2f.NumServers=G_NUM_SERVERS;_2f.MinZoomLevel=_19;_2f.MaxZoomLevel=_1a;_2f.Opacity=_1b;_2f.ZIndex=_1d;if(isDefined(_13.AddTileLayer)){if(_13!=null){_13.AddTileLayer(_2f,true);}}else{if(isDefined(_13.AddLayer)){_13.AddTileSource(_2f);var _30=new VELayerSpecification(VELayerType.VETileSource,_22,_22);_30.ZIndex=_1d;_30.Opacity=_1b;_13.AddLayer(_30);}}}function deleteTileLayer(){if(_13!=null){try{if(isDefined(_13.DeleteTileLayer)){_13.DeleteTileLayer(_22);}else{if(isDefined(_13.DeleteLayer)&&isDefined(_13.DeleteTileSource)){_13.DeleteLayer(_22);_13.DeleteTileSource(_22);}}}catch(ex){}}}function isDefined(val){return (typeof (val)!="undefined"&&val!=null);}function getTileServerPath(){var _32=_15+"?tileid=%4";if(_18!=null&&_18!=""&&_18.length>0){_32+="&layers="+encodeString(_18.join(","));}if(_1e!=null){_32+="&SLD="+encodeString(_1e);}if(_21!=null){_32+="&format="+encodeURIComponent(_21);}if(_1f!=null){_32+="&SLD_BODY="+encodeString(_1f);}_32+="&IsEncoded=true&SRS=EPSG:4326&REQUEST=MAP";for(var key in _20){var _34=_20[key];if(_34!=null&&_34!=""){if(typeof (_34)!=="undefined"&&typeof (_34)!=="function"){_32+=("&"+key+"="+encodeURIComponent(_34));}}}_32+="&OverrideMapStyle="+encodeString("1");return _32;}function encodeString(s){return encodeURIComponent(s).replace(/%/g,"._-");}}function GoogleTiledLayer(_36,_37,_38){var _39="http://t%2.parcelstream.com/";if(!_38){_38=_39+"VEParcelTileServer.aspx";}var _3a=_36;var _3b=null;var _3c=true;var _3d=_37;var _3e=17;var _3f=19;var _40=1;var _41=new GCopyrightCollection();var _42=false;var _43=null;var _44=null;var _45=[];var _46="image/png";var _47="Layer"+new Date().getTime()+"_"+(_G_COUNTER++);this.setFormat=function(val){_46=val;if(_42){if(_3a!=null){deleteTileLayer();addTileLayer();}}};this.getFormat=function(){return _46;};this.addCopyright=function(_49){_41.addCopyright(_49);};this.getCopyrights=function(_4a,_4b){return _41.getCopyrights(_4a,_4b);};this.getProperty=function(_4c){return _45[_4c];};this.setProperty=function(_4d,_4e){if(_4d!=null&&_4d!=""){_45[_4d]=_4e;}};this.getVisible=function(){return _3c;};this.setMinZoomLevel=function(val){_3e=val;};this.setMaxZoomLevel=function(val){_3f=val;};this.getMinZoomLevel=function(){return _3e;};this.getMaxZoomLevel=function(){return _3f;};this.setOpacity=function(val){if(val!=null&&val>=0&&val<=1){_40=val;}if(_42){if(_3a!=null){deleteTileLayer();addTileLayer();}}};this.getOpacity=function(){return _40;};this.setStyleLayerDescriptorUrl=function(val){_43=val;};this.getStyleLayerDescriptorUrl=function(){return _43;};this.setStyleLayerDescriptorText=function(val){_44=val;};this.getStyleLayerDescriptorText=function(){return _44;};this.setVisible=function(_54){try{_3c=_54;if(_3c){deleteTileLayer();addTileLayer();}else{_3b.hide();}}catch(e){}};this.initialize=function(){if(_42){return;}addTileLayer();_42=true;};function addTileLayer(){var _55=new GTileLayer(_41,_3e,_3f);_55.getTileUrl=GetDMCTileURL;_55.isPng=function(){if(_46=="image/png"){return true;}else{return false;}};_55.getOpacity=function(){return _40;};_3b=new GTileLayerOverlay(_55);_3a.addOverlay(_3b);}function deleteTileLayer(){if(_3a!=null){_3a.removeOverlay(_3b);}}function GetDMCTileURL(_56,_57){if(!_3c||_57<_3e||_57>_3f){return "";}var _58=_38.replace("%2",""+Math.floor(Math.random()*G_NUM_SERVERS));var _59=_58+"?tileid="+TileXYToQuadKey(_56.x,_56.y,_57);if(_3d!=null&&_3d!=""&&_3d.length>0){_59+="&layers="+encodeString(_3d.join(","));}if(_43!=null){_59+="&SLD="+encodeString(_43);}if(_46!=null){_59+="&format="+encodeURIComponent(_46);}if(_44!=null){_59+="&SLD_BODY="+encodeString(_44);}_59+="&IsEncoded=true&SRS=EPSG:4326&REQUEST=MAP";for(var key in _45){var _5b=_45[key];if(_5b!=null&&_5b!=""){if(typeof (_5b)!=="undefined"&&typeof (_5b)!=="function"){_59+=("&"+key+"="+encodeURIComponent(_5b));}}}return _59;}function TileXYToQuadKey(_5c,_5d,_5e){var _5f="";for(var i=_5e;i>0;i--){var _61="0";var _62=1<<(i-1);if((_5c&_62)!=0){_61++;}if((_5d&_62)!=0){_61++;_61++;}_5f+=_61;}return _5f;}function encodeString(s){return encodeURIComponent(s).replace(/%/g,"._-");}} function WMSLayer(_1,_2,_3){var _4=null;if(typeof (GMap2)!="undefined"&&_1 instanceof GMap2){_4=new GoogleWMSLayer(_1,_2,_3);}else{if(typeof (VEMap)!="undefined"&&_1 instanceof VEMap){_4=new VEWMSLayer(_1,_2,_3);this.setZIndex=function(_5){_4.setZIndex(_5);};this.getZIndex=function(){return _4.getZIndex();};this.setOpacity=function(_6){_4.setOpacity(_6);};this.getOpacity=function(){return _4.getOpacity();};}else{return null;}}this.setFormat=function(_7){_4.setFormat(_7);};this.getFormat=function(){return _4.getFormat();};this.setProperty=function(_8,_9){_4.setProperty(_8,_9);};this.getProperty=function(_a){return _4.getProperty(_a);};this.setVisible=function(_b){_4.setVisible(_b);};this.getVisible=function(){return _4.getVisible();};this.setMinZoomLevel=function(_c){_4.setMinZoomLevel(_c);};this.getMinZoomLevel=function(){return _4.getMinZoomLevel();};this.setMaxZoomLevel=function(_d){_4.setMaxZoomLevel(_d);};this.getMaxZoomLevel=function(){return _4.getMaxZoomLevel();};this.setStyleLayerDescriptorUrl=function(_e){_4.setStyleLayerDescriptorUrl(_e);};this.getStyleLayerDescriptorUrl=function(){return _4.getStyleLayerDescriptorUrl();};this.setStyleLayerDescriptorText=function(_f){_4.setStyleLayerDescriptorText(_f);};this.getStyleLayerDescriptorText=function(){return _4.getStyleLayerDescriptorText();};this.initialize=function(){_4.initialize();};this.draw=function(){};this.onviewchange=_4.onviewchange;}function VEWMSLayer(_10,_11,_12){gInitializeDMPLayers(_10);var _13=_12;if(!_13){_13=_G_DMP_SERVER_NAME+"/VEParcelTileServer.aspx";}var _14=null;var _15=true;var _16=_11;var _17=17;var _18=19;var _19=1;var _1a=false;var _1b=null;var _1c=null;var _1d=[];var _1e=2;var _1f="image/png";var _20="Layer"+new Date().getTime()+"_"+(_G_COUNTER++);this.setFormat=function(val){_1f=val;};this.getFormat=function(){return _1f;};this.setZIndex=function(val){_1e=val;};this.getZIndex=function(){return _1e;};this.getProperty=function(_23){return _1d[_23];};this.setProperty=function(_24,_25){if(_24!=null&&_24!=""){_1d[_24]=_25;}};this.setStyleLayerDescriptorUrl=function(val){_1b=val;};this.getStyleLayerDescriptorUrl=function(){return _1b;};this.setStyleLayerDescriptorText=function(val){_1c=val;};this.getStyleLayerDescriptorText=function(){return _1c;};this.getVisible=function(){return _15;};this.setMinZoomLevel=function(val){_17=val;};this.setMaxZoomLevel=function(val){_18=val;};this.getMinZoomLevel=function(){return _17;};this.getMaxZoomLevel=function(){return _18;};this.setOpacity=function(val){if(val!=null&&val>=0&&val<=1){_19=val;}};this.getOpacity=function(){return _19;};this.setVisible=function(_2b){try{_15=_2b;if(this.getVisible()){this.onviewchange(null);}else{var _2c=getMapDiv();var _2d=_2c.firstChild;if(_14!=null){_2d.removeChild(_14);_14=null;}}}catch(e){}};this.onviewchange=function(e){if(!_this.getVisible()){return;}var _2f=getMapDiv();var _30=_2f.firstChild;if(_14!=null){_30.removeChild(_14);_14=null;}var _31=_10.GetZoomLevel();if(_17>_31||_18<_31){return;}var _32=_10.GetWidth();var _33=_10.GetHeight();var _34=0;var _35=0;var _36=_34+_10.GetWidth();var _37=_35+_10.GetHeight();var _38=_10.PixelToLatLong(new VEPixel(_34,_37));var _39=_10.PixelToLatLong(new VEPixel(_36,_35));var _3a=_38.Longitude;var _3b=_38.Latitude;var _3c=_39.Longitude;var _3d=_39.Latitude;var url="";url+=_13;url+="?bbox="+_3a+","+_3b+","+_3c+","+_3d;var _3f=encodeURIComponent;if((_40>=5.5)&&(_40<7)&&(document.body.filters)&&(typeof (_12)=="undefined"||_12==null)&&_1f!=null&&_1f.toLowerCase().indexOf("png")>-1){_3f=encodeString;url+="&IsEncoded=true";}url+="&width="+_32;url+="&height="+_33;if(_16!=null&&_16!=""&&_16.length>0){url+="&layers="+_3f(_16.join(","));}if(_1b!=null){url+="&SLD="+_3f(_1b);}if(_1f!=null){url+="&format="+_3f(_1f);}if(_1c!=null){url+="&SLD_BODY="+_3f(_1c);}url+="&SRS=EPSG:4326&REQUEST=MAP";for(var key in _1d){var _42=_1d[key];if(_42!=null&&_42!=""){if(typeof (_42)!=="undefined"&&typeof (_42)!=="function"){url+=("&"+key+"="+_3f(_42));}}}_14=document.createElement("IMG");_14.setAttribute("id","MDE"+_20);_14.id="MDE"+_20;_30.appendChild(_14);var _43=0-parseInt(_30.style.top);var _44=0-parseInt(_30.style.left);_14.style.left=_44+"px";_14.style.top=_43+"px";_14.style.position="absolute";_14.style.width=_32+"px";_14.style.height=_33+"px";_14.style.opacity=_19;_14.style.filter="alpha(opacity="+(_19*100)+")";_14.style.zIndex=_1e;_14.setAttribute("src",url);if(_1f!=null&&_1f.toLowerCase().indexOf("png")>-1){_14=fixPNG(_14);}};var _45=navigator.appVersion.split("MSIE");var _40=parseFloat(_45[1]);function fixPNG(_46){if((_40>=5.5)&&(_40<7)&&(document.body.filters)){var id=_46.id;var _48=(_46.id)?"id='"+_46.id+"' ":"";var _49=(_46.className)?"class='"+_46.className+"' ":"";var _4a=(_46.title)?"title='"+_46.title+"' ":"title='"+_46.alt+"' ";var _4b="display:inline-block;"+_46.style.cssText;var _4c="";_46.outerHTML=_4c;return document.getElementById(id);}return _46;}function getMapDiv(){return document.getElementById(_10.ID);}_this=this;this.initialize=function(){if(_1a){return;}_10.AttachEvent("onchangeview",this.onviewchange);this.onviewchange();_1a=true;};function encodeString(s){return encodeURIComponent(s).replace(/%/g,"._-");}}function GoogleWMSLayer(_4e,_4f,_50){var _51=_50;if(!_51){_51=_G_DMP_SERVER_NAME+"/VEParcelTileServer.aspx";}var _52=_4e;var _53=null;var _54=true;var _55=_4f;var _56=17;var _57=19;var _58=false;var _59=null;var _5a=null;var _5b=[];var _5c="image/png";var _5d="Layer"+new Date().getTime()+"_"+(_G_COUNTER++);this.setFormat=function(val){_5c=val;};this.getFormat=function(){return _5c;};this.getProperty=function(_5f){return _5b[_5f];};this.setProperty=function(_60,_61){if(_60!=null&&_60!=""){_5b[_60]=_61;}if(_58){this.onviewchange();}};this.setStyleLayerDescriptorUrl=function(val){_59=val;if(_58){this.onviewchange();}};this.getStyleLayerDescriptorUrl=function(){return _59;};this.setStyleLayerDescriptorText=function(val){_5a=val;if(_58){this.onviewchange();}};this.getStyleLayerDescriptorText=function(){return _5a;};this.getVisible=function(){return _54;};this.setMinZoomLevel=function(val){_56=val;if(_58){this.onviewchange();}};this.setMaxZoomLevel=function(val){_57=val;if(_58){this.onviewchange();}};this.getMinZoomLevel=function(){return _56;};this.getMaxZoomLevel=function(){return _57;};this.setVisible=function(_66){_54=_66;try{if(_54){this.onviewchange();}else{_53.hide();}}catch(e){}};this.onviewchange=function(e){if(_53){_52.removeOverlay(_53);}if(!_68.getVisible()){return;}var _69=_52.getZoom();if(_56>_69||_57<_69){return;}var _6a=_52.getBounds();var _6b=_52.getSize();var sw=_6a.getSouthWest();var ne=_6a.getNorthEast();var _6e="?bbox="+sw.lng()+","+sw.lat()+","+ne.lng()+","+ne.lat();var url="";url+=_51+_6e;var _70=encodeURIComponent;if((_71>=5.5)&&(_71<7)&&(document.body.filters)&&(typeof (_50)=="undefined"||_50==null)&&_5c!=null&&_5c.toLowerCase().indexOf("png")>-1){_70=encodeString;url+="&IsEncoded=true";}url+="&width="+_6b.width;url+="&height="+_6b.height;if(_55!=null&&_55!=""&&_55.length>0){url+="&layers="+_70(_55.join(","));}if(_59!=null){url+="&SLD="+_70(_59);}if(_5c!=null){url+="&format="+_70(_5c);}if(_5a!=null){url+="&SLD_BODY="+_70(_5a);}url+="&SRS=EPSG:4326&REQUEST=MAP";for(var key in _5b){var _73=_5b[key];if(_73!=null&&_73!=""){if(typeof (_73)!=="undefined"&&typeof (_73)!=="function"){url+=("&"+key+"="+_70(_73));}}}_53=new GGroundOverlay(url,_6a);_52.addOverlay(_53);};var _74=navigator.appVersion.split("MSIE");var _71=parseFloat(_74[1]);var _68=this;this.initialize=function(){if(_58){return;}GEvent.bind(_52,"moveend",_68,_68.onviewchange);_68.onviewchange();_58=true;};function encodeString(s){return encodeURIComponent(s).replace(/%/g,"._-");}}