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

Method validScale

src/openlayers/mapping/WebMap.js:761–774  ·  view source on GitHub ↗
(scale)

Source from the content-addressed store, hash-verified

759 }
760
761 validScale(scale) {
762 if (!scale) {
763 return false;
764 }
765 const scaleNum = scale.split(':')[1];
766 if (!scaleNum) {
767 return false;
768 }
769 const res = 1 / +scaleNum;
770 if (res === Infinity || res >= 1) {
771 return false;
772 }
773 return true;
774 }
775
776 limitScale(mapInfo, baseLayer) {
777 if (this.validScale(mapInfo.minScale) && this.validScale(mapInfo.maxScale)) {

Callers 1

limitScaleMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected