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

use Geocode service to show pin address in tooltip

3 Answers 121 Views
Map
This is a migrated thread and some comments may be shown as answers.
Evgenia
Top achievements
Rank 1
Evgenia asked on 27 Apr 2010, 12:02 PM
Hi,

It seemed easy idea to add address returned from Reverse Geocode in my pin's tooltip. But the implementation of this issue is hard to me :( Can you help me please?
Besides my pin is custom - like the one you have in your Item Virtualization Demo (not those one created with PinPoint class) > http://demos.telerik.com/silverlight/#Map/DynamicLayer
And something else i noticed... when I tried your demo with Search service with the following - "Hospitals in Paris"  the result was ... awkward. The service putted pushpins on locations which doesn't have hospitals there for sure but instead missed obvious ones as -> Hopital Necker for example. You know some of the locations are labeled by default like the hospital I mentioned. That's why I know the service missed it.

Thanks for your time :) Looking forward to hearing your answer as soon as possible.

3 Answers, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 29 Apr 2010, 12:40 PM
Hi Evgenia,

I have attached a sample solution that uses reverse geocoding for displaying the tooltip with address. It shows a pin by mouse click.
Concerning the search or geocode service results -- unfortunately we do not have any influence on the results returned by the Bing services. Our control will return what the service provides in response.

Regards,
Andrey Murzov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Greg Sipes
Top achievements
Rank 1
answered on 22 Sep 2010, 09:13 PM
Andrey,
     I know that you do not influence Bing's geocode results at all, but is there any way we can catch or trap when the geocodes are not properly found? In other words, I send an exact address to Bing to be geocoded; if the address cannot be resolved correclty, it seems to be placing the geocoded address on the map in the middle of the zip code. Our users might have a few of these a day, which then plots all the points exactly on top of each other, so we need to trap when the address cannot be exactly resolved, so that we can slightly move it away from the last point.

Thanks in advance,
Greg
0
Andrey
Telerik team
answered on 24 Sep 2010, 04:06 PM
Hello Greg Sipes,

Each Result object of Response that returns with GeocodeCompleted event has EntityType property of type string. It returns "Address" when geocoding has found an exact address. On the other cases it returns type like to "Postcode1" or "RoadBlock".
You can check this property to discover that the address has not been resolved correctly. The sample code is below.
private void geoProvider_GeocodeCompleted(object sender, GeocodeCompletedEventArgs e)
{
    if (e.Response.Results != null
        && e.Response.Results.Count > 0)
    {
        if (e.Response.Results[0].EntityType == "Address")
        {
            // address has been found
        }
        else
        {
            // address cannot be resolved correclty
        }
    }
}

All the best,
Andrey Murzov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Map
Asked by
Evgenia
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Greg Sipes
Top achievements
Rank 1
Share this question
or