Hello
I'm trying to figure out how to implement continuous panning with xamMap.
I mean, to have a "google map"-like behavior: when you keep panning towards the map border (east or west) then the map wraps around.
If it's not a basic xamMap feature, do you have an (easy) solution, like overriding the onRender method ?
Thanks.
Hi Warning,
Unforunately XamMap doesn't support this functionality and there is no easy way to "inject" it. I would recommend submitting a feature request for it here: http://devcenter.infragistics.com/Protected/RequestFeature.aspx.
Regards,
Ivan Kotev
Thanks Ivan, I've submitted the feature.
I haven't found any "off-the-shelf" map component that implements it yet. In the meantime, more and more customers ask for it; as it has become a basic way of navigating maps using google or bing maps.
I hope Infragistics will plan to implement it soon, as it would get you a major edge over your competitors.
As a possible work around, you could try creating some "buffer zone" around the edges of the shape file where you copy some geometry from the opposite side of the shapefile. Then, if you keep an eye on the WindowRect of the map, you could move the view to the equivalent edge of the other side of the map as the user approached the ultimate edge of the map. I believe a strategy like this might work, but could be a bit complicated to set up. The other thing you would have to do is make sure the initial zoom level didn't reveal that the world is "tiled" in this fashion. As a warning, this is just and idea, I don't know if anyone has attempted to implement this on the XamMap before or how easily your shapefile tools would allow you to make the modification.
It may also be possible to try to get this to work with a custom projection, but I have not investigated this.
-Graham
Actually, to make the tiled solution work you would probably want to actually tile the map, i.e. make a 3x3 grid of them, and once the view is fully in one of the tiles, update the WindowRect so that the user is viewing the center of the grid. You would also need to lock the user from zooming out beyond a certain point.
I'm certainly not arguing that this would be a better solution than having this a native feature for the Map. Was just theorizing as to what other approaches might be possible, in the meantime. The short answer is that the map doesn't currently natively support this functionality, as Ivan said.
Another approach you could use is if you detect someone has dragged against an edge of the map, you could make a little arrow icon appear indicating they can press it to have the view pop around the other side of the map (which you can do by programatically updating the WindowRect).
This solution could work but seems quite heavy.
I think I actually only need a 3x1 grid, because for a world map I only need to have this "continuous panning" effect following the East/West axis and not North/South.
But it means to have bigger shapefiles (3 times bigger), duplicate (3x) all the objects displayed on the map, etc. I'm not sure I want to enter in this kind of implementation.
Actually, depending on which projections you are using, those approaches may not be valid. I may see if I can find you a work around, but your best bet is probably still the feature request.