Microsoft Mapcruncher is a tool that allows you to overlay your own custom maps onto Virtual Earth. It works by “Crunching” your map into tiles which you then make available via a web server so that they can be overlaid in VE using map.AddTileLayer. Depending on the complexity of your map, and the number of zoom levels, Mapcruncher can generate quite large amounts of data. Mapcruncher already has a facility to render its data directly to Amazon S3, but now you can copy those tiles to Windows Azure Blob Storage instead.
First crunch your data – There are a number of online tutorials and good instructions with Mapcruncher, so I wont go into detail here. Let’s assume you’ve crunched your data to a local folder, say c:\ve
Now install PowerShell and CloudDrive (CloudDrive is in the samples directory of the Windows Azure SDK – follow the instructions you find there).
Using PowerShell and CloudDrive, change directory into Blob storage:
> cd blob:
Create a new public container:
> new-item -public tiles
Change into that container:
> cd tiles
Copy all the tiles from your local drive to the cloud:
> copy-cd c:\ve\Layer_NewLayer\* .
Now all these tiles should be publicly available.
If you are running against development blob storage, then URLS will look something like this
http://127.0.0.1:10000/devstoreaccount1/tiles/0313131311133.png
For production cloud storage, they’ll look like this
http://myaccount.blob.core.windows.net/tiles/0313131311133.png
Now we need some HTML to try it out – I grabbed the sample from the Virtual Earth Interactive SDK and hacked it around a bit to suit my particular map. The main thing to change is the path to the tiles., something like this:
var tileSourceSpec = new VETileSourceSpecification("lidar", "http://127.0.0.1:10000/devstoreaccount1/tiles/%4.png");
or this
var tileSourceSpec = new VETileSourceSpecification("lidar", "http://myaccount.blob.core.windows.net/tiles/%4.png");
Once you’ve created your HTML, you can upload it as before:
> copy-cd C:\ve\index.html .
Now browse to your storage end point
http://127.0.0.1:10000/devstoreaccount1/tiles/index.html
or
http://myaccount.blob.core.windows.net/tiles/index.html
and away you go!
*The opinions expressed on this site are my own and do not necessarily represent those of Two10degrees or Active Web Solutions Ltd.