none
Metro Bing map control: How to set image tile geographical size? RRS feed

  • Question

  • Hi,

    I am porting a WP7 app to Metro. Its an offline map viewer. Most of my stuff is working, however I have at least one problem:
    I am inserting images (map tiles) into a bing map control, my problem is that I dont know 
    how do you set the image size to a geographic size, that stays the same logical size on the map when zooming the map.

    In wp7, there is a layer function that allowes to specify a rectangle in geographic coordinates to position the image on the map:

    imageLayer.AddChild(image, geoRect); // wp7 code

    Under Metro I cant seem to find any function to set the image size in geographical coords under metro.

    For shapes there is a function like the one I am looking for :            

    MapPolygon polygon = new MapPolygon();
    polygon.Locations = new LocationCollection() { new Location(38, -109), new Location(38, -110), new Location(39, -110), new Location(39, -109) };
    MapShapeLayer shapeLayer = new MapShapeLayer();
    shapeLayer.Shapes.Add(polygon);
    TheBingMapControl.ShapeLayers.Add(shapeLayer); 

    This shape behaves like I want an image(map tile) to behave.


    I do know how to set the position of the image in geocoords:
    MapLayer.SetPosition(tileImage, new Location(39, -109));

    ...but this image stays a certain fixed pixel size on the screen when the map is zoomed, its position is anchored on the map.
    thanks, 

    hans

    Monday, August 6, 2012 5:12 PM

Answers

  • There is currently no equivalent functionality in the SDK. You can get the same functionality by sizing the image when ViewChanged is fired.

    • Marked as answer by harwi Tuesday, August 7, 2012 3:15 AM
    Monday, August 6, 2012 11:07 PM

All replies

  • There is currently no equivalent functionality in the SDK. You can get the same functionality by sizing the image when ViewChanged is fired.

    • Marked as answer by harwi Tuesday, August 7, 2012 3:15 AM
    Monday, August 6, 2012 11:07 PM
  • Thanks for the fast answer! works great :)

    Hans

    Tuesday, August 7, 2012 3:15 AM