Self-hosted Background Maps for Power BI
We are able to offer a self-hosted option for Icon Map background maps, which enables use of our background maps and icon library without the need for external internet access.
Contact sales@icon-map.com to discuss options for your organisation.
Installation
On purchasing the Icon Map background pack, you will be provided with a URL to download a ZIP (or 7zip) file containing the resources to deploy. A web server will then be required to serve the content to Icon Map.
Web Server Requirements
The web server must support the following capabilities:
- HTTP Range Requests
- CORS Origin set to * or null
Web Server options include the following:
- Microsoft Azure Blob Storage (cloud)
- Amazon S3 Buckets (cloud)
- Internet Information Services (IIS) (Windows on-premises option) [guide]
- MinIO (Windows or Linux on-premises option) [guide]
- LocalStack (Docker on-premises option)
Internet Information Services (IIS) Configuration
Extract the IconMapLocal folder into your web server. Around 400 GB of disk space is required for all resources. Eg c:\inetpub\wwwroot
Static Content
The "Static Content" IIS feature will need to be enabled to provide support for HTTP Range headers. This can either be enabled using Server Manager -> Add Roles and Features -> Server Roles -> Web Server (IIS) -> Web Server -> Common HTTP Features -> Static Content.
It can also be enabled using the following PowerShell command:
Install-WindowsFeature -Name Web-Static-Content
web.config
Static file and CORS configuration will also likely be required in web.config. Configure web.config as follows:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<staticContent>
<remove fileExtension=".pmtiles" />
<mimeMap fileExtension=".pmtiles" mimeType="application/octet-stream" />
<remove fileExtension=".pbf" />
<mimeMap fileExtension=".pbf" mimeType="application/x-protobuf" />
<remove fileExtension=".svg" />
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
<remove fileExtension=".json" />
<mimeMap fileExtension=".json" mimeType="application/json" />
</staticContent>
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
</customHeaders>
</httpProtocol>
</system.webServer>
</configuration>
A "null" or "*" origin for CORS is required due to Microsoft's sandboxing of custom visuals.
MinIO Configuration
Extract the IconMapLocal folder to a directory accessible on the machine. For this guide, the source files are assumed to be in:
C:\temp\iconmaplocal
MinIO will store its bucket data in:
C:\minio\iconmaplocal
The bucket will be exposed over HTTP at:
http://localhost:9000/iconmaplocal/
Download MinIO
Download:
Place them in:
C:\minio\
Expected structure:
C:\minio
├─ minio.exe
└─ mc.exe
Create the MinIO Data Directory
mkdir C:\minio\iconmaplocal
Start MinIO
$env:MINIO_ROOT_USER="admin"
$env:MINIO_ROOT_PASSWORD="ChangeThisPassword123!"
C:\minio\minio.exe server `
C:\minio\iconmaplocal `
--address ":9000" `
--console-address ":9001"
Endpoints:
S3 API: http://localhost:9000
Console: http://localhost:9001
Configure MinIO Client
C:\minio\mc.exe alias set `
iconmap `
http://localhost:9000 `
admin `
ChangeThisPassword123!
Verify:
C:\minio\mc.exe alias list
Create Bucket
C:\minio\mc.exe mb iconmap/iconmaplocal
Verify:
C:\minio\mc.exe ls iconmap
Make the Bucket Publicly Readable
C:\minio\mc.exe anonymous set download iconmap/iconmaplocal
Verify:
C:\minio\mc.exe anonymous get iconmap/iconmaplocal
Configure CORS
Create C:\minio\cors.xml:
<CORSConfiguration>
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<AllowedMethod>HEAD</AllowedMethod>
<AllowedHeader>*</AllowedHeader>
<ExposeHeader>Accept-Ranges</ExposeHeader>
<ExposeHeader>Content-Range</ExposeHeader>
<ExposeHeader>Content-Length</ExposeHeader>
<ExposeHeader>Content-Type</ExposeHeader>
<ExposeHeader>ETag</ExposeHeader>
<ExposeHeader>Last-Modified</ExposeHeader>
<MaxAgeSeconds>3600</MaxAgeSeconds>
</CORSRule>
</CORSConfiguration>
Apply:
C:\minio\mc.exe cors set `
iconmap/iconmaplocal `
C:\minio\cors.xml
Verify:
C:\minio\mc.exe cors info iconmap/iconmaplocal
Upload the Content
C:\minio\mc.exe cp --recursive --overwrite `
C:\temp\iconmaplocal\ `
iconmap/iconmaplocal/
Verify:
C:\minio\mc.exe ls --recursive iconmap/iconmaplocal
Verify a Specific File
C:\minio\mc.exe stat iconmap/iconmaplocal/styles/styles.json
URL:
http://localhost:9000/iconmaplocal/styles/styles.json
Test HTTP Range Requests
curl.exe -i `
-H "Range: bytes=0-99" `
http://localhost:9000/iconmaplocal/styles/styles.json
Expected:
HTTP/1.1 206 Partial Content
Accept-Ranges: bytes
Content-Range: bytes 0-99/...
Icon Map Configuration
To use the locally hosted maps, provide Icon Map with the URL where the resources are hosted.
In Icon Map's format pane, under Icon Map Pro > Customization, enter your URL in the "Custom Styles URL" text box. For example:
http://powerbi.internal:9000/iconmaplocal/
You should ensure that you end the URL with a '/' character.
This setting can be set as a default property in your Power BI Report theme file.