MCPcopy Index your code
hub / github.com/Maps4HTML/MapML.js / getFallbackBounds

Method getFallbackBounds

src/map-link.js:872–913  ·  view source on GitHub ↗
(projection)

Source from the content-addressed store, hash-verified

870 return bnds;
871 }
872 getFallbackBounds(projection) {
873 let bnds;
874
875 let zoom = 0;
876 let metaExtent = this.parentElement.getMeta('extent');
877 if (metaExtent) {
878 let content = Util._metaContentToObject(
879 metaExtent.getAttribute('content')
880 ),
881 cs;
882
883 zoom = content.zoom || zoom;
884
885 let metaKeys = Object.keys(content);
886 for (let i = 0; i < metaKeys.length; i++) {
887 if (!metaKeys[i].includes('zoom')) {
888 cs = Util.axisToCS(metaKeys[i].split('-')[2]);
889 break;
890 }
891 }
892 let axes = Util.csToAxes(cs);
893 bnds = Util.boundsToPCRSBounds(
894 bounds(
895 point(
896 +content[`top-left-${axes[0]}`],
897 +content[`top-left-${axes[1]}`]
898 ),
899 point(
900 +content[`bottom-right-${axes[0]}`],
901 +content[`bottom-right-${axes[1]}`]
902 )
903 ),
904 zoom,
905 projection,
906 cs
907 );
908 } else {
909 let crs = M[projection];
910 bnds = crs.options.crs.pcrs.bounds;
911 }
912 return bnds;
913 }
914 getBase() {
915 let layer = this.getRootNode().host;
916 //

Callers 1

getBoundsMethod · 0.95

Calls 4

boundsFunction · 0.85
getAttributeMethod · 0.80
keysMethod · 0.80
getMetaMethod · 0.45

Tested by

no test coverage detected