0
votes

In a Windows Phone map I am drawing my mapmarker and using them as pushpin.

 MapLayer mapLayer = new MapLayer();
        foreach (LocationDetail locationDetail in locationListobj)
        {
            MapOverlay overlay = new MapOverlay();
            overlay.Content = GetImage(locationDetail);
            overlay.GeoCoordinate = new GeoCoordinate(locationDetail.Latitude, locationDetail.Longitude);
            overlay.PositionOrigin = new Point(0.0, 1.0);
            mapLayer.Add(overlay);
        }
        AllyMap.Layers.Add(mapLayer);

A new requirement came up that upon tapping on the map we have to show the description in a infobar. Can anybody please help me how could I do that.

1
Take a look at this post. Hope this helps. Explains how to add a tooltip when tapped on the pushpin.Kasun Kodagoda

1 Answers

0
votes

You need to set the ToolTipService.ToolTip property on the PushpinViewModel which should be a UIElement. ToolTips must be hooked up to a UIElement, which actually renders in your visual tree, to be triggered by mouse hover. Hovering is just a way of showing the tooltip.

<ToolTipService.ToolTip>
<ToolTip Style="{StaticResource ToolTipStyle}">
    <StackPanel Orientation="Vertical">
        <TextBlock Text="{Binding Title}" />
        <TextBlock Text="{Binding Description}" TextWrapping="Wrap" />
    </StackPanel>
</ToolTip>
</ToolTipService.ToolTip>

You could refer this for more:

http://social.technet.microsoft.com/wiki/contents/articles/24118.windows-phone-8-maps-api-making-custom-pushpin-with-custom-tooltip-c-xaml.aspx

Hope it helps!