0

I have an application that I am writing in UWP that draws a car on a map. Around that car, there are POIs that I would like to draw on the map also. I have a 2D array that populates the POIs from my car, such that the car is located at [500,500] and that POIs in the 2D array are 0-500 metres from the car.

I am trying to render this 2D array as bytes on a writeable bitmap, but have them to scale. What I am trying to figure out, is how to accurately calculate the number of pixels required to be coloured based on the POI’s distance from the car, at any given zoom level. Does UWP provide functionality to draw to scale like this?

I have sketched what I am trying to draw below.

Thanks!

enter image description here

CoCaIceDew
  • 228
  • 1
  • 7
johnd
  • 3
  • 1
  • do you mean scale map icon when zoom in the map control? – CoCaIceDew Aug 30 '21 at 09:26
  • Potentially, I’m not sure to be honest. I want the map icon to be drawn the correct distance from the car. My issue is that I have too many POI’s that I can’t draw them all individually where I could use the built in distance functionality. I tried this and the application was too slow and unusable. Instead I have one large map icon of 1000x1000 pixels that I need to colour in the correct pixels based on the POIs distance from my car. – johnd Aug 30 '21 at 23:33
  • I'm afraid there is not such api to scale the specific area, For tor requirement, the better way is calculate the center of the area, and set the center point to the mapcontroll then update the mapcontrol's zoom value. – CoCaIceDew Aug 31 '21 at 01:32
  • Ok, thank you. I’ll give that a try. – johnd Aug 31 '21 at 03:58
  • Please provide enough code so others can better understand or reproduce the problem. – Community Sep 02 '21 at 20:54

0 Answers0