0

I'm deveolping an UWP-App and making use of the MapControl. I'm also adding elements like MapIcon and MapPolyLine to the MapControl, but I'm having problems with the MapPolyLine:

Sometime when adding such polyline it appears totally distorted/malformed: Malformed PolyLine

When changing the zoomlevel of the MapControl it often goes back to the intended polyline, but it would eventually appear malformed again, when using the previous zoomlevel. Wellformed PolyLine

(In the give screenshots, the MapControl uses an OSM-Layer, but it also happens with the default Bing-Maps-Layer; both screenshots show the exact same MapPolyLine with different perspectives)

Community
  • 1
  • 1
Jerome Dreyer
  • 144
  • 10

2 Answers2

1

Looks like you might be storing Altitude too? I think the Map Control when zooming displays the point in 3D space.

Try this:

// We are not Plotting Alititue to keep map 'flat' [ Also Emulator sets Altitude  = 0 ]

BasicGeoposition _newPlotPos = new BasicGeoposition() { 
    Latitude = position.Latitude, 
    Longitude = position.Longitude, 
    Altitude = 0    
};
steveb
  • 5,382
  • 2
  • 27
  • 36
  • Sorry for my late response. Pretty good idea, I actually stored the altitude - unfortunately the problem persists with an artificial altitude of 0. Any further ideas? – Jerome Dreyer Mar 07 '17 at 09:08
  • Maybe im miss understanding the issue, as from screens shots Im not actually seeing where the 'malformed' lines are? Are they just the ones running off the screen? – Paul Farrand Mar 10 '17 at 08:26
0

Maybe im miss understanding the issue, as from screens shots Im not actually seeing where the 'malformed' lines are? Are they just the ones running off the screen?

If it is lines running off to a distant point, then it might be the same as issue I have had for two reasons. First, if your using the emulator, sometimes the first GPS position when it starts is way off in Seattle somewhere, and that can be the first point you get, so if you are pulling 'local geo' data off a database for example, and the first point is Seattle, then the next point is your local data, you get a line off into Seattle. Second, MapPloyLine works point to point in a list fashion, so each entry into the ploy line is from here -> to here. So if there are 'gaps' in your position data you might see huge lines drawn off to positions that look strange but are correct. I am logging data from GPS to a database, and if the logging stops, I increment a 'RecordingCount' in the data to represent and new 'segment'. I also use a FIFO buffer to plot my Polylines, skipping the first plot point (its the start of a new segment) and then go from this start point to the next...to the next... to the next..

  • Yes, the problem are those lines running of the screen. Both screenshots I provided are showing the exact same polylines with different zoomlevels, but on the upper one, those lines are suddenly running of the screen. The data for those lines are coming from a server-side route-calculation (not GPS). Besides: those screenshots are coming from an actual device (no emulator). – Jerome Dreyer Mar 11 '17 at 10:36