Load Shapefile:
Load large Shapefiles using a Web Worker
This sample shows how to load large shapefiles (.shp, .dbf, .prj) onto the map using a web worker so that it doesn't freeze the UI. This sample uses the open source
Shapefile.js
library which converts Shapefiles into GeoJSON which can easily be consumed by the map control. It also makes use of the open source
Catiline.js
library which makes working with web workers easier.
Note:
Not all file and mime types are enabled in all servers. If using .NET, it is recommended to add the following to the web.config file:
<system.webServer>
<staticContent>
<mimeMap fileExtension=".shp" mimeType="application/octet-stream" />
<mimeMap fileExtension=".dbf" mimeType="application/octet-stream" />
<mimeMap fileExtension=".prj" mimeType="text/plain" />
</staticContent>
<system.webServer>