Xamarin.Forms.Maps iOS Padding - ios

I am having trouble finding a solution for my problem. I am looking to set the padding for the Xamarin Forms Map (Mapkit/MKMapView) on iOS (Custom Renderer).
For Android it can be set in the custom renderer with NativeMap.SetPadding(10,200,10,10) but I cannot find a way to do it in iOS.
The problem I am trying to solve is that the compass on the map appears on the top right corner of the map (iOS) and since I do have my own controls on the top of the map, the compass is not accessible.
On android setting the padding pushes the compass down below my controls and solves the issue.
I’d appreciate any suggestion on how to solve it for iOS

MapKit.MKMapView
You can create your own MKCompassButton and alter its X/Y position (via its Frame) on the map.
var compass = MKCompassButton.FromMapView(mkMapViewInstance);
compass.CompassVisibility = MKFeatureVisibility.Visible;
compass.Frame = new CGRect( new CGPoint(25,25), compass.Frame.Size);
re: https://developer.apple.com/documentation/mapkit/mkcompassbutton?language=objc
Google.Maps.MapView (iOS)
You can add padding around the edges of the map using the GMSMapView.padding property. The map will continue to fill the entire container, but text and control positioning, map gestures, and camera movements will behave as if it has been placed in a smaller space. This results in the following changes:
myGMSMapViewInstace.Padding = new UIEdgeInsets(100.0f, 100.0f, 100.0f, 100.0f);

Related

How can I position an a-frame object to bottom left corner of the marker, and make its width equal to the marker's width?

I'm trying to create a basic scene an AR.JS with NFT (so it's not just the basic marker-based tracking; it tracks a custom image) using A-frame to place down and position my objects, but I've noticed that e.g.: if I place a 1*1*1 size box in the scene, it will appear at different places on different devices. And also, if I don't scale it up to like 200, it will appear as a very-very tiny box.
E.g.: If I try to view my scene on my phone, the object appears at the exact center of the marker, but if I check it on a different phone, it will appear almost completely outside the marker. Also, if I check it with a webcam, it will appear yet again in a different place, and even in a different size.
I wonder if there is any option to make the marker images bottom left (or any other) corner the 0 0 0 point, so I can position my objects more precisely, and also set the object's width to equal the marker images width, so I don't have to scale up the object like this.
At this moment there is any option to display a model in the center of the NFT marker. This because AR.js depend on jsartoolkit5 and this last has no yet this feature. But if you know the width, height and dpi you can display the object in the center of the maker with this formula (pseudo code):
obj.position.y = (marker.height / marker.dpi * 2.54 * 10)/2.0;
obj.position.x = (marker.width / marker.dpi * 2.54 * 10)/2.0;
You can acquire width, height and dpi while creating your marker or using the dispFeatureSet display app distributed by the Artoolkit5 SDK you can find binaries here https://github.com/artoolkitx/artoolkit5/releases/tag/5.4.0 or from artookitx website https://www.artoolkitx.org/docs/downloads/

It's possible to use any borderless custom marker for AR.js

I am using custom marker for AR.js which is working fine, But I need to create a black border less or margin less custom marker for my project but when i create it along with it's pattern it's not effected rather it's detect the old custom marker. Please help me if it's possible.

Core Plot library to draw graph in auto layout Xcode 6.1 for any device orientation, legends in iOS

I want to draw graph in iOS native app (Making app using auto layout and Xcode 6.1)..after googling I found core plot lib for drawing graph.
I am struggling with this library to do make pie,bar,donut and line chart as I want.
I used the examples which are in 'examples' folder of this library.
How do I make graph to adjust when app is rotating and takes auto
layout constraints?
For bar/line chart-I don't get idea to make graph compact or make
scroll when there is large data to show on x or y axis?
For any chart- How do I show legends(title or explanation for
graph)?
How do I show values on bar/pie/line itself(Value on each
pie slice / every bar/ every line point)?
Can I set X and Y axis start and end point?
Please help if anybody have an idea? Thanks in advance.
The Plot Gallery example app demonstrates all of these things. You'll need to use the latest code from GitHub (release 1.5.1 doesn't have some of the newer features like auto layout; 1.6 will be out soon, but isn't quite ready yet).
The iOS version of the Plot Gallery uses a storyboard and auto layout to control the UI.
Set allowsUserInteraction to YES on the plot space to enable pinch zoom and scrolling behavior. You can disable pinch gestures and keep the scrolling behavior with the allowPinchScaling property on the hosting view.
Many of the Plot Gallery demos have legends. Look for CPTLegend in the code. Ask a more specific question if you need more help with this.
These are known as "data labels" in Core Plot. Many of the Plot Gallery demos have them. You can set a formatter and text style on the plot to turn them on, or use a plot delegate to have more control over each label.
Set the xRange and/or yRange of the plot space associated with the axes to control the coordinate space of the plot area.

Maps on iOS: Drawing layers without showing the base map

We are looking for a drawing / mapping SDK for iOS with the following requirements:
Draw multiple polygons on a single view. polygon coordinates are based on earth lat/long
Do not show other map layers from satellite / street view / whatever - just the polygon data
Allow adding layers / text/ bubbles / etc.
Allow zoom in-out
Allow clicking on regions.
Calculate bounding rect automatically, and do not allow the user to scroll out of this area.
Is there an SDK that supports these requirements?
Thanks.
Check out the Mapbox iOS SDK. It's open source, allows you to hide the basemap (or create a custom basemap to whatever appearance you desire), constrain the panning and zooming, add vector polygons atop the baselayer(s), add text and labels, control interactivity, and more.

How to add a MapPolygon to Windows Phone 8 map?

I've recently downloaded and installed Windows 8 OS along with Visual Studio 2012 and I'm trying to port an old project I built on Windows Phone 7 to WP8.
It has a map that originally had a MapPolygon in it so that whenever you zoom in/out the polygon was always proportional based on the zoom level.
MapPolygon is still a valid class using the new Map control (not Bing Maps Control) but I have no idea how to add it to a map to get the same features/properties.
I think it has to do with the MapElements which should allow to add a shape to the map in the following fashion.
MapPolygon shape = new MapPolygon();
shape.Path.Add(new GeoCoordinate(55.859185825719055, 2.2946083545684877));
shape.Path.Add(new GeoCoordinate(55.858185825719055, 2.2956083545684877));
shape.Path.Add(new GeoCoordinate(55.857185825719055, 2.2946083545684877));
shape.Path.Add(new GeoCoordinate(55.858185825719055, 2.2936083545684877));
shape.StrokeThickness = 3;
shape.StrokeColor = Colors.Blue;
shape.FillColor = Colors.Black;
map1.MapElements.Add(shape);
Nothing shows on the map.
I've also tried to add a Grid to a MapOverlay to a MapLayer to a Map but I have no idea how/where to add the MapPolygon in this way.
Ridiculous mistake.
My map wasn't centered at the same place as the GeoCoordinates were added to the shapes path.

Resources