none
MapPolyline - maximum number of Locations RRS feed

  • Question

  • Hi,

    I am loading a gpx file and trying to plot the points onto a map. Using the MapPolyline i am settings the locations with all the gpx points. The problem i am getting is the rendering of the polyline does not go past 7325 locations ... although the locations are there, the line is not rendered. (i know the points are there as i set an end pushpin which is created ok)

    Is there a maximum value for the MapPolyline LocationCollection ?

    Cheers ... Rob.

    Tuesday, July 8, 2014 4:10 PM

Answers

  • You found the secret number! Kidding, in all seriousness there isn't a maximum but if your polyline is large (takes up a lot of area) it is possible that the world wrap logic moves it to a second map which is out of view. Try zooming out an seeing if it appears. Have a try at loading the GPX file via one of the samples in this project: http://mapstoolbox.codeplex.com/ or send me the GPX and I'll test it one of these samples for you (ricky_brundritt at Hotmail.com).

    http://rbrundritt.wordpress.com

    • Marked as answer by Rob71 Tuesday, July 8, 2014 9:40 PM
    Tuesday, July 8, 2014 4:15 PM
  • It's also worth noting that the larger the shape is the more memory used and the more calculations done when moving the map. This can lead to slow performance. It is recommended to reduce the resolution of the data if possible. In your case you are using points from a GPX file. I suspect that these were generated from a GPS. In which case there is a good chance the points are very close together. At zoom level 19, the closest zoom level in Bing Maps, a single pixel is approximately 30cm wide. At this zoom level you are usually too close to the map to do anything useful. At zoom level 15 a single pixel is approximately 5 meters wide.

    http://rbrundritt.wordpress.com

    Tuesday, July 8, 2014 6:03 PM

All replies

  • You found the secret number! Kidding, in all seriousness there isn't a maximum but if your polyline is large (takes up a lot of area) it is possible that the world wrap logic moves it to a second map which is out of view. Try zooming out an seeing if it appears. Have a try at loading the GPX file via one of the samples in this project: http://mapstoolbox.codeplex.com/ or send me the GPX and I'll test it one of these samples for you (ricky_brundritt at Hotmail.com).

    http://rbrundritt.wordpress.com

    • Marked as answer by Rob71 Tuesday, July 8, 2014 9:40 PM
    Tuesday, July 8, 2014 4:15 PM
  • It's also worth noting that the larger the shape is the more memory used and the more calculations done when moving the map. This can lead to slow performance. It is recommended to reduce the resolution of the data if possible. In your case you are using points from a GPX file. I suspect that these were generated from a GPS. In which case there is a good chance the points are very close together. At zoom level 19, the closest zoom level in Bing Maps, a single pixel is approximately 30cm wide. At this zoom level you are usually too close to the map to do anything useful. At zoom level 15 a single pixel is approximately 5 meters wide.

    http://rbrundritt.wordpress.com

    Tuesday, July 8, 2014 6:03 PM
  • Hi Ricky,

    Thanks for that, yep, zooming out made it appear, and with your second post i've decided to only add certain gps points depending on the count.

    All sorted now. Thanks very much

    Cheers ... Rob.

    Tuesday, July 8, 2014 9:42 PM