c# - How to create auto-scalling image lying on WP8 maps -
i trying add together multiple pushpins map, disappear when zoom out enough, create pushpins little, not rendered anymore.
i managed accomplish effect next code:
mappolygon shape = new mappolygon(); geocoordinatecollection boundinglocations = createcircle(geocoordinate, 0.1); shape.path = boundinglocations; shape.fillcolor = color.fromargb(0x55, 0xff, 0xff, 0x00); shape.strokecolor = color.fromargb(0xff, 0xff, 0x00, 0xff); shape.strokethickness = 4; maptodrawon.mapelements.add(shape);
but want fill polygon custom image. image has placed in specific point of map, , relate size level of zoom. (just in above example) code tried use:
maplayer layer = new maplayer(); mapoverlay overlay = new mapoverlay(); polygon polygon = new polygon(); polygon.points.add(new point(0, 0)); polygon.points.add(new point(0, 75)); polygon.points.add(new point(25, 0)); bitmapimage arrimg = new bitmapimage(new uri("/images/arrow.png", urikind.relativeorabsolute)); imagebrush imgbrush = new imagebrush(); imgbrush.imagesource = arrimg; polygon.fill = imgbrush; overlay.content = polygon; //geocoordinate argument of method overlay.geocoordinate = geocoordinate; layer.add(overlay); maptodrawon.layers.add(layer);
it doesn't work. image appears in specific point of world, when zoom out, image keeps size. believe problem caused lack of rectangle restricting polygon, can't find start with. please help.
that's not supported feature of wp8 maps. thought 1 time item added map.layers doesn't rescale zoom in order create consistent & feel. items resize such map.mapelements polylines , landmarks, won't work image.
if want items scale you'll have sign-up map.zoomlevelchanged , alter scaling of items programmatically.
if you're interested in seeing in future releases please fill in wpdev uservoice suggestion usecase , why you're interested in doing that.
c# image maps windows-phone-8
No comments:
Post a Comment