Arcgis for Js ögraphiclayer À Õ Ï ê â
~Úç° á~~ú£;%%%² µámámöööö²» í~%%%%%%%%%^%%%%%%%%%%%%%%%%%%%%» öööö Ç ç» Ó óúrantà ë µä£;%%%%%» ööç çor%%%%% ***************** (2)» Í ¬ μä¾ À à ¶ Ç çírâ ¹ À {esri/layers/GraphicsLayer · Education · râ '{µöµä£ £. ~ú± ~~ú£;***********%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
~× ~È £;ú~² ~â â ~~~~öç° £;~~=' API 'api ö~esri/layers/GraphicsLayer µäò» ² {{*********************************************************************
1) Comment comment '''character "» ö ögraphiclayer
~Úesri ~~~µäapi ö{£}'' ''{__ GraphicLayer Ó mámöööööö {£°
& Quot; Have & quot; http://www.bkjia.com/kf/ware/vc/ & quot; target = & quot; _ blank & quot; class = & quot; keylink & quot; & gt; vcD4KPHA + pgltzybzcm9 & quot; http://www.2cto.com/uploadfile/Collfiles/20141118/20141118082241184.png & quot; alt = & quot; \ & quot; & gt;
» Please visit £°
Ú úµú~~öööö?½ {µäoptions µä² {° ° ü À? £°
2) invalid GraphicLayer maid
GraphicLayer μ äê Ð ° ü ° U?
~Äö~£ ******************************************************
A. Drawing graphics £° {{{{{{%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ü ° limit µägraphic limit Ï ózó £.
B) visiable £° ² without passing through languestee £;graphiclayer ***************************************************
C. Faster visiableAtMapScale £° 2. Then ~~~~~~~â ~%%%%%%%%%% ************************************
3) implements Graphiclayer maid
Ímö~£;° {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ééü° üc has been set to £;*ú' ²» have been set?
Ó Ï Â À '£;{{graphiclayer =£
GraphicLayer ² µã ° Ü É £;%%%» óúlibrary \ 3.9 \ 3.9 \ js \ esri \ layers \ GraphicsLayer. js £ ¶« Î Ç» Ç 正ã» ×ö± ä» £ £ ***************************************************** £?
A worker _ setMap
// Öع¹esri/layers/GraphicsLayer·½·¨ _setMap: function(map, surface) { // GraphicsLayer will add its own listener here var div = this.inherited(arguments); return div; }
B worker _ unsetMap
_unsetMap: function() { this.inherited(arguments); }
C branch drawing _ draw
_draw:function(graphic, redrawFlag, zoomFlag){ if (!this._map) { return; } }
'Antíâ £;» Ó Ð Ò» Ð µí~~%%%%%%%%%%%%%%%%_ onPanStartHandler %%%%%%%_ onZoomStartHandler %%%%%_ onExtentChangeHandler {0} {0} {0} {0} {0} {0} {0} {0} {0} {0 }.
define([ "dojo/_base/declare", "esri/layers/GraphicsLayer"], function ( declare, GraphicsLayer ) { return declare([GraphicsLayer], { constructor: function(options) { //²ÎÊýÉèÖà this._id = options.id || ""; this._divId = options.chartDiv || "chart"; }, // Öع¹esri/layers/GraphicsLayer·½·¨ _setMap: function(map, surface) { // GraphicsLayer will add its own listener here var div = this.inherited(arguments); return div; }, _unsetMap: function() { this.inherited(arguments); }, //ÍÏק _onPanStartHandler: function() { // }, //Ëõ·Å _onZoomStartHandler:function(){ // }, _onExtentChangeHandler: function(delta, extent, levelChange, lod) { // }, _draw:function(graphic){ if (!this._map) { return; } // } });});
À ý ×ó£°Químímáímímímímān
ͳ ¼ Í Â ¹ dojo chart µ µö ö£;â ~~~â £°
define([ "dojo/_base/declare", "esri/layers/GraphicsLayer", "esri/geometry/Point", "esri/graphic", "dojox/charting/Chart2D", "dojox/charting/themes/PlotKit/blue", "dojox/charting/action2d/Highlight", "dojox/charting/action2d/Tooltip"], function ( declare, GraphicsLayer, Point, Graphic, Chart2D, theme, Highlight, Tooltip ) { return declare([GraphicsLayer], { constructor: function(options) { this._id = options.id || ""; this._divId = options.chartDiv || "chart"; this._charttype = options.chartType || "Pie"; this._chartSize = options.size || 50; }, // Öع¹esri/layers/GraphicsLayer·½·¨ _setMap: function(map, surface) { // GraphicsLayer will add its own listener here var div = this.inherited(arguments); return div; }, _unsetMap: function() { this.inherited(arguments); }, hide: function() { dojo.style(dojo.byId(this._divId),{ "display": "none" }); }, show: function() { dojo.style(dojo.byId(this._divId),{ "display": "" }); }, //ÍÏק _onPanStartHandler: function() { this.hide(); }, //Ëõ·Å _onZoomStartHandler:function(){ this.hide(); }, _onExtentChangeHandler: function() { this._refresh(true); }, _refresh: function(redraw) { var that=this; var gs = this.graphics, _draw = this._draw; for (i = 0; i < gs.length; i++) { _draw(gs[i], redraw); } this.show(); }, _draw:function(graphic, redraw){ if (!this._map) { return; } if(graphic instanceof Graphic)//ÅжÏgraphicÊÇ·ñΪMapChartGraphicÀàÐÍ { this._drawChart(graphic,redraw); } }, _drawChart:function(graphic,redraw){ var showMapPt = graphic.geometry, attribute = graphic.attributes; var showPt = map.toScreen(showMapPt); var id=attribute.code, series = [attribute.male, attribute.female]; if(redraw){ dojo.byId(this._divId).removeChild(dojo.byId("div"+id)); } if(attribute){ var _chartDiv = dojo.doc.createElement("div"); _chartDiv.id ="div"+id; dojo.style(_chartDiv, { "left": (showPt.x-this._chartSize/4) + "px", "top": (showPt.y-this._chartSize/2) + "px", "position": "absolute", "width": this._chartSize + "px", "height": this._chartSize + "px" }); dojo.byId(this._divId).appendChild(_chartDiv); var _chart = new Chart2D(_chartDiv); var _themes = dojox.charting.themes.PlotKit.blue; _themes.chart.fill = "transparent"; _themes.chart.stroke = "transparent"; _themes.plotarea.fill = "transparent"; _chart.setTheme(_themes); switch(this._charttype){ case "Pie":{//±ý״ͼ _chart.addPlot("default", { type: this._charttype, labels:false }); break; } case "StackedColumns":{//Öù×´¶Ñ»ýͼ _chart.addPlot("default", { type: this._charttype, labels:false, markers: true, gap: 2 }); break; } case "Lines":{//Öù×´¶Ñ»ýͼ _chart.addPlot("default", { type: this._charttype, labels:false, markers: true, radius: 1, tension:"X" }); break; } default:{//Öù״ͼ _chart.addPlot("default", { type: this._charttype, labels:false, gap: 3 }); chart.addAxis("y", { vertical:true, fixLower: "major", fixUpper: "major" }); break; } } _chart.addSeries(id, series,{stroke: {width:1}}); //Ч¹û new Highlight(_chart, "default", {highlight: "lightskyblue"}); new Tooltip(_chart, "default"); _chart.render(); } } });});
Ê μ Ï ö° óµä§ § ¹ ~~~~â £°
Çó ********************************************************************
QQ £° 1004740957
E-Mail £° niujp08 @ qq.com