最近在用arcgis js api 3.x版本的时候,需要缩放到多个graphic的外包围,一开始想着去判断每个graphic的几何空间范围,然后获取xmax,ymax,xmin,和ymin。需要遍历一graphic数组,然后获取最终的外包围。
幸亏仔细看了下API,发现已经有了这个接口。
equire(["esri/graphicsUtils"], function(graphicsUtils) { /* code goes here */ });
Description
Utility methods for working with graphics.
getGeometries(graphics) | Geometry[] |
Converts an array of graphics to an array of geometries. |
graphicsExtent(graphics) |
|