Quantcast
Channel: GMap.NET - Great Maps for Windows Forms & Presentation
Viewing all articles
Browse latest Browse all 3384

New Post: from C# WPF add a heatmap jpeg file as a layer to a map based on OpenStreetMap

$
0
0
I used GHEAT.NET (http://www.codeproject.com/Articles/88956/GHeat-NET) to generate a heatmap as a jpeg file. I need to add it as a layer to the map based on OpenStreetMap. (openstreetmap.com)

And, also the heatmap layer can be zoomed in/out as I zoom in/out the map.

I found the C# code from

https://msdn.microsoft.com/en-us/library/microsoft.maps.mapcontrol.wpf.maptilelayer.aspx

But, it is for microsoft.maps.mapcontrol.wpf not for GMAP.NET at https://greatmaps.codeplex.com/
private void AddTileOverlay()
{

    // 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;
}
Any help would be appreciated.

Viewing all articles
Browse latest Browse all 3384


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>