Follow Mode

2249
13
12-21-2020 02:05 AM
GonzaloMuöoz
Occasional Contributor

Hi,

 

I'm using ArcGIS Runtime .net 100.9 version. I'd like to know if there's a way of center constantly the map on the movement of an element. What I'm using now is to when moving the element, make a SetViewpointCenterAsync, but it's not a valid approach since the map's center is changed everytime. Map should stay centered all the time on the element without any visual effect.

 

Regards

Gonzalo

0 Kudos
13 Replies
JoeHershman
MVP Regular Contributor

The MapView has a LocationDisplay property.  LocatonDisplay has  AutoPanMode.

mapView.LocationDisplay.AutoPanMode = LocationDisplayAutoPanMode.Recenter;

 

0 Kudos
GonzaloMuöoz
Occasional Contributor

Thanks @JoeHershman . I've been testing that functionality with the Code Samples (Show Location History) and it's not working correctle as it recenters late and not with each position update. Apart from that, when panning on the mapview, it sems like the functionality is stopped. Is something wrong on the sample or is it a bug?  Will this bugs be fixed?

If yes, how can this be used to assign a graphic to be recentered, because from what I've seen you create the symbol on runtime, but I need to assign this recenter mode to a already created graphic.

0 Kudos
sandiegomonedero
New Contributor II

This example may help

https://developers.arcgis.com/net/latest/wpf/sample-code/animate-3d-graphic/

You could also try the non asyncronous SetViewpoint to remove the lag you may have with the asyncronous one.

GonzaloMuöoz
Occasional Contributor

Hi sandiegomonedero,

 

we are now using the SetViewpoint method and it has improve the performance of the FollowMode, but now graphics are flashing and sometimes there's a lack on the viewpoint and graphics reposition... Any idea on how to proceed? Our costumer has not accepted still the solution. 

0 Kudos
GonzaloMuöoz
Occasional Contributor

Hi,

any help with this issue??

Regards

0 Kudos
GonzaloMuöoz
Occasional Contributor

Hi again,

as nobody is answering and this is quite a critical issue for us, we are thinking on possible workarounds to fix this bug. Is there any way we can update all the graphics' geometry at the same time instead of modyfing them all one by one?

Thanks

Regards

0 Kudos
sandiegomonedero
New Contributor II

can you explain a bit more the problem?. I thought you wanted to keep the map (or sceneView?) on top of a given graphic. You were using SetView but you say graphics were flashing. Are those flashing graphics on a dynamical or statical graphics overlay?

Now as a work around you want to move all graphics instead of the map?  to move them you will have to do it one by one, but maybe you can do it as a List<Graphic> and them simply add it at once as a range.

0 Kudos
GonzaloMuñoz
New Contributor II

Hi @sandiegomonedero ,

we've already raise a case about this issue (#02762816 Follow Mode produces flash effect and it isn't centered). In that case we uploaded a video of the problem, please find it attached in  MovementBug.zip.

More info: SetView is called synchronously and renderinf mode of graphics dynamic.

Regarding the workaround, do you think that removing and adding all graphics instead of updating the geometry when position is updated will be efficiently better.

Thanks

REgards 

0 Kudos
sandiegomonedero
New Contributor II

I just tried the simplest implementation on v100.10 of an updating view following a graphic object and the transition is totally smooth. As the number of updating graphics increases however (to around 200 graphics updated every 100ms together with the SetView update) I can see the flashing effect you mention.  I would not consider that a bug, but simply a performance limit. I used simple markers, maybe with other graphic types or labels like you use the performance is worst and it may be considered a bug.

Concerning adding graphics or updating geometry I do not know, I would just try both and see. The good thing about updating the whole graphics is that you can update them in parallel and then add them as a range which is usually faster.

Note: I am not a runtime specialist or anything, just giving my advice based on the little I know.

0 Kudos