On the following page ProConcepts Map Authoring · Esri/arcgis-pro-sdk Wiki · GitHub is stated that the Map object has a map scale property, but I cannot find this property. MapView.Active doesn't have a map scale property neither.
So how can I get and set the map scale?
Solved! Go to Solution.
Hello Matthew,
thank you for your reply! For the map view, setting the map scale works as follows:
MapView mapView = MapView.Active;
Camera camera = mapView.Camera;
camera.Scale = 5000;
mapView.ZoomToAsync(camera, TimeSpan.Zero);
Barbara
Camera camera = newMapframe.Camera;
camera.X = -118.465;
camera.Y = 33.988;
camera.Scale = 30000;
newMapframe.SetCamera(camera);
Use the camera of the map frame. xy to center it, then scale it how you want. I should note this is for layouts. I don't know off the top of my head how it is done in the map view. Let me know if that is what you need and I can try and figure it out.
Hello Matthew,
thank you for your reply! For the map view, setting the map scale works as follows:
MapView mapView = MapView.Active;
Camera camera = mapView.Camera;
camera.Scale = 5000;
mapView.ZoomToAsync(camera, TimeSpan.Zero);
Barbara
This is exactly what I am looking for, kudos to @BarbaraSchneider2