/*
	Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
	Available via Academic Free License >= 2.1 OR the modified BSD license.
	see: http://dojotoolkit.org/license for details
*/


window[esri._dojoScopeName||"dojo"]._xdResourceLoaded(function(_1,_2,_3){return {depends:[["provide","dojox.geo.charting.Map"],["require","dojox.gfx"],["require","dojox.geo.charting._base"],["require","dojox.geo.charting._Feature"],["require","dojox.geo.charting._Marker"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["dojox.geo.charting.Map"]){_4._hasResource["dojox.geo.charting.Map"]=true;_4.provide("dojox.geo.charting.Map");_4.require("dojox.gfx");_4.require("dojox.geo.charting._base");_4.require("dojox.geo.charting._Feature");_4.require("dojox.geo.charting._Marker");_4.declare("dojox.geo.charting.Map",null,{defaultColor:"#B7B7B7",highlightColor:"#D5D5D5",series:[],constructor:function(_7,_8){_4.style(_7,"display","block");this.containerSize={x:_4.coords(_7).x,y:_4.coords(_7).y,w:_4.coords(_7).w||100,h:_4.coords(_7).h||100};this.surface=_6.gfx.createSurface(_7,this.containerSize.w,this.containerSize.h);this.container=_7;this._createZoomingCursor();this.mapObj=this.surface.createGroup();this.mapObj.features={};_4.xhrGet({url:_8,handleAs:"json",sync:true,load:_4.hitch(this,"_init")});},setMarkerData:function(_9){_4.xhrGet({url:_9,handleAs:"json",handle:_4.hitch(this,"_appendMarker")});},setDataStore:function(_a,_b){this.dataStore=_a;var _c=this;this.dataStore.fetch({query:_b,onComplete:function(_d){var _e=_d[0];var _f=_c.dataStore.getAttributes(_e);_4.forEach(_f,function(_10){if(_c.mapObj.features[_10]){_c.mapObj.features[_10].setValue(_c.dataStore.getValue(_e,_10));}});}});},addSeries:function(_11){this.series=_11;},_init:function(_12){var _13=_12.layerExtent[2]-_12.layerExtent[0];var _14=_12.layerExtent[3]-_12.layerExtent[1];this.mapObj.scale=Math.min(this.containerSize.w/_13,this.containerSize.h/_14);this.mapObj.currentScale=this.mapObj.scale;this.mapObj.boundBox=_12.layerExtent;this.mapObj.currentBBox={x:_12.layerExtent[0],y:_12.layerExtent[1]};this.mapObj.setTransform([_6.gfx.matrix.scale(this.mapObj.scale),_6.gfx.matrix.translate(-_12.layerExtent[0],-_12.layerExtent[1])]);_4.forEach(_12.featureNames,function(_15){var _16=_12.features[_15];_16.bbox.x=_16.bbox[0];_16.bbox.y=_16.bbox[1];_16.bbox.w=_16.bbox[2];_16.bbox.h=_16.bbox[3];var _17=new _6.geo.charting._Feature(this,_15,_16);_17.init();this.mapObj.features[_15]=_17;},this);this.mapObj.marker=new _6.geo.charting._Marker({},this);},_appendMarker:function(_18){this.mapObj.marker=new _6.geo.charting._Marker(_18,this);},_createZoomingCursor:function(){if(!_4.byId("mapZoomCursor")){var _19=_4.doc.createElement("div");_4.attr(_19,"id","mapZoomCursor");_4.addClass(_19,"mapZoomIn");_4.style(_19,"display","none");_4.body().appendChild(_19);}},onFeatureClick:function(_1a){},onFeatureOver:function(_1b){},onZoomEnd:function(_1c){}});}}};});