MCPcopy Create free account
hub / github.com/SuperMap/iClient-JavaScript / isChartInMap

Method isChartInMap

src/openlayers/overlay/Graph.js:368–380  ·  view source on GitHub ↗

* @function Graph.prototype.isChartInMap * @description 判断图表是否在地图里。 * @param {Bounds} mapPxBounds - 地图像素范围。 * @param {Array. } chartPxBounds - 图表范围的四边形节点数组。

(mapPxBounds, chartPxBounds)

Source from the content-addressed store, hash-verified

366 * @param {Array.<Object>} chartPxBounds - 图表范围的四边形节点数组。
367 */
368 isChartInMap(mapPxBounds, chartPxBounds) {
369 var mb = mapPxBounds;
370 var isIn = false;
371 for (var i = 0, len = chartPxBounds.length; i < len; i++) {
372 var cb = chartPxBounds[i];
373
374 if (cb.x >= mb.left && cb.x <= mb.right && cb.y >= mb.top && cb.y <= mb.bottom) {
375 isIn = true;
376 break;
377 }
378 }
379 return isIn;
380 }
381
382 /**
383 * @function Graph.prototype.clearCache

Callers 2

drawChartsMethod · 0.95
GraphThemeLayer.jsFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected