This question is related to my previous question. Currently, I just need to show a map with some less points of a heatmap on a map based on OpenStreetMap (OSM) .
I would like to add the heatmap image to a map based on OSM so that the points on the heatmap can be shown on the correct locations by latitude/longitude on the map of OSM.
I am working on C# VS2013 WPF. In my C# code, I used OSM control lib GMAP.NET at:
A few years ago, I used the “Greatmaps” libraries to create my own tool for editing GPS tracks on a map, see http://www.codeproject.com/Articles/104017/Bernie-s-Trackviewer. It uses code from Greatmaps to download tiles (Google Earth, OpenStreetMap, etc), calculate the position of my GPS data on the image etc.
Creating a heatmap should not be so much different: instead of getting the location of the points from a gpx file, you take your heat map data.
// Create a new map layer to add the tile overlay to.
tileLayer = new MapTileLayer();
// The source of the overlay.
TileSource tileSource = new TileSource();
tileSource.UriFormat = "{UriScheme}://ecn.t0.tiles.virtualearth.net/tiles/r{quadkey}.jpeg?g=129&mkt=en-us&shading=hill&stl=H";
// Add the tile overlay to the map layer
tileLayer.TileSource=tileSource;
// Add the map layer to the map
if (!MapTileOverlay.Children.Contains(tileLayer)) // in GMAP.NET WPF, there is no definition for "MapTileOverlay"
{
MapTileOverlay.Children.Add(tileLayer);
}
tileLayer.Opacity = tileOpacity;
}
What about creating some classes yourself? What’s so hard here? Instead of drawing your heat map onto empty tiles, draw them on tiles retrieved from OSM. Or draw your heat map with some transparency (alpha channel) on top of the OSM tiles. Or …