@basemaps/landing 6.31.0 → 6.32.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/dist/examples/index.openlayers.attribution.wmts.3857.html +1 -1
- package/dist/{index-6.31.0-467e63869a31f2e1.css → index-6.32.2-467e63869a31f2e1.css} +0 -0
- package/dist/{index-6.31.0-a46fbc728fb71e99.js → index-6.32.2-d5ef8d5c710433b0.js} +1 -1
- package/dist/{index-6.31.0-b529b35196707f56.js → index-6.32.2-d7430163446fc7bf.js} +1 -1
- package/dist/index.html +2 -2
- package/dist/index.js +1 -1
- package/dist/lib/{attribution-6.31.0-431936fcac8e2647.js → attribution-6.32.2-431936fcac8e2647.js} +0 -0
- package/dist/lib/{attribution-6.31.0-a5dcb359f35150b9.js → attribution-6.32.2-a5dcb359f35150b9.js} +0 -0
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,30 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [6.32.2](https://github.com/linz/basemaps/compare/v6.32.1...v6.32.2) (2022-07-28)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @basemaps/landing
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [6.32.1](https://github.com/linz/basemaps/compare/v6.32.0...v6.32.1) (2022-07-28)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @basemaps/landing
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# [6.32.0](https://github.com/linz/basemaps/compare/v6.31.0...v6.32.0) (2022-07-28)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @basemaps/landing
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
6
30
|
# [6.31.0](https://github.com/linz/basemaps/compare/v6.30.0...v6.31.0) (2022-07-22)
|
|
7
31
|
|
|
8
32
|
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.3.1/css/ol.css"
|
|
8
8
|
type="text/css" />
|
|
9
9
|
<script src="https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.3.1/build/ol.js"></script>
|
|
10
|
-
<script src="../lib/attribution-6.
|
|
10
|
+
<script src="../lib/attribution-6.32.2-a5dcb359f35150b9.js" integrity="sha512-pdyzWfNRULnTqKS/7l7Cpz01oahUjsKk1QO0F1C+ZACqxwM3yvvXQOF88SP78pWAf2EGystuQ0OdOTR42bkmEQ=="></script>
|
|
11
11
|
</head>
|
|
12
12
|
|
|
13
13
|
<body>
|
|
File without changes
|
|
@@ -27712,7 +27712,7 @@ var Config = {
|
|
|
27712
27712
|
return "UA-23232486-4";
|
|
27713
27713
|
},
|
|
27714
27714
|
get Version() {
|
|
27715
|
-
return "v6.
|
|
27715
|
+
return "v6.32.2";
|
|
27716
27716
|
},
|
|
27717
27717
|
map: new MapConfig()
|
|
27718
27718
|
};
|
|
@@ -547,7 +547,7 @@ PARAMETER["false_easting",1600000],
|
|
|
547
547
|
PARAMETER["false_northing",10000000],
|
|
548
548
|
UNIT["metre",1,
|
|
549
549
|
AUTHORITY["EPSG","9001"]],
|
|
550
|
-
AUTHORITY["EPSG","2193"]]`;Co.defs(Ve.Nztm2000.toEpsgString(),eg);Co.defs(Ve.Citm2000.toEpsgString(),tg);var lp=new Map;function _1(s){return s==null?null:typeof s=="number"?s:"code"in s?s.code:"projection"in s?s.projection.code:null}var Us=class{constructor(l){this.epsg=l;try{this.projection=Co(l.toEpsgString(),Ve.Wgs84.toEpsgString())}catch(h){throw new Ao(`Failed to create projection: ${l.toEpsgString()}, ${Ve.Wgs84.toEpsgString()}`,500,h)}}static define(l,h){if(lp.get(l.code)!=null)throw new Error("Duplicate projection definition: "+l.toEpsgString());Co.defs(l.toEpsgString(),h)}static get(l){let h=this.tryGet(l);if(h==null)throw new Error(`Invalid projection: ${l}`);return h}static tryGet(l){let h=_1(l);if(h==null)return null;let y=lp.get(h);if(y!=null)return y;let _=Ve.tryGet(h);return _==null||Co.defs(_.toEpsgString())==null?null:(y=new Us(_),lp.set(h,y),y)}projectMultipolygon(l,h){if(h.epsg.code===this.epsg.code)return l;let{toWgs84:y}=this,{fromWgs84:_}=h;return l.map(a=>a.map(T=>T.map(M=>_(y(M)))))}get toWgs84(){return this.projection.forward}get fromWgs84(){return this.projection.inverse}boundsToWgs84BoundingBox(l){let h=this.toWgs84([l.x,l.y]),y=this.toWgs84([l.x+l.width,l.y+l.height]);return[h[0],h[1],y[0],y[1]]}boundsToGeoJsonFeature(l,h={}){let y=[l.x,l.y],_=[l.x+l.width,l.y],a=[l.x,l.y+l.height],T=[l.x+l.width,l.y+l.height],M=xf([[[y,a,T,_,y]]],this.toWgs84),D=M.length===1?vf(M[0],h):bf(M,h);return D.bbox=this.boundsToWgs84BoundingBox(l),D}toGeoJson(l){return{type:"FeatureCollection",features:l.map(h=>this.boundsToGeoJsonFeature(h,{name:h.name}))}}static getTiffResZoom(l,h,y=1){let _=0;for(;_<l.zooms.length;++_)if(l.pixelScale(_)<=h*y)return _;if(_===l.zooms.length)return _-1;throw new Error("ResZoom not found")}static tileToWgs84Bbox(l,h){let y=l.tileToSource(h),_=l.tileToSource({x:h.x+1,y:h.y+1,z:h.z}),a=this.get(l),[T,M]=a.toWgs84([y.x,_.y]),[D,N]=a.toWgs84([_.x,y.y]);return[T,M,D,N]}static tileCenterToLatLon(l,h){let y=l.tileToSource({x:h.x+.5,y:h.y+.5,z:h.z}),[_,a]=this.get(l).toWgs84([y.x,y.y]);return Us.wrapLatLon(a,_)}static wrapLatLon(l,h){let y={lat:l,lon:h},_=Math.floor(Math.abs(l)/90)%4,a=l>0?90:-90,T=l%90;switch(_){case 0:y.lat=T;break;case 1:y.lat=a-T,y.lon+=180;break;case 2:y.lat=-T,y.lon+=180;break;case 3:y.lat=-a+T;break}return(y.lon>180||y.lon<-180)&&(y.lon-=Math.floor((y.lon+180)/360)*360),y}static findAlignmentLevels(l,h,y){return Math.max(0,this.getTiffResZoom(l,y,2)-h.z)}static getImagePixelWidth(l,h,y){let _=l.tileToSource(h),a=l.tileToSource({x:h.x+1,y:h.y+1,z:h.z});return Math.round((a.x-_.x)/l.pixelScale(y))*2}};Z();var Ri={ImageFormat:"png",toHash(s){return`#@${s.lat.toFixed(7)},${s.lon.toFixed(7)},z${s.zoom}`},parseZoom(s){return s==null||s===""?NaN:s.startsWith("z")?parseFloat(s.slice(1)):s.endsWith("z")?parseFloat(s):NaN},fromHash(s){let l={},h=s.replace("#@",""),[y,_,a]=h.split(","),T=parseFloat(y),M=parseFloat(_);!isNaN(T)&&!isNaN(M)&&(l.lat=T,l.lon=M);let D=Ri.parseZoom(a);return isNaN(D)||(l.zoom=D),l},baseUrl(){let s=Pt.BaseUrl;if(s==="")return window.location.origin;if(!s.startsWith("http"))throw new Error("BaseURL must start with http(s)://");return s},toBaseWmts(){let s=Pt.ApiKey==null||Pt.ApiKey===""?"":`?api=${Pt.ApiKey}`;return`${this.baseUrl()}/v1/tiles/aerial/WMTSCapabilities.xml${s}`},toImageryUrl(s,l){return`${this.baseUrl()}/v1/imagery/${s}/${l}`},toTileUrl(s,l,h,y){let _=Pt.ApiKey==null||Pt.ApiKey===""?"":`?api=${Pt.ApiKey}`,a=`${this.baseUrl()}/v1/tiles/${h}/${l.identifier}`;if(s==="raster")return`${a}/{z}/{x}/{y}.${Ri.ImageFormat}${_}`;if(s==="vector-xyz")return`${a}/{z}/{x}/{y}.pbf${_}`;if(s==="style")return`${a}/style/${y}.json${_}`;if(s==="wmts")return`${a}/WMTSCapabilities.xml${_}`;if(s==="attribution")return`${a}/attribution.json${_}`;if(s==="tile-wmts")return`${a}/{TileMatrix}/{TileCol}/{TileRow}.${Ri.ImageFormat}${_}`;throw new Error("Unknown url type: "+s)}};var jl=class{constructor(l,h=0){this.tileMatrix=l,this.extraZoomLevels=h}getStyle(l,h){return l==="topographic"?Ri.toTileUrl("style",this.tileMatrix,l,h):{version:8,sources:{basemaps:{type:"raster",tiles:[Ri.toTileUrl("raster",this.tileMatrix,l)],tileSize:256}},layers:[{id:"LINZ Raster Basemaps",type:"raster",source:"basemaps"}]}}},x1=new jl(ts,2),v1=new jl(An),rg=new jl(ii),b1=[x1,v1,rg];function Po(s){for(let l of b1)if(s===l.tileMatrix.identifier)return l;return rg}function ig(s){return s.identifier===ii.identifier}function kn(s,l,h){if(l.identifier===h.identifier)return s;if(!ig(l)&&!ig(h))throw new Error("Either tileMatrix or targetTileMatrix must be GoogleTms");let y=Us.get(l).fromWgs84([s.lon,s.lat]),_=l.sourceToPixels(y[0],y[1],Math.round(s.zoom)),a={x:_.x/l.tileSize,y:_.y/l.tileSize,z:Math.round(s.zoom)},T=h.tileToSource(a),M=Us.get(h).toWgs84([T.x,T.y]);return{lon:Math.round(M[0]*1e8)/1e8,lat:Math.round(M[1]*1e8)/1e8,zoom:s.zoom}}function ng(s,l){for(let h of s.features){if(h.geometry.type!=="Polygon")throw new Error("Only polygons supported");for(let y of h.geometry.coordinates)for(let _ of y){let a=kn({lat:_[1],lon:_[0],zoom:l.maxZoom},l,ii);_[0]=a.lon,_[1]=a.lat}}}var sg={[ii.identifier]:{lat:-41.88999621,lon:174.04924373,zoom:5},[ts.identifier]:{lat:-41.277848,lon:174.6763921,zoom:3},[An.identifier]:{lat:-41.88999621,lon:174.04924373,zoom:3}},tn=class extends ag.Emitter{constructor(){super(...arguments);this.style=null;this.layerId="aerial";this.tileMatrix=ii;this.debug={...mo}}get layers(){return this._layers==null&&(this._layers=w1()),this._layers}get isDebug(){return this.debug.debug}get location(){return this._location==null&&(window.addEventListener("popstate",()=>{let h={...sg[this.tileMatrix.identifier],...Ri.fromHash(window.location.hash)};this.setLocation(h)}),this.updateFromUrl(),this._location={...sg[this.tileMatrix.identifier],...Ri.fromHash(window.location.hash)}),this._location}get transformedLocation(){return this.transformLocation(this.location.lat,this.location.lon,this.location.zoom)}get isVector(){return this.layerId==="topographic"}get layerKey(){return this.style==null?this.layerId:`${this.layerId}::${this.style}`}get layerKeyTms(){return`${this.layerKey}::${this.tileMatrix.identifier}`}updateFromUrl(h=window.location.search){let y=new URLSearchParams(h),_=y.get("s")??y.get("style"),a=y.get("i")??"aerial",T=(y.get("p")??ii.identifier).toLowerCase(),M=ma.All.find(L=>L.identifier.toLowerCase()===T);M==null&&(M=ma.get(Ve.parse(T)??Ve.Google)),M.identifier===ts.identifier&&(M=An),Rl.fromUrl(this.debug,y)&&this.emit("change");let N=tn.toUrl(this);this.style=_??null,this.layerId=a.startsWith("im_")?a.slice(3):a,this.tileMatrix=M,this.layerId==="topographic"&&this.style==null&&(this.style="topographic"),this.emit("tileMatrix",this.tileMatrix),this.emit("layer",this.layerId,this.style),N!==tn.toUrl(this)&&this.emit("change")}static toUrl(h){let y=new URLSearchParams;return h.style&&y.append("s",h.style),h.layerId!=="aerial"&&y.append("i",h.layerId),h.tileMatrix.identifier!==ii.identifier&&y.append("p",h.tileMatrix.identifier),Rl.toUrl(h.debug,y),y.toString()}toTileUrl(h,y=this.tileMatrix,_=this.layerId,a=this.style){return Ri.toTileUrl(h,y,_,a)}getLocation(h){let y=h.getCenter();if(y==null)throw new Error("Invalid Map location");let _=Math.floor((h.getZoom()??0)*1e4)/1e4;return Pt.map.transformLocation(y.lat,y.lng,_)}transformLocation(h,y,_){return kn({lat:h,lon:y,zoom:_},ii,this.tileMatrix)}setLocation(h){h.lat===this.location.lat&&h.lon===this.location.lon&&h.zoom===this.location.zoom||(this.location.lat=h.lat,this.location.lon=h.lon,this.location.zoom=h.zoom,this.emit("location",this.location),this.emit("change"))}setTileMatrix(h){this.tileMatrix.identifier!==h.identifier&&(this.emit("tileMatrix",this.tileMatrix),this.emit("change"))}setLayerId(h,y){this.layerId===h&&this.style===y||(this.layerId=h,this.style=y??null,this.emit("layer",this.layerId,this.style),this.emit("change"))}setDebug(h,y=mo[h]){this.debug[h]!==y&&(this.debug[h]=y,this.emit("change"))}};async function w1(){let s=new Map,l=await fetch(Ri.toBaseWmts());if(!l.ok)return s;let _=new DOMParser().parseFromString(await l.text(),"text/xml").getElementsByTagName("Layer"),a=[];for(let T=0;T<_.length;T++){let M=_.item(T);if(M==null)continue;let D=M.getElementsByTagName("ows:Title").item(0)?.textContent,N=M.getElementsByTagName("ows:Identifier").item(0)?.textContent;if(D==null||N==null||D==="aerial")continue;let L=M.getElementsByTagName("ows:Keyword").item(0)?.textContent,tt=M.getElementsByTagName("ows:WGS84BoundingBox").item(0),pt=tt?.getElementsByTagName("ows:UpperCorner").item(0)?.textContent?.split(" ").map(Number),ft=tt?.getElementsByTagName("ows:LowerCorner").item(0)?.textContent?.split(" ").map(Number),yt=M.getElementsByTagName("TileMatrixSet"),Ft=new Set;for(let kt=0;kt<yt.length;kt++){let Ot=S1(yt.item(kt)?.textContent??"");Ot!=null&&Ft.add(Ot.code)}pt==null||ft==null||pt.length!==2||a.push({id:N,name:D.replace("aerial ",""),upperLeft:pt,lowerRight:ft,projections:Ft,category:L})}a.sort((T,M)=>T.name.localeCompare(M.name)),M1(s);for(let T of a)s.set(T.id,T);return s}function M1(s){s.set("aerial",{id:"aerial",name:"Aerial Imagery",projections:new Set([We.Nztm2000,We.Google]),category:"Basemaps"}),s.set("topographic::topographic",{id:"topographic::topographic",name:"Topographic",projections:new Set([We.Google]),category:"Basemaps"})}function S1(s){if(s.toLowerCase().startsWith("epsg"))return Ve.parse(s);let l=ma.find(s);return l==null?null:l.projection}var T1=sf(),Pt={get BaseUrl(){return""},get ApiKey(){return T1},get GoogleAnalytics(){return"UA-23232486-3"},get Version(){return"v6.31.0"},map:new tn};if(Pt.GoogleAnalytics!==""&&typeof window<"u"){window.dataLayer=window.dataLayer||[],window.gtag=function(){window.dataLayer.push(arguments)},window.gtag("js",new Date),window.gtag("config",`${Pt.GoogleAnalytics}`);let s=document.createElement("script");s.setAttribute("async",""),s.setAttribute("src",`https://www.googletagmanager.com/gtag/js?id=${Pt.GoogleAnalytics}`),document.head.appendChild(s)}function Ma(s,l,h){Pt.GoogleAnalytics!==""&&window.gtag("event",l,{event_category:s,value:h})}Z();Jr();var $l=class extends Ti{render(l){return K("i",{class:"material-icons-round md-36"},l.name)}},Ln=class extends Ti{render(l){return K("a",{rel:"noopener",target:"_blank",href:l.href,style:"display:flex;","aria-label":l.ariaLabel},l.children,l.icon?K($l,{name:l.icon}):void 0)}};var vc=class extends Ti{constructor(){super(...arguments);this._events=[]}componentWillMount(){this._events.push(Pt.map.on("change",()=>this.setState(this.state)))}componentWillUnmount(){for(let h of this._events)h();this._events=[]}render(){if(!Pt.map.isDebug)return K("footer",{class:"lui-footer lui-footer-small lui-hide-sm lui-hide-xs",role:"contentinfo"},K("div",{class:"lui-footer-columns"},K("div",{style:"display:flex; align-items:center"},K(Ln,{href:"http://www.govt.nz/",ariaLabel:"New Zealand Government"},K("img",{src:"/assets/logo-nz-govt.svg"}))),K("div",{class:"justify-end"},K("ul",{class:"lui-footer-list"},K("li",{class:"lui-footer-inline-list-item"},"\xA9 2021 Land Information New Zealand"),K("li",{class:"lui-footer-inline-list-item"},K(Ln,{href:"https://www.linz.govt.nz/contact-us"},"Contact")),K("li",{class:"lui-footer-inline-list-item"},K(Ln,{href:"https://www.linz.govt.nz/privacy"},"Privacy")),K("li",{class:"lui-footer-inline-list-item"},K(Ln,{href:"https://www.linz.govt.nz/data/linz-data/linz-basemaps/data-attribution"},"Data Attribution"))))))}};Z();Z();function og(s){var l,h,y="";if(typeof s=="string"||typeof s=="number")y+=s;else if(typeof s=="object")if(Array.isArray(s))for(l=0;l<s.length;l++)s[l]&&(h=og(s[l]))&&(y&&(y+=" "),y+=h);else for(l in s)s[l]&&(y&&(y+=" "),y+=l);return y}function bc(){for(var s=0,l,h,y="";s<arguments.length;)(l=arguments[s++])&&(h=og(l))&&(y&&(y+=" "),y+=h);return y}Jr();Z();Jr();Jr();Z();Jr();var cs=class extends Ti{constructor(){super(...arguments);this._copyTimeout=null;this.copy=()=>{Ma("Ui","copy:"+Pt.map.layerKey+":"+this.props.header.replace(/ /g,"").toLowerCase()),navigator.clipboard.writeText(this.props.value),this.setState({copied:!0}),this._copyTimeout!=null&&clearTimeout(this._copyTimeout),this._copyTimeout=setTimeout(()=>this.setState({copied:!1}),1e3)}}render(){return K("div",{class:"LuiDeprecatedForms"},K("label",null,this.props.header),K("div",{class:bc({"lui-menu-label":!0,"menu-copyable":!0,"menu-copyable-copied":this.state.copied})},K("button",{class:"menu-copyable-icon-button",title:"Copy",onClick:this.copy},K("i",{class:"material-icons-round"},this.state.copied?"check":"content_copy")),K("input",{value:this.props.value,readonly:!0})))}};Z();Jr();var wc=class extends Ti{constructor(){super(...arguments);this._events=[];this.onChange=h=>{let y=h.target,[_,a]=y.value.split("::");Pt.map.setLayerId(_,a),Ma("Ui","layer:"+y.value),Pt.map.layers.then(T=>{let M=T.get(_);M!=null&&Pt.map.emit("bounds",[M.upperLeft,M.lowerRight])}),window.history.pushState(null,"",`?${tn.toUrl(Pt.map)}`)}}componentWillMount(){this.setState({...this.state,currentLayer:Pt.map.layerKey}),Pt.map.layers.then(h=>this.setState({...this.state,layers:h})),this._events.push(Pt.map.on("layer",()=>this.setState({...this.state,currentLayer:Pt.map.layerKey})),Pt.map.on("tileMatrix",()=>this.setState(this.state)))}componentWillUnmount(){for(let h of this._events)h();this._events=[]}render(){return K("div",{class:"LuiDeprecatedForms"},K("h6",null,"Layers"),K("select",{onChange:this.onChange,value:this.state.currentLayer},this.renderAerialLayers()))}renderAerialLayers(){if(this.state.layers==null||this.state.layers.size===0)return;let h=new Map;for(let _ of this.state.layers.values()){if(!_.projections.has(Pt.map.tileMatrix.projection.code))continue;let a=h.get(_.category??"Unknown")??[];a.push(K("option",{value:_.id},_.name.replace(` ${_.category}`,""))),h.set(_.category??"Unknown",a)}if(h.size===0)return;let y=[];for(let[_,a]of h.entries())a.length!==0&&y.push(K("optgroup",{label:_},...a));return K(_t,null,y)}};var Mc=class extends Ti{constructor(){super(...arguments);this._events=[];this.menuToggle=()=>{let h=!this.state.isMenuOpen;Ma("Ui",h?"menu:open":"menu:close"),this.setState({...this.state,isMenuOpen:h})};this.contactUs=()=>{let h="Request Basemaps Developer Access",y=`
|
|
550
|
+
AUTHORITY["EPSG","2193"]]`;Co.defs(Ve.Nztm2000.toEpsgString(),eg);Co.defs(Ve.Citm2000.toEpsgString(),tg);var lp=new Map;function _1(s){return s==null?null:typeof s=="number"?s:"code"in s?s.code:"projection"in s?s.projection.code:null}var Us=class{constructor(l){this.epsg=l;try{this.projection=Co(l.toEpsgString(),Ve.Wgs84.toEpsgString())}catch(h){throw new Ao(`Failed to create projection: ${l.toEpsgString()}, ${Ve.Wgs84.toEpsgString()}`,500,h)}}static define(l,h){if(lp.get(l.code)!=null)throw new Error("Duplicate projection definition: "+l.toEpsgString());Co.defs(l.toEpsgString(),h)}static get(l){let h=this.tryGet(l);if(h==null)throw new Error(`Invalid projection: ${l}`);return h}static tryGet(l){let h=_1(l);if(h==null)return null;let y=lp.get(h);if(y!=null)return y;let _=Ve.tryGet(h);return _==null||Co.defs(_.toEpsgString())==null?null:(y=new Us(_),lp.set(h,y),y)}projectMultipolygon(l,h){if(h.epsg.code===this.epsg.code)return l;let{toWgs84:y}=this,{fromWgs84:_}=h;return l.map(a=>a.map(T=>T.map(M=>_(y(M)))))}get toWgs84(){return this.projection.forward}get fromWgs84(){return this.projection.inverse}boundsToWgs84BoundingBox(l){let h=this.toWgs84([l.x,l.y]),y=this.toWgs84([l.x+l.width,l.y+l.height]);return[h[0],h[1],y[0],y[1]]}boundsToGeoJsonFeature(l,h={}){let y=[l.x,l.y],_=[l.x+l.width,l.y],a=[l.x,l.y+l.height],T=[l.x+l.width,l.y+l.height],M=xf([[[y,a,T,_,y]]],this.toWgs84),D=M.length===1?vf(M[0],h):bf(M,h);return D.bbox=this.boundsToWgs84BoundingBox(l),D}toGeoJson(l){return{type:"FeatureCollection",features:l.map(h=>this.boundsToGeoJsonFeature(h,{name:h.name}))}}static getTiffResZoom(l,h,y=1){let _=0;for(;_<l.zooms.length;++_)if(l.pixelScale(_)<=h*y)return _;if(_===l.zooms.length)return _-1;throw new Error("ResZoom not found")}static tileToWgs84Bbox(l,h){let y=l.tileToSource(h),_=l.tileToSource({x:h.x+1,y:h.y+1,z:h.z}),a=this.get(l),[T,M]=a.toWgs84([y.x,_.y]),[D,N]=a.toWgs84([_.x,y.y]);return[T,M,D,N]}static tileCenterToLatLon(l,h){let y=l.tileToSource({x:h.x+.5,y:h.y+.5,z:h.z}),[_,a]=this.get(l).toWgs84([y.x,y.y]);return Us.wrapLatLon(a,_)}static wrapLatLon(l,h){let y={lat:l,lon:h},_=Math.floor(Math.abs(l)/90)%4,a=l>0?90:-90,T=l%90;switch(_){case 0:y.lat=T;break;case 1:y.lat=a-T,y.lon+=180;break;case 2:y.lat=-T,y.lon+=180;break;case 3:y.lat=-a+T;break}return(y.lon>180||y.lon<-180)&&(y.lon-=Math.floor((y.lon+180)/360)*360),y}static findAlignmentLevels(l,h,y){return Math.max(0,this.getTiffResZoom(l,y,2)-h.z)}static getImagePixelWidth(l,h,y){let _=l.tileToSource(h),a=l.tileToSource({x:h.x+1,y:h.y+1,z:h.z});return Math.round((a.x-_.x)/l.pixelScale(y))*2}};Z();var Ri={ImageFormat:"png",toHash(s){return`#@${s.lat.toFixed(7)},${s.lon.toFixed(7)},z${s.zoom}`},parseZoom(s){return s==null||s===""?NaN:s.startsWith("z")?parseFloat(s.slice(1)):s.endsWith("z")?parseFloat(s):NaN},fromHash(s){let l={},h=s.replace("#@",""),[y,_,a]=h.split(","),T=parseFloat(y),M=parseFloat(_);!isNaN(T)&&!isNaN(M)&&(l.lat=T,l.lon=M);let D=Ri.parseZoom(a);return isNaN(D)||(l.zoom=D),l},baseUrl(){let s=Pt.BaseUrl;if(s==="")return window.location.origin;if(!s.startsWith("http"))throw new Error("BaseURL must start with http(s)://");return s},toBaseWmts(){let s=Pt.ApiKey==null||Pt.ApiKey===""?"":`?api=${Pt.ApiKey}`;return`${this.baseUrl()}/v1/tiles/aerial/WMTSCapabilities.xml${s}`},toImageryUrl(s,l){return`${this.baseUrl()}/v1/imagery/${s}/${l}`},toTileUrl(s,l,h,y){let _=Pt.ApiKey==null||Pt.ApiKey===""?"":`?api=${Pt.ApiKey}`,a=`${this.baseUrl()}/v1/tiles/${h}/${l.identifier}`;if(s==="raster")return`${a}/{z}/{x}/{y}.${Ri.ImageFormat}${_}`;if(s==="vector-xyz")return`${a}/{z}/{x}/{y}.pbf${_}`;if(s==="style")return`${a}/style/${y}.json${_}`;if(s==="wmts")return`${a}/WMTSCapabilities.xml${_}`;if(s==="attribution")return`${a}/attribution.json${_}`;if(s==="tile-wmts")return`${a}/{TileMatrix}/{TileCol}/{TileRow}.${Ri.ImageFormat}${_}`;throw new Error("Unknown url type: "+s)}};var jl=class{constructor(l,h=0){this.tileMatrix=l,this.extraZoomLevels=h}getStyle(l,h){return l==="topographic"?Ri.toTileUrl("style",this.tileMatrix,l,h):{version:8,sources:{basemaps:{type:"raster",tiles:[Ri.toTileUrl("raster",this.tileMatrix,l)],tileSize:256}},layers:[{id:"LINZ Raster Basemaps",type:"raster",source:"basemaps"}]}}},x1=new jl(ts,2),v1=new jl(An),rg=new jl(ii),b1=[x1,v1,rg];function Po(s){for(let l of b1)if(s===l.tileMatrix.identifier)return l;return rg}function ig(s){return s.identifier===ii.identifier}function kn(s,l,h){if(l.identifier===h.identifier)return s;if(!ig(l)&&!ig(h))throw new Error("Either tileMatrix or targetTileMatrix must be GoogleTms");let y=Us.get(l).fromWgs84([s.lon,s.lat]),_=l.sourceToPixels(y[0],y[1],Math.round(s.zoom)),a={x:_.x/l.tileSize,y:_.y/l.tileSize,z:Math.round(s.zoom)},T=h.tileToSource(a),M=Us.get(h).toWgs84([T.x,T.y]);return{lon:Math.round(M[0]*1e8)/1e8,lat:Math.round(M[1]*1e8)/1e8,zoom:s.zoom}}function ng(s,l){for(let h of s.features){if(h.geometry.type!=="Polygon")throw new Error("Only polygons supported");for(let y of h.geometry.coordinates)for(let _ of y){let a=kn({lat:_[1],lon:_[0],zoom:l.maxZoom},l,ii);_[0]=a.lon,_[1]=a.lat}}}var sg={[ii.identifier]:{lat:-41.88999621,lon:174.04924373,zoom:5},[ts.identifier]:{lat:-41.277848,lon:174.6763921,zoom:3},[An.identifier]:{lat:-41.88999621,lon:174.04924373,zoom:3}},tn=class extends ag.Emitter{constructor(){super(...arguments);this.style=null;this.layerId="aerial";this.tileMatrix=ii;this.debug={...mo}}get layers(){return this._layers==null&&(this._layers=w1()),this._layers}get isDebug(){return this.debug.debug}get location(){return this._location==null&&(window.addEventListener("popstate",()=>{let h={...sg[this.tileMatrix.identifier],...Ri.fromHash(window.location.hash)};this.setLocation(h)}),this.updateFromUrl(),this._location={...sg[this.tileMatrix.identifier],...Ri.fromHash(window.location.hash)}),this._location}get transformedLocation(){return this.transformLocation(this.location.lat,this.location.lon,this.location.zoom)}get isVector(){return this.layerId==="topographic"}get layerKey(){return this.style==null?this.layerId:`${this.layerId}::${this.style}`}get layerKeyTms(){return`${this.layerKey}::${this.tileMatrix.identifier}`}updateFromUrl(h=window.location.search){let y=new URLSearchParams(h),_=y.get("s")??y.get("style"),a=y.get("i")??"aerial",T=(y.get("p")??ii.identifier).toLowerCase(),M=ma.All.find(L=>L.identifier.toLowerCase()===T);M==null&&(M=ma.get(Ve.parse(T)??Ve.Google)),M.identifier===ts.identifier&&(M=An),Rl.fromUrl(this.debug,y)&&this.emit("change");let N=tn.toUrl(this);this.style=_??null,this.layerId=a.startsWith("im_")?a.slice(3):a,this.tileMatrix=M,this.layerId==="topographic"&&this.style==null&&(this.style="topographic"),this.emit("tileMatrix",this.tileMatrix),this.emit("layer",this.layerId,this.style),N!==tn.toUrl(this)&&this.emit("change")}static toUrl(h){let y=new URLSearchParams;return h.style&&y.append("s",h.style),h.layerId!=="aerial"&&y.append("i",h.layerId),h.tileMatrix.identifier!==ii.identifier&&y.append("p",h.tileMatrix.identifier),Rl.toUrl(h.debug,y),y.toString()}toTileUrl(h,y=this.tileMatrix,_=this.layerId,a=this.style){return Ri.toTileUrl(h,y,_,a)}getLocation(h){let y=h.getCenter();if(y==null)throw new Error("Invalid Map location");let _=Math.floor((h.getZoom()??0)*1e4)/1e4;return Pt.map.transformLocation(y.lat,y.lng,_)}transformLocation(h,y,_){return kn({lat:h,lon:y,zoom:_},ii,this.tileMatrix)}setLocation(h){h.lat===this.location.lat&&h.lon===this.location.lon&&h.zoom===this.location.zoom||(this.location.lat=h.lat,this.location.lon=h.lon,this.location.zoom=h.zoom,this.emit("location",this.location),this.emit("change"))}setTileMatrix(h){this.tileMatrix.identifier!==h.identifier&&(this.emit("tileMatrix",this.tileMatrix),this.emit("change"))}setLayerId(h,y){this.layerId===h&&this.style===y||(this.layerId=h,this.style=y??null,this.emit("layer",this.layerId,this.style),this.emit("change"))}setDebug(h,y=mo[h]){this.debug[h]!==y&&(this.debug[h]=y,this.emit("change"))}};async function w1(){let s=new Map,l=await fetch(Ri.toBaseWmts());if(!l.ok)return s;let _=new DOMParser().parseFromString(await l.text(),"text/xml").getElementsByTagName("Layer"),a=[];for(let T=0;T<_.length;T++){let M=_.item(T);if(M==null)continue;let D=M.getElementsByTagName("ows:Title").item(0)?.textContent,N=M.getElementsByTagName("ows:Identifier").item(0)?.textContent;if(D==null||N==null||D==="aerial")continue;let L=M.getElementsByTagName("ows:Keyword").item(0)?.textContent,tt=M.getElementsByTagName("ows:WGS84BoundingBox").item(0),pt=tt?.getElementsByTagName("ows:UpperCorner").item(0)?.textContent?.split(" ").map(Number),ft=tt?.getElementsByTagName("ows:LowerCorner").item(0)?.textContent?.split(" ").map(Number),yt=M.getElementsByTagName("TileMatrixSet"),Ft=new Set;for(let kt=0;kt<yt.length;kt++){let Ot=S1(yt.item(kt)?.textContent??"");Ot!=null&&Ft.add(Ot.code)}pt==null||ft==null||pt.length!==2||a.push({id:N,name:D.replace("aerial ",""),upperLeft:pt,lowerRight:ft,projections:Ft,category:L})}a.sort((T,M)=>T.name.localeCompare(M.name)),M1(s);for(let T of a)s.set(T.id,T);return s}function M1(s){s.set("aerial",{id:"aerial",name:"Aerial Imagery",projections:new Set([We.Nztm2000,We.Google]),category:"Basemaps"}),s.set("topographic::topographic",{id:"topographic::topographic",name:"Topographic",projections:new Set([We.Google]),category:"Basemaps"})}function S1(s){if(s.toLowerCase().startsWith("epsg"))return Ve.parse(s);let l=ma.find(s);return l==null?null:l.projection}var T1=sf(),Pt={get BaseUrl(){return""},get ApiKey(){return T1},get GoogleAnalytics(){return"UA-23232486-3"},get Version(){return"v6.32.2"},map:new tn};if(Pt.GoogleAnalytics!==""&&typeof window<"u"){window.dataLayer=window.dataLayer||[],window.gtag=function(){window.dataLayer.push(arguments)},window.gtag("js",new Date),window.gtag("config",`${Pt.GoogleAnalytics}`);let s=document.createElement("script");s.setAttribute("async",""),s.setAttribute("src",`https://www.googletagmanager.com/gtag/js?id=${Pt.GoogleAnalytics}`),document.head.appendChild(s)}function Ma(s,l,h){Pt.GoogleAnalytics!==""&&window.gtag("event",l,{event_category:s,value:h})}Z();Jr();var $l=class extends Ti{render(l){return K("i",{class:"material-icons-round md-36"},l.name)}},Ln=class extends Ti{render(l){return K("a",{rel:"noopener",target:"_blank",href:l.href,style:"display:flex;","aria-label":l.ariaLabel},l.children,l.icon?K($l,{name:l.icon}):void 0)}};var vc=class extends Ti{constructor(){super(...arguments);this._events=[]}componentWillMount(){this._events.push(Pt.map.on("change",()=>this.setState(this.state)))}componentWillUnmount(){for(let h of this._events)h();this._events=[]}render(){if(!Pt.map.isDebug)return K("footer",{class:"lui-footer lui-footer-small lui-hide-sm lui-hide-xs",role:"contentinfo"},K("div",{class:"lui-footer-columns"},K("div",{style:"display:flex; align-items:center"},K(Ln,{href:"http://www.govt.nz/",ariaLabel:"New Zealand Government"},K("img",{src:"/assets/logo-nz-govt.svg"}))),K("div",{class:"justify-end"},K("ul",{class:"lui-footer-list"},K("li",{class:"lui-footer-inline-list-item"},"\xA9 2021 Land Information New Zealand"),K("li",{class:"lui-footer-inline-list-item"},K(Ln,{href:"https://www.linz.govt.nz/contact-us"},"Contact")),K("li",{class:"lui-footer-inline-list-item"},K(Ln,{href:"https://www.linz.govt.nz/privacy"},"Privacy")),K("li",{class:"lui-footer-inline-list-item"},K(Ln,{href:"https://www.linz.govt.nz/data/linz-data/linz-basemaps/data-attribution"},"Data Attribution"))))))}};Z();Z();function og(s){var l,h,y="";if(typeof s=="string"||typeof s=="number")y+=s;else if(typeof s=="object")if(Array.isArray(s))for(l=0;l<s.length;l++)s[l]&&(h=og(s[l]))&&(y&&(y+=" "),y+=h);else for(l in s)s[l]&&(y&&(y+=" "),y+=l);return y}function bc(){for(var s=0,l,h,y="";s<arguments.length;)(l=arguments[s++])&&(h=og(l))&&(y&&(y+=" "),y+=h);return y}Jr();Z();Jr();Jr();Z();Jr();var cs=class extends Ti{constructor(){super(...arguments);this._copyTimeout=null;this.copy=()=>{Ma("Ui","copy:"+Pt.map.layerKey+":"+this.props.header.replace(/ /g,"").toLowerCase()),navigator.clipboard.writeText(this.props.value),this.setState({copied:!0}),this._copyTimeout!=null&&clearTimeout(this._copyTimeout),this._copyTimeout=setTimeout(()=>this.setState({copied:!1}),1e3)}}render(){return K("div",{class:"LuiDeprecatedForms"},K("label",null,this.props.header),K("div",{class:bc({"lui-menu-label":!0,"menu-copyable":!0,"menu-copyable-copied":this.state.copied})},K("button",{class:"menu-copyable-icon-button",title:"Copy",onClick:this.copy},K("i",{class:"material-icons-round"},this.state.copied?"check":"content_copy")),K("input",{value:this.props.value,readonly:!0})))}};Z();Jr();var wc=class extends Ti{constructor(){super(...arguments);this._events=[];this.onChange=h=>{let y=h.target,[_,a]=y.value.split("::");Pt.map.setLayerId(_,a),Ma("Ui","layer:"+y.value),Pt.map.layers.then(T=>{let M=T.get(_);M!=null&&Pt.map.emit("bounds",[M.upperLeft,M.lowerRight])}),window.history.pushState(null,"",`?${tn.toUrl(Pt.map)}`)}}componentWillMount(){this.setState({...this.state,currentLayer:Pt.map.layerKey}),Pt.map.layers.then(h=>this.setState({...this.state,layers:h})),this._events.push(Pt.map.on("layer",()=>this.setState({...this.state,currentLayer:Pt.map.layerKey})),Pt.map.on("tileMatrix",()=>this.setState(this.state)))}componentWillUnmount(){for(let h of this._events)h();this._events=[]}render(){return K("div",{class:"LuiDeprecatedForms"},K("h6",null,"Layers"),K("select",{onChange:this.onChange,value:this.state.currentLayer},this.renderAerialLayers()))}renderAerialLayers(){if(this.state.layers==null||this.state.layers.size===0)return;let h=new Map;for(let _ of this.state.layers.values()){if(!_.projections.has(Pt.map.tileMatrix.projection.code))continue;let a=h.get(_.category??"Unknown")??[];a.push(K("option",{value:_.id},_.name.replace(` ${_.category}`,""))),h.set(_.category??"Unknown",a)}if(h.size===0)return;let y=[];for(let[_,a]of h.entries())a.length!==0&&y.push(K("optgroup",{label:_},...a));return K(_t,null,y)}};var Mc=class extends Ti{constructor(){super(...arguments);this._events=[];this.menuToggle=()=>{let h=!this.state.isMenuOpen;Ma("Ui",h?"menu:open":"menu:close"),this.setState({...this.state,isMenuOpen:h})};this.contactUs=()=>{let h="Request Basemaps Developer Access",y=`
|
|
551
551
|
Give us a few key details to sign up for Developer Access to LINZ Basemaps. We will respond with your Apps' unique API key.
|
|
552
552
|
|
|
553
553
|
Your Name:
|
package/dist/index.html
CHANGED
|
@@ -13,14 +13,14 @@
|
|
|
13
13
|
<meta name="twitter:image" property="og:image" content="/basemaps-card.jpeg" />
|
|
14
14
|
<meta name="twitter:description" property="og:description" content="NZ’s authoritative and open digital basemap service for LINZ and the public." />
|
|
15
15
|
|
|
16
|
-
<link rel="stylesheet" href="index-6.
|
|
16
|
+
<link rel="stylesheet" href="index-6.32.2-467e63869a31f2e1.css" integrity="Rn5jhpox8uHv3/aQSmdi9BRiq+HCpiSRZFy7N4tbFIn69Ff/C3tZsuay3iYmZ3LtZfMYrENZLox5+BTvaviT6g==" />
|
|
17
17
|
<link href="https://fonts.googleapis.com/icon?family=Material+Icons+Round" rel="stylesheet" />
|
|
18
18
|
<title>Basemaps | Land Information New Zealand (LINZ)</title>
|
|
19
19
|
</head>
|
|
20
20
|
|
|
21
21
|
<body class="checker-board">
|
|
22
22
|
<main id="main"></main>
|
|
23
|
-
<script src="index-6.
|
|
23
|
+
<script src="index-6.32.2-d7430163446fc7bf.js" integrity="sha512-10MBY0Rvx7+fZRxIVg1PHtBnO4PPQevHjj8/x0n0R+Ke4IjecUsThULyDggQAhbY4U0unCZhVo672CfgRhpYRw=="></script>
|
|
24
24
|
</body>
|
|
25
25
|
|
|
26
26
|
</html>
|
package/dist/index.js
CHANGED
|
@@ -547,7 +547,7 @@ PARAMETER["false_easting",1600000],
|
|
|
547
547
|
PARAMETER["false_northing",10000000],
|
|
548
548
|
UNIT["metre",1,
|
|
549
549
|
AUTHORITY["EPSG","9001"]],
|
|
550
|
-
AUTHORITY["EPSG","2193"]]`;Co.defs(Ve.Nztm2000.toEpsgString(),eg);Co.defs(Ve.Citm2000.toEpsgString(),tg);var lp=new Map;function _1(s){return s==null?null:typeof s=="number"?s:"code"in s?s.code:"projection"in s?s.projection.code:null}var Us=class{constructor(l){this.epsg=l;try{this.projection=Co(l.toEpsgString(),Ve.Wgs84.toEpsgString())}catch(h){throw new Ao(`Failed to create projection: ${l.toEpsgString()}, ${Ve.Wgs84.toEpsgString()}`,500,h)}}static define(l,h){if(lp.get(l.code)!=null)throw new Error("Duplicate projection definition: "+l.toEpsgString());Co.defs(l.toEpsgString(),h)}static get(l){let h=this.tryGet(l);if(h==null)throw new Error(`Invalid projection: ${l}`);return h}static tryGet(l){let h=_1(l);if(h==null)return null;let y=lp.get(h);if(y!=null)return y;let _=Ve.tryGet(h);return _==null||Co.defs(_.toEpsgString())==null?null:(y=new Us(_),lp.set(h,y),y)}projectMultipolygon(l,h){if(h.epsg.code===this.epsg.code)return l;let{toWgs84:y}=this,{fromWgs84:_}=h;return l.map(a=>a.map(T=>T.map(M=>_(y(M)))))}get toWgs84(){return this.projection.forward}get fromWgs84(){return this.projection.inverse}boundsToWgs84BoundingBox(l){let h=this.toWgs84([l.x,l.y]),y=this.toWgs84([l.x+l.width,l.y+l.height]);return[h[0],h[1],y[0],y[1]]}boundsToGeoJsonFeature(l,h={}){let y=[l.x,l.y],_=[l.x+l.width,l.y],a=[l.x,l.y+l.height],T=[l.x+l.width,l.y+l.height],M=xf([[[y,a,T,_,y]]],this.toWgs84),D=M.length===1?vf(M[0],h):bf(M,h);return D.bbox=this.boundsToWgs84BoundingBox(l),D}toGeoJson(l){return{type:"FeatureCollection",features:l.map(h=>this.boundsToGeoJsonFeature(h,{name:h.name}))}}static getTiffResZoom(l,h,y=1){let _=0;for(;_<l.zooms.length;++_)if(l.pixelScale(_)<=h*y)return _;if(_===l.zooms.length)return _-1;throw new Error("ResZoom not found")}static tileToWgs84Bbox(l,h){let y=l.tileToSource(h),_=l.tileToSource({x:h.x+1,y:h.y+1,z:h.z}),a=this.get(l),[T,M]=a.toWgs84([y.x,_.y]),[D,N]=a.toWgs84([_.x,y.y]);return[T,M,D,N]}static tileCenterToLatLon(l,h){let y=l.tileToSource({x:h.x+.5,y:h.y+.5,z:h.z}),[_,a]=this.get(l).toWgs84([y.x,y.y]);return Us.wrapLatLon(a,_)}static wrapLatLon(l,h){let y={lat:l,lon:h},_=Math.floor(Math.abs(l)/90)%4,a=l>0?90:-90,T=l%90;switch(_){case 0:y.lat=T;break;case 1:y.lat=a-T,y.lon+=180;break;case 2:y.lat=-T,y.lon+=180;break;case 3:y.lat=-a+T;break}return(y.lon>180||y.lon<-180)&&(y.lon-=Math.floor((y.lon+180)/360)*360),y}static findAlignmentLevels(l,h,y){return Math.max(0,this.getTiffResZoom(l,y,2)-h.z)}static getImagePixelWidth(l,h,y){let _=l.tileToSource(h),a=l.tileToSource({x:h.x+1,y:h.y+1,z:h.z});return Math.round((a.x-_.x)/l.pixelScale(y))*2}};Z();var Ri={ImageFormat:"png",toHash(s){return`#@${s.lat.toFixed(7)},${s.lon.toFixed(7)},z${s.zoom}`},parseZoom(s){return s==null||s===""?NaN:s.startsWith("z")?parseFloat(s.slice(1)):s.endsWith("z")?parseFloat(s):NaN},fromHash(s){let l={},h=s.replace("#@",""),[y,_,a]=h.split(","),T=parseFloat(y),M=parseFloat(_);!isNaN(T)&&!isNaN(M)&&(l.lat=T,l.lon=M);let D=Ri.parseZoom(a);return isNaN(D)||(l.zoom=D),l},baseUrl(){let s=Pt.BaseUrl;if(s==="")return window.location.origin;if(!s.startsWith("http"))throw new Error("BaseURL must start with http(s)://");return s},toBaseWmts(){let s=Pt.ApiKey==null||Pt.ApiKey===""?"":`?api=${Pt.ApiKey}`;return`${this.baseUrl()}/v1/tiles/aerial/WMTSCapabilities.xml${s}`},toImageryUrl(s,l){return`${this.baseUrl()}/v1/imagery/${s}/${l}`},toTileUrl(s,l,h,y){let _=Pt.ApiKey==null||Pt.ApiKey===""?"":`?api=${Pt.ApiKey}`,a=`${this.baseUrl()}/v1/tiles/${h}/${l.identifier}`;if(s==="raster")return`${a}/{z}/{x}/{y}.${Ri.ImageFormat}${_}`;if(s==="vector-xyz")return`${a}/{z}/{x}/{y}.pbf${_}`;if(s==="style")return`${a}/style/${y}.json${_}`;if(s==="wmts")return`${a}/WMTSCapabilities.xml${_}`;if(s==="attribution")return`${a}/attribution.json${_}`;if(s==="tile-wmts")return`${a}/{TileMatrix}/{TileCol}/{TileRow}.${Ri.ImageFormat}${_}`;throw new Error("Unknown url type: "+s)}};var jl=class{constructor(l,h=0){this.tileMatrix=l,this.extraZoomLevels=h}getStyle(l,h){return l==="topographic"?Ri.toTileUrl("style",this.tileMatrix,l,h):{version:8,sources:{basemaps:{type:"raster",tiles:[Ri.toTileUrl("raster",this.tileMatrix,l)],tileSize:256}},layers:[{id:"LINZ Raster Basemaps",type:"raster",source:"basemaps"}]}}},x1=new jl(ts,2),v1=new jl(An),rg=new jl(ii),b1=[x1,v1,rg];function Po(s){for(let l of b1)if(s===l.tileMatrix.identifier)return l;return rg}function ig(s){return s.identifier===ii.identifier}function kn(s,l,h){if(l.identifier===h.identifier)return s;if(!ig(l)&&!ig(h))throw new Error("Either tileMatrix or targetTileMatrix must be GoogleTms");let y=Us.get(l).fromWgs84([s.lon,s.lat]),_=l.sourceToPixels(y[0],y[1],Math.round(s.zoom)),a={x:_.x/l.tileSize,y:_.y/l.tileSize,z:Math.round(s.zoom)},T=h.tileToSource(a),M=Us.get(h).toWgs84([T.x,T.y]);return{lon:Math.round(M[0]*1e8)/1e8,lat:Math.round(M[1]*1e8)/1e8,zoom:s.zoom}}function ng(s,l){for(let h of s.features){if(h.geometry.type!=="Polygon")throw new Error("Only polygons supported");for(let y of h.geometry.coordinates)for(let _ of y){let a=kn({lat:_[1],lon:_[0],zoom:l.maxZoom},l,ii);_[0]=a.lon,_[1]=a.lat}}}var sg={[ii.identifier]:{lat:-41.88999621,lon:174.04924373,zoom:5},[ts.identifier]:{lat:-41.277848,lon:174.6763921,zoom:3},[An.identifier]:{lat:-41.88999621,lon:174.04924373,zoom:3}},tn=class extends ag.Emitter{constructor(){super(...arguments);this.style=null;this.layerId="aerial";this.tileMatrix=ii;this.debug={...mo}}get layers(){return this._layers==null&&(this._layers=w1()),this._layers}get isDebug(){return this.debug.debug}get location(){return this._location==null&&(window.addEventListener("popstate",()=>{let h={...sg[this.tileMatrix.identifier],...Ri.fromHash(window.location.hash)};this.setLocation(h)}),this.updateFromUrl(),this._location={...sg[this.tileMatrix.identifier],...Ri.fromHash(window.location.hash)}),this._location}get transformedLocation(){return this.transformLocation(this.location.lat,this.location.lon,this.location.zoom)}get isVector(){return this.layerId==="topographic"}get layerKey(){return this.style==null?this.layerId:`${this.layerId}::${this.style}`}get layerKeyTms(){return`${this.layerKey}::${this.tileMatrix.identifier}`}updateFromUrl(h=window.location.search){let y=new URLSearchParams(h),_=y.get("s")??y.get("style"),a=y.get("i")??"aerial",T=(y.get("p")??ii.identifier).toLowerCase(),M=ma.All.find(L=>L.identifier.toLowerCase()===T);M==null&&(M=ma.get(Ve.parse(T)??Ve.Google)),M.identifier===ts.identifier&&(M=An),Rl.fromUrl(this.debug,y)&&this.emit("change");let N=tn.toUrl(this);this.style=_??null,this.layerId=a.startsWith("im_")?a.slice(3):a,this.tileMatrix=M,this.layerId==="topographic"&&this.style==null&&(this.style="topographic"),this.emit("tileMatrix",this.tileMatrix),this.emit("layer",this.layerId,this.style),N!==tn.toUrl(this)&&this.emit("change")}static toUrl(h){let y=new URLSearchParams;return h.style&&y.append("s",h.style),h.layerId!=="aerial"&&y.append("i",h.layerId),h.tileMatrix.identifier!==ii.identifier&&y.append("p",h.tileMatrix.identifier),Rl.toUrl(h.debug,y),y.toString()}toTileUrl(h,y=this.tileMatrix,_=this.layerId,a=this.style){return Ri.toTileUrl(h,y,_,a)}getLocation(h){let y=h.getCenter();if(y==null)throw new Error("Invalid Map location");let _=Math.floor((h.getZoom()??0)*1e4)/1e4;return Pt.map.transformLocation(y.lat,y.lng,_)}transformLocation(h,y,_){return kn({lat:h,lon:y,zoom:_},ii,this.tileMatrix)}setLocation(h){h.lat===this.location.lat&&h.lon===this.location.lon&&h.zoom===this.location.zoom||(this.location.lat=h.lat,this.location.lon=h.lon,this.location.zoom=h.zoom,this.emit("location",this.location),this.emit("change"))}setTileMatrix(h){this.tileMatrix.identifier!==h.identifier&&(this.emit("tileMatrix",this.tileMatrix),this.emit("change"))}setLayerId(h,y){this.layerId===h&&this.style===y||(this.layerId=h,this.style=y??null,this.emit("layer",this.layerId,this.style),this.emit("change"))}setDebug(h,y=mo[h]){this.debug[h]!==y&&(this.debug[h]=y,this.emit("change"))}};async function w1(){let s=new Map,l=await fetch(Ri.toBaseWmts());if(!l.ok)return s;let _=new DOMParser().parseFromString(await l.text(),"text/xml").getElementsByTagName("Layer"),a=[];for(let T=0;T<_.length;T++){let M=_.item(T);if(M==null)continue;let D=M.getElementsByTagName("ows:Title").item(0)?.textContent,N=M.getElementsByTagName("ows:Identifier").item(0)?.textContent;if(D==null||N==null||D==="aerial")continue;let L=M.getElementsByTagName("ows:Keyword").item(0)?.textContent,tt=M.getElementsByTagName("ows:WGS84BoundingBox").item(0),pt=tt?.getElementsByTagName("ows:UpperCorner").item(0)?.textContent?.split(" ").map(Number),ft=tt?.getElementsByTagName("ows:LowerCorner").item(0)?.textContent?.split(" ").map(Number),yt=M.getElementsByTagName("TileMatrixSet"),Ft=new Set;for(let kt=0;kt<yt.length;kt++){let Ot=S1(yt.item(kt)?.textContent??"");Ot!=null&&Ft.add(Ot.code)}pt==null||ft==null||pt.length!==2||a.push({id:N,name:D.replace("aerial ",""),upperLeft:pt,lowerRight:ft,projections:Ft,category:L})}a.sort((T,M)=>T.name.localeCompare(M.name)),M1(s);for(let T of a)s.set(T.id,T);return s}function M1(s){s.set("aerial",{id:"aerial",name:"Aerial Imagery",projections:new Set([We.Nztm2000,We.Google]),category:"Basemaps"}),s.set("topographic::topographic",{id:"topographic::topographic",name:"Topographic",projections:new Set([We.Google]),category:"Basemaps"})}function S1(s){if(s.toLowerCase().startsWith("epsg"))return Ve.parse(s);let l=ma.find(s);return l==null?null:l.projection}var T1=sf(),Pt={get BaseUrl(){return""},get ApiKey(){return T1},get GoogleAnalytics(){return"UA-23232486-3"},get Version(){return"v6.31.0"},map:new tn};if(Pt.GoogleAnalytics!==""&&typeof window<"u"){window.dataLayer=window.dataLayer||[],window.gtag=function(){window.dataLayer.push(arguments)},window.gtag("js",new Date),window.gtag("config",`${Pt.GoogleAnalytics}`);let s=document.createElement("script");s.setAttribute("async",""),s.setAttribute("src",`https://www.googletagmanager.com/gtag/js?id=${Pt.GoogleAnalytics}`),document.head.appendChild(s)}function Ma(s,l,h){Pt.GoogleAnalytics!==""&&window.gtag("event",l,{event_category:s,value:h})}Z();Jr();var $l=class extends Ti{render(l){return K("i",{class:"material-icons-round md-36"},l.name)}},Ln=class extends Ti{render(l){return K("a",{rel:"noopener",target:"_blank",href:l.href,style:"display:flex;","aria-label":l.ariaLabel},l.children,l.icon?K($l,{name:l.icon}):void 0)}};var vc=class extends Ti{constructor(){super(...arguments);this._events=[]}componentWillMount(){this._events.push(Pt.map.on("change",()=>this.setState(this.state)))}componentWillUnmount(){for(let h of this._events)h();this._events=[]}render(){if(!Pt.map.isDebug)return K("footer",{class:"lui-footer lui-footer-small lui-hide-sm lui-hide-xs",role:"contentinfo"},K("div",{class:"lui-footer-columns"},K("div",{style:"display:flex; align-items:center"},K(Ln,{href:"http://www.govt.nz/",ariaLabel:"New Zealand Government"},K("img",{src:"/assets/logo-nz-govt.svg"}))),K("div",{class:"justify-end"},K("ul",{class:"lui-footer-list"},K("li",{class:"lui-footer-inline-list-item"},"\xA9 2021 Land Information New Zealand"),K("li",{class:"lui-footer-inline-list-item"},K(Ln,{href:"https://www.linz.govt.nz/contact-us"},"Contact")),K("li",{class:"lui-footer-inline-list-item"},K(Ln,{href:"https://www.linz.govt.nz/privacy"},"Privacy")),K("li",{class:"lui-footer-inline-list-item"},K(Ln,{href:"https://www.linz.govt.nz/data/linz-data/linz-basemaps/data-attribution"},"Data Attribution"))))))}};Z();Z();function og(s){var l,h,y="";if(typeof s=="string"||typeof s=="number")y+=s;else if(typeof s=="object")if(Array.isArray(s))for(l=0;l<s.length;l++)s[l]&&(h=og(s[l]))&&(y&&(y+=" "),y+=h);else for(l in s)s[l]&&(y&&(y+=" "),y+=l);return y}function bc(){for(var s=0,l,h,y="";s<arguments.length;)(l=arguments[s++])&&(h=og(l))&&(y&&(y+=" "),y+=h);return y}Jr();Z();Jr();Jr();Z();Jr();var cs=class extends Ti{constructor(){super(...arguments);this._copyTimeout=null;this.copy=()=>{Ma("Ui","copy:"+Pt.map.layerKey+":"+this.props.header.replace(/ /g,"").toLowerCase()),navigator.clipboard.writeText(this.props.value),this.setState({copied:!0}),this._copyTimeout!=null&&clearTimeout(this._copyTimeout),this._copyTimeout=setTimeout(()=>this.setState({copied:!1}),1e3)}}render(){return K("div",{class:"LuiDeprecatedForms"},K("label",null,this.props.header),K("div",{class:bc({"lui-menu-label":!0,"menu-copyable":!0,"menu-copyable-copied":this.state.copied})},K("button",{class:"menu-copyable-icon-button",title:"Copy",onClick:this.copy},K("i",{class:"material-icons-round"},this.state.copied?"check":"content_copy")),K("input",{value:this.props.value,readonly:!0})))}};Z();Jr();var wc=class extends Ti{constructor(){super(...arguments);this._events=[];this.onChange=h=>{let y=h.target,[_,a]=y.value.split("::");Pt.map.setLayerId(_,a),Ma("Ui","layer:"+y.value),Pt.map.layers.then(T=>{let M=T.get(_);M!=null&&Pt.map.emit("bounds",[M.upperLeft,M.lowerRight])}),window.history.pushState(null,"",`?${tn.toUrl(Pt.map)}`)}}componentWillMount(){this.setState({...this.state,currentLayer:Pt.map.layerKey}),Pt.map.layers.then(h=>this.setState({...this.state,layers:h})),this._events.push(Pt.map.on("layer",()=>this.setState({...this.state,currentLayer:Pt.map.layerKey})),Pt.map.on("tileMatrix",()=>this.setState(this.state)))}componentWillUnmount(){for(let h of this._events)h();this._events=[]}render(){return K("div",{class:"LuiDeprecatedForms"},K("h6",null,"Layers"),K("select",{onChange:this.onChange,value:this.state.currentLayer},this.renderAerialLayers()))}renderAerialLayers(){if(this.state.layers==null||this.state.layers.size===0)return;let h=new Map;for(let _ of this.state.layers.values()){if(!_.projections.has(Pt.map.tileMatrix.projection.code))continue;let a=h.get(_.category??"Unknown")??[];a.push(K("option",{value:_.id},_.name.replace(` ${_.category}`,""))),h.set(_.category??"Unknown",a)}if(h.size===0)return;let y=[];for(let[_,a]of h.entries())a.length!==0&&y.push(K("optgroup",{label:_},...a));return K(_t,null,y)}};var Mc=class extends Ti{constructor(){super(...arguments);this._events=[];this.menuToggle=()=>{let h=!this.state.isMenuOpen;Ma("Ui",h?"menu:open":"menu:close"),this.setState({...this.state,isMenuOpen:h})};this.contactUs=()=>{let h="Request Basemaps Developer Access",y=`
|
|
550
|
+
AUTHORITY["EPSG","2193"]]`;Co.defs(Ve.Nztm2000.toEpsgString(),eg);Co.defs(Ve.Citm2000.toEpsgString(),tg);var lp=new Map;function _1(s){return s==null?null:typeof s=="number"?s:"code"in s?s.code:"projection"in s?s.projection.code:null}var Us=class{constructor(l){this.epsg=l;try{this.projection=Co(l.toEpsgString(),Ve.Wgs84.toEpsgString())}catch(h){throw new Ao(`Failed to create projection: ${l.toEpsgString()}, ${Ve.Wgs84.toEpsgString()}`,500,h)}}static define(l,h){if(lp.get(l.code)!=null)throw new Error("Duplicate projection definition: "+l.toEpsgString());Co.defs(l.toEpsgString(),h)}static get(l){let h=this.tryGet(l);if(h==null)throw new Error(`Invalid projection: ${l}`);return h}static tryGet(l){let h=_1(l);if(h==null)return null;let y=lp.get(h);if(y!=null)return y;let _=Ve.tryGet(h);return _==null||Co.defs(_.toEpsgString())==null?null:(y=new Us(_),lp.set(h,y),y)}projectMultipolygon(l,h){if(h.epsg.code===this.epsg.code)return l;let{toWgs84:y}=this,{fromWgs84:_}=h;return l.map(a=>a.map(T=>T.map(M=>_(y(M)))))}get toWgs84(){return this.projection.forward}get fromWgs84(){return this.projection.inverse}boundsToWgs84BoundingBox(l){let h=this.toWgs84([l.x,l.y]),y=this.toWgs84([l.x+l.width,l.y+l.height]);return[h[0],h[1],y[0],y[1]]}boundsToGeoJsonFeature(l,h={}){let y=[l.x,l.y],_=[l.x+l.width,l.y],a=[l.x,l.y+l.height],T=[l.x+l.width,l.y+l.height],M=xf([[[y,a,T,_,y]]],this.toWgs84),D=M.length===1?vf(M[0],h):bf(M,h);return D.bbox=this.boundsToWgs84BoundingBox(l),D}toGeoJson(l){return{type:"FeatureCollection",features:l.map(h=>this.boundsToGeoJsonFeature(h,{name:h.name}))}}static getTiffResZoom(l,h,y=1){let _=0;for(;_<l.zooms.length;++_)if(l.pixelScale(_)<=h*y)return _;if(_===l.zooms.length)return _-1;throw new Error("ResZoom not found")}static tileToWgs84Bbox(l,h){let y=l.tileToSource(h),_=l.tileToSource({x:h.x+1,y:h.y+1,z:h.z}),a=this.get(l),[T,M]=a.toWgs84([y.x,_.y]),[D,N]=a.toWgs84([_.x,y.y]);return[T,M,D,N]}static tileCenterToLatLon(l,h){let y=l.tileToSource({x:h.x+.5,y:h.y+.5,z:h.z}),[_,a]=this.get(l).toWgs84([y.x,y.y]);return Us.wrapLatLon(a,_)}static wrapLatLon(l,h){let y={lat:l,lon:h},_=Math.floor(Math.abs(l)/90)%4,a=l>0?90:-90,T=l%90;switch(_){case 0:y.lat=T;break;case 1:y.lat=a-T,y.lon+=180;break;case 2:y.lat=-T,y.lon+=180;break;case 3:y.lat=-a+T;break}return(y.lon>180||y.lon<-180)&&(y.lon-=Math.floor((y.lon+180)/360)*360),y}static findAlignmentLevels(l,h,y){return Math.max(0,this.getTiffResZoom(l,y,2)-h.z)}static getImagePixelWidth(l,h,y){let _=l.tileToSource(h),a=l.tileToSource({x:h.x+1,y:h.y+1,z:h.z});return Math.round((a.x-_.x)/l.pixelScale(y))*2}};Z();var Ri={ImageFormat:"png",toHash(s){return`#@${s.lat.toFixed(7)},${s.lon.toFixed(7)},z${s.zoom}`},parseZoom(s){return s==null||s===""?NaN:s.startsWith("z")?parseFloat(s.slice(1)):s.endsWith("z")?parseFloat(s):NaN},fromHash(s){let l={},h=s.replace("#@",""),[y,_,a]=h.split(","),T=parseFloat(y),M=parseFloat(_);!isNaN(T)&&!isNaN(M)&&(l.lat=T,l.lon=M);let D=Ri.parseZoom(a);return isNaN(D)||(l.zoom=D),l},baseUrl(){let s=Pt.BaseUrl;if(s==="")return window.location.origin;if(!s.startsWith("http"))throw new Error("BaseURL must start with http(s)://");return s},toBaseWmts(){let s=Pt.ApiKey==null||Pt.ApiKey===""?"":`?api=${Pt.ApiKey}`;return`${this.baseUrl()}/v1/tiles/aerial/WMTSCapabilities.xml${s}`},toImageryUrl(s,l){return`${this.baseUrl()}/v1/imagery/${s}/${l}`},toTileUrl(s,l,h,y){let _=Pt.ApiKey==null||Pt.ApiKey===""?"":`?api=${Pt.ApiKey}`,a=`${this.baseUrl()}/v1/tiles/${h}/${l.identifier}`;if(s==="raster")return`${a}/{z}/{x}/{y}.${Ri.ImageFormat}${_}`;if(s==="vector-xyz")return`${a}/{z}/{x}/{y}.pbf${_}`;if(s==="style")return`${a}/style/${y}.json${_}`;if(s==="wmts")return`${a}/WMTSCapabilities.xml${_}`;if(s==="attribution")return`${a}/attribution.json${_}`;if(s==="tile-wmts")return`${a}/{TileMatrix}/{TileCol}/{TileRow}.${Ri.ImageFormat}${_}`;throw new Error("Unknown url type: "+s)}};var jl=class{constructor(l,h=0){this.tileMatrix=l,this.extraZoomLevels=h}getStyle(l,h){return l==="topographic"?Ri.toTileUrl("style",this.tileMatrix,l,h):{version:8,sources:{basemaps:{type:"raster",tiles:[Ri.toTileUrl("raster",this.tileMatrix,l)],tileSize:256}},layers:[{id:"LINZ Raster Basemaps",type:"raster",source:"basemaps"}]}}},x1=new jl(ts,2),v1=new jl(An),rg=new jl(ii),b1=[x1,v1,rg];function Po(s){for(let l of b1)if(s===l.tileMatrix.identifier)return l;return rg}function ig(s){return s.identifier===ii.identifier}function kn(s,l,h){if(l.identifier===h.identifier)return s;if(!ig(l)&&!ig(h))throw new Error("Either tileMatrix or targetTileMatrix must be GoogleTms");let y=Us.get(l).fromWgs84([s.lon,s.lat]),_=l.sourceToPixels(y[0],y[1],Math.round(s.zoom)),a={x:_.x/l.tileSize,y:_.y/l.tileSize,z:Math.round(s.zoom)},T=h.tileToSource(a),M=Us.get(h).toWgs84([T.x,T.y]);return{lon:Math.round(M[0]*1e8)/1e8,lat:Math.round(M[1]*1e8)/1e8,zoom:s.zoom}}function ng(s,l){for(let h of s.features){if(h.geometry.type!=="Polygon")throw new Error("Only polygons supported");for(let y of h.geometry.coordinates)for(let _ of y){let a=kn({lat:_[1],lon:_[0],zoom:l.maxZoom},l,ii);_[0]=a.lon,_[1]=a.lat}}}var sg={[ii.identifier]:{lat:-41.88999621,lon:174.04924373,zoom:5},[ts.identifier]:{lat:-41.277848,lon:174.6763921,zoom:3},[An.identifier]:{lat:-41.88999621,lon:174.04924373,zoom:3}},tn=class extends ag.Emitter{constructor(){super(...arguments);this.style=null;this.layerId="aerial";this.tileMatrix=ii;this.debug={...mo}}get layers(){return this._layers==null&&(this._layers=w1()),this._layers}get isDebug(){return this.debug.debug}get location(){return this._location==null&&(window.addEventListener("popstate",()=>{let h={...sg[this.tileMatrix.identifier],...Ri.fromHash(window.location.hash)};this.setLocation(h)}),this.updateFromUrl(),this._location={...sg[this.tileMatrix.identifier],...Ri.fromHash(window.location.hash)}),this._location}get transformedLocation(){return this.transformLocation(this.location.lat,this.location.lon,this.location.zoom)}get isVector(){return this.layerId==="topographic"}get layerKey(){return this.style==null?this.layerId:`${this.layerId}::${this.style}`}get layerKeyTms(){return`${this.layerKey}::${this.tileMatrix.identifier}`}updateFromUrl(h=window.location.search){let y=new URLSearchParams(h),_=y.get("s")??y.get("style"),a=y.get("i")??"aerial",T=(y.get("p")??ii.identifier).toLowerCase(),M=ma.All.find(L=>L.identifier.toLowerCase()===T);M==null&&(M=ma.get(Ve.parse(T)??Ve.Google)),M.identifier===ts.identifier&&(M=An),Rl.fromUrl(this.debug,y)&&this.emit("change");let N=tn.toUrl(this);this.style=_??null,this.layerId=a.startsWith("im_")?a.slice(3):a,this.tileMatrix=M,this.layerId==="topographic"&&this.style==null&&(this.style="topographic"),this.emit("tileMatrix",this.tileMatrix),this.emit("layer",this.layerId,this.style),N!==tn.toUrl(this)&&this.emit("change")}static toUrl(h){let y=new URLSearchParams;return h.style&&y.append("s",h.style),h.layerId!=="aerial"&&y.append("i",h.layerId),h.tileMatrix.identifier!==ii.identifier&&y.append("p",h.tileMatrix.identifier),Rl.toUrl(h.debug,y),y.toString()}toTileUrl(h,y=this.tileMatrix,_=this.layerId,a=this.style){return Ri.toTileUrl(h,y,_,a)}getLocation(h){let y=h.getCenter();if(y==null)throw new Error("Invalid Map location");let _=Math.floor((h.getZoom()??0)*1e4)/1e4;return Pt.map.transformLocation(y.lat,y.lng,_)}transformLocation(h,y,_){return kn({lat:h,lon:y,zoom:_},ii,this.tileMatrix)}setLocation(h){h.lat===this.location.lat&&h.lon===this.location.lon&&h.zoom===this.location.zoom||(this.location.lat=h.lat,this.location.lon=h.lon,this.location.zoom=h.zoom,this.emit("location",this.location),this.emit("change"))}setTileMatrix(h){this.tileMatrix.identifier!==h.identifier&&(this.emit("tileMatrix",this.tileMatrix),this.emit("change"))}setLayerId(h,y){this.layerId===h&&this.style===y||(this.layerId=h,this.style=y??null,this.emit("layer",this.layerId,this.style),this.emit("change"))}setDebug(h,y=mo[h]){this.debug[h]!==y&&(this.debug[h]=y,this.emit("change"))}};async function w1(){let s=new Map,l=await fetch(Ri.toBaseWmts());if(!l.ok)return s;let _=new DOMParser().parseFromString(await l.text(),"text/xml").getElementsByTagName("Layer"),a=[];for(let T=0;T<_.length;T++){let M=_.item(T);if(M==null)continue;let D=M.getElementsByTagName("ows:Title").item(0)?.textContent,N=M.getElementsByTagName("ows:Identifier").item(0)?.textContent;if(D==null||N==null||D==="aerial")continue;let L=M.getElementsByTagName("ows:Keyword").item(0)?.textContent,tt=M.getElementsByTagName("ows:WGS84BoundingBox").item(0),pt=tt?.getElementsByTagName("ows:UpperCorner").item(0)?.textContent?.split(" ").map(Number),ft=tt?.getElementsByTagName("ows:LowerCorner").item(0)?.textContent?.split(" ").map(Number),yt=M.getElementsByTagName("TileMatrixSet"),Ft=new Set;for(let kt=0;kt<yt.length;kt++){let Ot=S1(yt.item(kt)?.textContent??"");Ot!=null&&Ft.add(Ot.code)}pt==null||ft==null||pt.length!==2||a.push({id:N,name:D.replace("aerial ",""),upperLeft:pt,lowerRight:ft,projections:Ft,category:L})}a.sort((T,M)=>T.name.localeCompare(M.name)),M1(s);for(let T of a)s.set(T.id,T);return s}function M1(s){s.set("aerial",{id:"aerial",name:"Aerial Imagery",projections:new Set([We.Nztm2000,We.Google]),category:"Basemaps"}),s.set("topographic::topographic",{id:"topographic::topographic",name:"Topographic",projections:new Set([We.Google]),category:"Basemaps"})}function S1(s){if(s.toLowerCase().startsWith("epsg"))return Ve.parse(s);let l=ma.find(s);return l==null?null:l.projection}var T1=sf(),Pt={get BaseUrl(){return""},get ApiKey(){return T1},get GoogleAnalytics(){return"UA-23232486-3"},get Version(){return"v6.32.2"},map:new tn};if(Pt.GoogleAnalytics!==""&&typeof window<"u"){window.dataLayer=window.dataLayer||[],window.gtag=function(){window.dataLayer.push(arguments)},window.gtag("js",new Date),window.gtag("config",`${Pt.GoogleAnalytics}`);let s=document.createElement("script");s.setAttribute("async",""),s.setAttribute("src",`https://www.googletagmanager.com/gtag/js?id=${Pt.GoogleAnalytics}`),document.head.appendChild(s)}function Ma(s,l,h){Pt.GoogleAnalytics!==""&&window.gtag("event",l,{event_category:s,value:h})}Z();Jr();var $l=class extends Ti{render(l){return K("i",{class:"material-icons-round md-36"},l.name)}},Ln=class extends Ti{render(l){return K("a",{rel:"noopener",target:"_blank",href:l.href,style:"display:flex;","aria-label":l.ariaLabel},l.children,l.icon?K($l,{name:l.icon}):void 0)}};var vc=class extends Ti{constructor(){super(...arguments);this._events=[]}componentWillMount(){this._events.push(Pt.map.on("change",()=>this.setState(this.state)))}componentWillUnmount(){for(let h of this._events)h();this._events=[]}render(){if(!Pt.map.isDebug)return K("footer",{class:"lui-footer lui-footer-small lui-hide-sm lui-hide-xs",role:"contentinfo"},K("div",{class:"lui-footer-columns"},K("div",{style:"display:flex; align-items:center"},K(Ln,{href:"http://www.govt.nz/",ariaLabel:"New Zealand Government"},K("img",{src:"/assets/logo-nz-govt.svg"}))),K("div",{class:"justify-end"},K("ul",{class:"lui-footer-list"},K("li",{class:"lui-footer-inline-list-item"},"\xA9 2021 Land Information New Zealand"),K("li",{class:"lui-footer-inline-list-item"},K(Ln,{href:"https://www.linz.govt.nz/contact-us"},"Contact")),K("li",{class:"lui-footer-inline-list-item"},K(Ln,{href:"https://www.linz.govt.nz/privacy"},"Privacy")),K("li",{class:"lui-footer-inline-list-item"},K(Ln,{href:"https://www.linz.govt.nz/data/linz-data/linz-basemaps/data-attribution"},"Data Attribution"))))))}};Z();Z();function og(s){var l,h,y="";if(typeof s=="string"||typeof s=="number")y+=s;else if(typeof s=="object")if(Array.isArray(s))for(l=0;l<s.length;l++)s[l]&&(h=og(s[l]))&&(y&&(y+=" "),y+=h);else for(l in s)s[l]&&(y&&(y+=" "),y+=l);return y}function bc(){for(var s=0,l,h,y="";s<arguments.length;)(l=arguments[s++])&&(h=og(l))&&(y&&(y+=" "),y+=h);return y}Jr();Z();Jr();Jr();Z();Jr();var cs=class extends Ti{constructor(){super(...arguments);this._copyTimeout=null;this.copy=()=>{Ma("Ui","copy:"+Pt.map.layerKey+":"+this.props.header.replace(/ /g,"").toLowerCase()),navigator.clipboard.writeText(this.props.value),this.setState({copied:!0}),this._copyTimeout!=null&&clearTimeout(this._copyTimeout),this._copyTimeout=setTimeout(()=>this.setState({copied:!1}),1e3)}}render(){return K("div",{class:"LuiDeprecatedForms"},K("label",null,this.props.header),K("div",{class:bc({"lui-menu-label":!0,"menu-copyable":!0,"menu-copyable-copied":this.state.copied})},K("button",{class:"menu-copyable-icon-button",title:"Copy",onClick:this.copy},K("i",{class:"material-icons-round"},this.state.copied?"check":"content_copy")),K("input",{value:this.props.value,readonly:!0})))}};Z();Jr();var wc=class extends Ti{constructor(){super(...arguments);this._events=[];this.onChange=h=>{let y=h.target,[_,a]=y.value.split("::");Pt.map.setLayerId(_,a),Ma("Ui","layer:"+y.value),Pt.map.layers.then(T=>{let M=T.get(_);M!=null&&Pt.map.emit("bounds",[M.upperLeft,M.lowerRight])}),window.history.pushState(null,"",`?${tn.toUrl(Pt.map)}`)}}componentWillMount(){this.setState({...this.state,currentLayer:Pt.map.layerKey}),Pt.map.layers.then(h=>this.setState({...this.state,layers:h})),this._events.push(Pt.map.on("layer",()=>this.setState({...this.state,currentLayer:Pt.map.layerKey})),Pt.map.on("tileMatrix",()=>this.setState(this.state)))}componentWillUnmount(){for(let h of this._events)h();this._events=[]}render(){return K("div",{class:"LuiDeprecatedForms"},K("h6",null,"Layers"),K("select",{onChange:this.onChange,value:this.state.currentLayer},this.renderAerialLayers()))}renderAerialLayers(){if(this.state.layers==null||this.state.layers.size===0)return;let h=new Map;for(let _ of this.state.layers.values()){if(!_.projections.has(Pt.map.tileMatrix.projection.code))continue;let a=h.get(_.category??"Unknown")??[];a.push(K("option",{value:_.id},_.name.replace(` ${_.category}`,""))),h.set(_.category??"Unknown",a)}if(h.size===0)return;let y=[];for(let[_,a]of h.entries())a.length!==0&&y.push(K("optgroup",{label:_},...a));return K(_t,null,y)}};var Mc=class extends Ti{constructor(){super(...arguments);this._events=[];this.menuToggle=()=>{let h=!this.state.isMenuOpen;Ma("Ui",h?"menu:open":"menu:close"),this.setState({...this.state,isMenuOpen:h})};this.contactUs=()=>{let h="Request Basemaps Developer Access",y=`
|
|
551
551
|
Give us a few key details to sign up for Developer Access to LINZ Basemaps. We will respond with your Apps' unique API key.
|
|
552
552
|
|
|
553
553
|
Your Name:
|
package/dist/lib/{attribution-6.31.0-431936fcac8e2647.js → attribution-6.32.2-431936fcac8e2647.js}
RENAMED
|
File without changes
|
package/dist/lib/{attribution-6.31.0-a5dcb359f35150b9.js → attribution-6.32.2-a5dcb359f35150b9.js}
RENAMED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@basemaps/landing",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.32.2",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/linz/basemaps.git",
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
"last 2 Chrome versions"
|
|
29
29
|
],
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@basemaps/attribution": "^6.
|
|
32
|
-
"@basemaps/geo": "^6.
|
|
33
|
-
"@basemaps/infra": "^6.
|
|
34
|
-
"@basemaps/shared": "^6.
|
|
31
|
+
"@basemaps/attribution": "^6.32.1",
|
|
32
|
+
"@basemaps/geo": "^6.32.1",
|
|
33
|
+
"@basemaps/infra": "^6.32.2",
|
|
34
|
+
"@basemaps/shared": "^6.32.1",
|
|
35
35
|
"@linzjs/lui": "^10.11.3",
|
|
36
36
|
"@servie/events": "^3.0.0",
|
|
37
37
|
"@types/geojson": "^7946.0.7",
|
|
@@ -101,5 +101,5 @@
|
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
],
|
|
104
|
-
"gitHead": "
|
|
104
|
+
"gitHead": "4d7c28b24243966157b93de0d07cbcb1f3dbd671"
|
|
105
105
|
}
|