This is a migrated thread and some comments may be shown as answers.

Generating Heatmap with dynamically generated data

1 Answer 193 Views
Map
This is a migrated thread and some comments may be shown as answers.
Brendon
Top achievements
Rank 1
Brendon asked on 18 Aug 2011, 03:49 PM
Hey all, I am attempting to generate a heatmap from data I am pulling from a database. Basically, I am pulling a list of how many visitors we have had at our properties by customer zipcode. In the class I wrote to handle the data retrieval, I also have a method for Geocoding the zipcodes into Latitude and Longitude. The problem I am having is partly due to a poor understanding of WPF, and partly due to never having used a Telerik control before now. My current XAML is as follows:
<Window x:Class="HeatMap.MainWindow"
                xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                Title="MainWindow" Height="552" Width="497" Loaded="Window_Loaded" WindowStartupLocation="CenterScreen">
    <Grid>
        <telerik:RadMap Height="auto" HorizontalAlignment="Stretch" Name="radMap1" VerticalAlignment="Stretch" Width="auto"  >
            <telerik:RadMap.Provider>
                <telerik:BingMapProvider ApplicationId="API_KEY" Mode="Aerial" />
            </telerik:RadMap.Provider>
            <telerik:BingGeocodeProvider ApplicationId="API_KEY" GeocodeCompleted="BingGeocodeProvider_GeocodeCompleted" x:Name="Bing">
                <telerik:BingGeocodeProvider.MapControl>
                    <telerik:RadMap Visibility="Hidden" CommandBarVisibility="Hidden">
                        <telerik:RadMap.SpatialReference>
                            <telerik:SpatialReference AngularUnitOfMeasurement="0" Authority="{x:Null}" CentralMeridian="0" Datum="{x:Null}" DatumAuthority="{x:Null}" FalseEasting="0" FalseNorthing="0" GeoGcs="{x:Null}" LatitudeOfOrigin="0" MaxLatitude="0" MaxLongitude="0" MinLatitude="0" MinLongitude="0" OffsetX="0" OffsetY="0" Primem="0" PrimemAuthority="{x:Null}" ProjectionAuthority="{x:Null}" ScaleX="0" ScaleY="0" SpheroidAuthority="{x:Null}" SpheroidFlattening="0" SpheroidRadius="0" StandardParallel="0" UnitAuthority="{x:Null}" />
                        </telerik:RadMap.SpatialReference>
                    </telerik:RadMap>
                </telerik:BingGeocodeProvider.MapControl>
            </telerik:BingGeocodeProvider>
            <telerik:InformationLayer Name="dataLayer" >
                 
            </telerik:InformationLayer>
        </telerik:RadMap>
    </Grid>
</Window>

I have seen the code samples from the telerik demos, but most likely due to my lack of experience with WPF they haven't helped me much. What I would like to be able to do would be for every zip code create a point on the map in a color representing the number of visitors, and upon mouse hover (or even mouse click) I would like to show a tooltip showing the number of visitors and the zipcode.

Would anyone know of a good tutorial to help fill in the gaps in my knowledge so I can more easily accomplish my goal, or have any input to send me in the right direction? Thanks for the help all!

1 Answer, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 23 Aug 2011, 04:21 PM
Hello Brendon,

You can't use BingGeocodeProvider from XAML. You should use it from code-behind.
I would recommend you to take a look into the following articles in our online documentation:

http://www.telerik.com/help/wpf/radmap-features-data-binding.html
http://www.telerik.com/help/wpf/radmap-features-geocode.html

as well as the following samples in our demo application:

http://demos.telerik.com/silverlight/#Map/DataBinding
http://demos.telerik.com/silverlight/#Map/Geocoding


Kind regards,
Andrey Murzov
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
Map
Asked by
Brendon
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Share this question
or