S
S
Strann1k2014-05-15 19:08:56
Windows phone
Strann1k, 2014-05-15 19:08:56

How to fix glitch with adding markers to map in wp8?

I will try to explain and show the essence of the problem.
1. There is a map from the SDK from WP8.
2. You need to dynamically add markers (PushPin) to the map.
Solution:
At the time of receiving a response from the server, I add markers to the map:

MapLayer _allDriversLayer = new MapLayer();

{
...
foreach (var model in carsInfo.ToList())
{
    var pushpin = new CarPushpin();
    _allDriversLayer.Add(new MapOverlay
    {
        Content = pushpin, GeoCoordinate = model.GeoCoordinate, PositionOrigin = new Point(0.5, 1)
    });
}
...
}

At the time of initialization, everything seems to be fine, the markers are on the map, the map is moving and working, everything is fine.
Next, you need to change the markers: move, delete and add new ones.
Problem:
When the marker is removed, a glitch occurs, barely noticeable on the emulator, but 100% reproducible on the device:
The marker is shifted to PositionOrigin = new Point(0, 0), and then disappears. The key to this problem is that the marker is used centered at the middle of the width, i.e. Point(0.5, 1).
Video what it looks like: www.youtube.com/watch?v=7UWdd0laoB8
If someone faced such a problem, please help. And yes, this glitch is not reproduced on wp7 cards, but it is already undesirable to use them.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question