c# - How to bind MapIcon on Bing Map in Windows Phone 8.1 -
i use bing map on windows phone 8.1 app. precisally, in xaml file, wrote
<maps:mapcontrol x:name="map" loaded="map_loaded"> <maps:mapitemscontrol itemssource="{binding locations}"> <maps:mapitemscontrol.itemtemplate> <datatemplate> <image source="images/arte_icon_label.png" height="25" maps:mapcontrol.location="{binding geopoint}" maps:mapcontrol.normalizedanchorpoint=".5,.5"/> </datatemplate> </maps:mapitemscontrol.itemtemplate> </maps:mapitemscontrol> </maps:mapcontrol>
i want add many images, don't know code procedure add theme.
can me please?
do want add multiple mapicon c# code? code snippet following post.
private async task searchnearbyincidents(geopoint location) { ilist<geopoint> geopoints = await bingmaprestservice.getincidents(maputil.getboundingbox(location.position, 5), constantvalues.bingmapkey); foreach (var geopoint in geopoints) { mapicon mapicon = new mapicon { image = randomaccessstreamreference.createfromuri(new uri("ms-appx:///assets/trafficyield.png")), location = geopoint, normalizedanchorpoint = new point(0.5, 0.5), title = "incidents" }; mapcontrol.mapelements.add(mapicon); } }
Comments
Post a Comment