POST
|
If it's by design, it should behave the same on Android devices with safe areas (at least on Xamarin Forms). There should also be a proper way to disable/adjust this that doesn't involve creating a negative value ViewInset with a self-calculated value. Please consider changing this in the future.
... View more
05-06-2022
01:32 AM
|
0
|
0
|
448
|
POST
|
I did some further testing, and it seems the MapView controls thinks the center is exactly 48 pixel off. I can "fix" this issue by actually adding a negative ViewInsets.Top value: MapView.ViewInsets = new Thickness(0, -48, 0, 0); 48 pixel happens to be exactly the height of the top safe area inset (aka the "notch") of the iPhone 11 simulator I'm testing on. So this seems to further my suspicion: The control might somehow have a "hidden" Viewinset that takes the iPhones notch into account for the center calculation. I have to test this on multiple devices though to make sure. I think this is a bug in the ArcGis runtime on iOS, because this does NOT happen on Android devices with a notch.
... View more
05-02-2022
01:05 AM
|
0
|
1
|
469
|
POST
|
I set the IsAttributionTextVisible property to True so you can see that there is no other UI element above it. I also included a second screenshot where I wrap the element in a Xamarin-Frame control with a red Border and a Padding of 0 so that it makes sure, the whole control is visible. Also keep in mind that this problem is only on iOS. It works fine on Android and this is a Xamarin-Forms application so the UI page should be the same.
... View more
05-02-2022
12:35 AM
|
0
|
2
|
471
|
POST
|
The method SetViewpointCenterAsync doesn't actually set the view point to the center of the control on iOS but slightly above it. This does not happen on Android. You can easily see this, if you have an active location source displayed and use this to center like this: MapView.SetViewpointCenterAsync(MapView.LocationDisplay.Location.Position); The first screenshot includes a cursor image, where the correct center should be using a Xamarin AbsoluteLayout like this: <AbsoluteLayout>
<esriUI:MapView x:Name="MapView"
AbsoluteLayout.LayoutFlags="All"
AbsoluteLayout.LayoutBounds="0,0,1,1"/>
<!-- Cursor -->
<ffimageloadingsvg:SvgCachedImage x:Name="Cursor"
AbsoluteLayout.LayoutFlags="PositionProportional"
AbsoluteLayout.LayoutBounds="0.5,0.5,AutoSize,AutoSize"
WidthRequest="25" HeightRequest="25"/>
</AbsoluteLayout> My guess is, that the MapView somehow included the screen dead zone / area insets in it's center point calculation. I haven't found any property to disable this though. Esri ArcGIS Runtime version 100.12.0. Screenshots taken on iPhone X.
... View more
04-29-2022
05:51 AM
|
0
|
5
|
504
|
POST
|
GeometryEngine.NearestCoordinate(envelope, mapPoint) throws a NotImplementedException. This is definitely a bug, as the documentation doesn't mention it: GeometryEngine.NearestCoordinate Method The fix is to convert the Envelope to a Polygon: private static Polygon EnvelopeToPolygon(Envelope envelope) { return new Polygon(new MapPoint[] { new MapPoint(envelope.XMin, envelope.YMin, envelope.SpatialReference), new MapPoint(envelope.XMax, envelope.YMin, envelope.SpatialReference), new MapPoint(envelope.XMax, envelope.YMax, envelope.SpatialReference), new MapPoint(envelope.XMin, envelope.YMax, envelope.SpatialReference) }); } It really should be implemented, as it's just a few lines of code.
... View more
10-13-2019
03:58 PM
|
0
|
1
|
456
|
POST
|
Not nice, but works. Also seems pretty smooth. Probably good enough for production. Define an envelope: private Envelope _bounds= new Envelope( new MapPoint(MAP_BOX_WEST, MAP_BOX_NORTH, SpatialReferences.WebMercator), new MapPoint(MAP_BOX_EAST, MAP_BOX_SOUTH, SpatialReferences.WebMercator)); Now make a polygon as well, because some GeometryEngine operations don't work with Envelopes for some reason: private Polygon _boundsPolygon = EnvelopeToPolygon(_envelope); private static Polygon EnvelopeToPolygon(Envelope envelope) { return new Polygon(new MapPoint[] { new MapPoint(envelope.XMin, envelope.YMin, SpatialReferences.WebMercator), new MapPoint(envelope.XMax, envelope.YMin, SpatialReferences.WebMercator), new MapPoint(envelope.XMax, envelope.YMax, SpatialReferences.WebMercator), new MapPoint(envelope.XMin, envelope.YMax, SpatialReferences.WebMercator) }); } Finally add a ViewpointChanged event: private void MapView_ViewpointChanged(object sender, EventArgs e) { var selected = (MapPoint)MapView.GetCurrentViewpoint(ViewpointType.CenterAndScale).TargetGeometry; bool legal = GeometryEngine.Contains(_bounds, selected); if (!legal) { SetViewpoint(GeometryEngine.NearestCoordinate(_boundsPolygon, selected).Coordinate); return; } } This method changes the viewpoint back to a legal state. Also prevents user interaction during the animation. private async void SetViewpoint(MapPoint point) { MapView.InteractionOptions.IsEnabled = false; //Make sure to initialize MapView.InteractionOptions to avoid NullReferenceException await MapView.SetViewpointCenterAsync(point); MapView.InteractionOptions.IsEnabled = true; }
... View more
10-13-2019
03:44 PM
|
0
|
1
|
1076
|
POST
|
Is it possible to output a Geometry object in the http://geojson.org/ format (as a simple string) somehow? The runtime only seems to support ToJson(), which is a ArcGIS-specific format. Maybe there is an open source library or a C# code snippet out there that does that?
... View more
02-27-2018
04:14 AM
|
0
|
2
|
3904
|
POST
|
To be honest - just the Esri.ArcGISRuntime.Geometry part would be enough. Is it impossible to separate it from the rest? They aren't really plattform-specific and I would assume pretty stand-alone. The same set of features is already available for .NET Framework and .NET Core through NuGet packages so I would assume targeting .NET Standard for this part wouldn't be that hard. I would rather not use shared code projects for this. The Geometry classes offer very rich geometry operations and datatypes. Just sharing those on client and server would be very handy. Licensing wouldn't be much of an issue for us. We already have the new licensing servers and would just buy whatever additional Esri product we need.
... View more
08-29-2017
02:06 PM
|
0
|
1
|
581
|
POST
|
Is it planned to add .NET Standard support to the ArcGISRuntime (or mainly the Esri.ArcGISRuntime.Geometry part)? I haven't seen anythiong about it. I have a lot of shared code between web services and Xamarin apps (we use .NET Standard libraries for that). We plan on using the ArcGISRuntime for mapping on the apps so it would be neat to use the geometry operations on the backend as well.
... View more
08-29-2017
12:20 AM
|
0
|
3
|
1645
|
POST
|
How can I add an authentication cookie to requests (like loading a FeatureLayer)? Basically, my ArcGIS server is behind a in-house web portal that asks you to authenticate via a web form. After that a cookie gets added and every following request reaches the web server (in this case the ArcGIS sever). I tried a few things with AuthenticationManager but couldn't get anything to work. Usually the runtime complains about the response being not a correct JSON document. I wasn't even able to let AuthenticationManager send any authentication data at all because it makes requests to "/rest/info?f=json" and "/tokens/" which aren't even real URLs on our platform and will just return 404. I really only need to specify a custom cookie for each request and can handle the authentication myself but I don't see any option like that.
... View more
07-12-2017
05:36 AM
|
0
|
0
|
755
|
POST
|
This works, thank you! You don't happen to have a similar workaround/implementation for ServiceFeatureTable from WMS?
... View more
12-19-2016
07:58 AM
|
0
|
0
|
1739
|
POST
|
Is there no workaround for adding a single layer? I was told, the SDK supports "Open Street Map", which uses the same protocol as basemap.at.
... View more
12-14-2016
02:32 AM
|
0
|
14
|
1739
|
POST
|
I'm kinda lost here. I basically just want to add a Layer for basemap.at - see here: https://www.basemap.at/wmts/1.0.0/WMTSCapabilities.xml How do I do this? Do I use ArcGISTiledLAyer? ArcGISMapImageLayer? Which Uri? The only documentation about WMTS I found was a "PortalItemType". If I need a "ArcGISPortal", what should I use as an Uri here?
... View more
12-12-2016
01:48 AM
|
0
|
16
|
4058
|
Online Status |
Offline
|
Date Last Visited |
05-06-2022
03:02 AM
|