none
how to place image with height and width on particular Longitude and latitude on bing map without Move image on Map? RRS feed

Answers

  • you can add a map pin with a custom data template which includes your image, here is a sample code, this is not exactly what u need because it shows multiple pins but it's something to start with:

    <map:Map  Grid.Column="1"  Name="myMap" ZoomLevel="10" Margin="0,30,0,0">
                <map:Map.Center>
                    <map:Location Latitude="{Binding Lat,Mode=TwoWay}" Longitude="{Binding Log,Mode=TwoWay}"/>
                </map:Map.Center>
                <map:MapItemsControl  ItemsSource="{Binding StoreLocations}" x:Name="items">
                    <map:MapItemsControl.ItemTemplate>
                        <DataTemplate>
                            <StackPanel Tapped="StackPanel_Tapped">
                                <map:MapLayer.Position>
                                    <map:Location Latitude="{Binding Lat}" Longitude="{Binding Long}" />
                                </map:MapLayer.Position>                     
                                <Grid >
                                    <Image Height="50" Width="50" Source="You Image"/>            
                                </Grid>
                            </StackPanel>
                        </DataTemplate>
                    </map:MapItemsControl.ItemTemplate>
                </map:MapItemsControl>
            </map:Map>


    Tariq

    Friday, March 21, 2014 1:57 PM
  • If you want to use an image as a pushpin simply create an Image object and use the MapLayer.SetPosition method on it and add the image to a map layer. If you want to bind the image to a bounding box so that it scales as the user zooms then take a look at this code sample: http://code.msdn.microsoft.com/Image-Overlays-in-Bing-a0a3471e

    Also, take a look at my free ebook on creating location intelligence Windows Store apps: http://rbrundritt.wordpress.com/my-book/


    http://rbrundritt.wordpress.com

    Friday, March 21, 2014 4:57 PM

All replies

  • Can you provide more details on what you are trying to do. It's not very clear if you want too use an image as a pushpin or bind an image to abounding box so it scales as you zoom the map.

    http://rbrundritt.wordpress.com

    Friday, March 21, 2014 1:55 PM
  • you can add a map pin with a custom data template which includes your image, here is a sample code, this is not exactly what u need because it shows multiple pins but it's something to start with:

    <map:Map  Grid.Column="1"  Name="myMap" ZoomLevel="10" Margin="0,30,0,0">
                <map:Map.Center>
                    <map:Location Latitude="{Binding Lat,Mode=TwoWay}" Longitude="{Binding Log,Mode=TwoWay}"/>
                </map:Map.Center>
                <map:MapItemsControl  ItemsSource="{Binding StoreLocations}" x:Name="items">
                    <map:MapItemsControl.ItemTemplate>
                        <DataTemplate>
                            <StackPanel Tapped="StackPanel_Tapped">
                                <map:MapLayer.Position>
                                    <map:Location Latitude="{Binding Lat}" Longitude="{Binding Long}" />
                                </map:MapLayer.Position>                     
                                <Grid >
                                    <Image Height="50" Width="50" Source="You Image"/>            
                                </Grid>
                            </StackPanel>
                        </DataTemplate>
                    </map:MapItemsControl.ItemTemplate>
                </map:MapItemsControl>
            </map:Map>


    Tariq

    Friday, March 21, 2014 1:57 PM
  • If you want to use an image as a pushpin simply create an Image object and use the MapLayer.SetPosition method on it and add the image to a map layer. If you want to bind the image to a bounding box so that it scales as the user zooms then take a look at this code sample: http://code.msdn.microsoft.com/Image-Overlays-in-Bing-a0a3471e

    Also, take a look at my free ebook on creating location intelligence Windows Store apps: http://rbrundritt.wordpress.com/my-book/


    http://rbrundritt.wordpress.com

    Friday, March 21, 2014 4:57 PM