Skip to content
This repository has been archived by the owner on Jul 16, 2023. It is now read-only.

Commit

Permalink
#3 Mapbox iOS v3.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tuyen-vuduc committed Nov 26, 2017
1 parent fd0ddf1 commit 7325bd5
Show file tree
Hide file tree
Showing 181 changed files with 1,183 additions and 3,370 deletions.
Binary file not shown.
234 changes: 213 additions & 21 deletions Naxam.Mapbox.iOS/ApiDefinitions.cs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Naxam.Mapbox.iOS/Naxam.Mapbox.iOS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<ObjcBindingCoreSource Include="StructsAndEnums.cs" />
</ItemGroup>
<ItemGroup>
<NativeReference Include="..\sharpie\Binding\Mapbox.framework">
<NativeReference Include="..\frameworks\Mapbox.framework">
<Kind>Framework</Kind>
<SmartLink>False</SmartLink>
</NativeReference>
Expand Down
5 changes: 2 additions & 3 deletions Naxam.Mapbox.iOS/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// Change them to the values specific to your project.

[assembly: AssemblyTitle("Naxam.Mapbox.iOS")]
[assembly: AssemblyDescription("Xamarin binding library for Mapbox iOS SDK")]
[assembly: AssemblyDescription("Xamarin.iOS binding library for Mapbox SDK")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("NAXAM CO.,LTD")]
[assembly: AssemblyProduct("X Bindings")]
Expand All @@ -25,8 +25,7 @@
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.

[assembly: AssemblyVersion("3.6.0.3")]
[assembly: AssemblyInformationalVersion("3.6.0.3")]
[assembly: AssemblyVersion("3.7.0")]

// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
Expand Down
88 changes: 82 additions & 6 deletions Naxam.Mapbox.iOS/StructsAndEnums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,71 @@

namespace Mapbox
{
[Native]
public enum MGLIconAnchor : ulong
{
/**
The center of the icon is placed closest to the anchor.
*/
Center,
/**
The left side of the icon is placed closest to the anchor.
*/
Left,
/**
The right side of the icon is placed closest to the anchor.
*/
Right,
/**
The top of the icon is placed closest to the anchor.
*/
Top,
/**
The bottom of the icon is placed closest to the anchor.
*/
Bottom,
/**
The top left corner of the icon is placed closest to the anchor.
*/
TopLeft,
/**
The top right corner of the icon is placed closest to the anchor.
*/
TopRight,
/**
The bottom left corner of the icon is placed closest to the anchor.
*/
BottomLeft,
/**
The bottom right corner of the icon is placed closest to the anchor.
*/
BottomRight,
}
[Native]
public enum MGLIconPitchAlignment : ulong
{
/**
The icon is aligned to the plane of the map.
*/
Map,
/**
The icon is aligned to the plane of the viewport.
*/
Viewport,
/**
Automatically matches the value of `iconRotationAlignment`.
*/
Auto,
}


[Native]
public enum MGLCirclePitchAlignment : ulong
{
Map = 0,
ViewPort
}

[Native]
public enum MGLAnnotationViewDragState : ulong
{
Expand All @@ -26,7 +91,8 @@ public enum MGLErrorCode : long
BadServerResponse = 2,
ConnectionFailed = 3,
ParseStyleFailed = 4,
LoadStyleFailed = 5
LoadStyleFailed = 5,
SnapshotFailed = 6
}

[Native]
Expand Down Expand Up @@ -73,17 +139,26 @@ public enum MGLCircleTranslationAnchor : ulong
[StructLayout(LayoutKind.Sequential)]
public struct MGLCoordinateSpan
{
public double latitudeDelta;
public double LatitudeDelta;

public double longitudeDelta;
public double LongitudeDelta;
}

[StructLayout(LayoutKind.Sequential)]
public struct MGLCoordinateQuad
{
public CLLocationCoordinate2D TopLeft;
public CLLocationCoordinate2D TopRight;
public CLLocationCoordinate2D BottomLeft;
public CLLocationCoordinate2D BottomRight;
}

[StructLayout(LayoutKind.Sequential)]
public struct MGLCoordinateBounds
{
public CLLocationCoordinate2D sw;
public CLLocationCoordinate2D Sw;

public CLLocationCoordinate2D ne;
public CLLocationCoordinate2D Ne;
}

[Native]
Expand Down Expand Up @@ -192,7 +267,8 @@ public enum MGLResourceKind : ulong
Tile,
Glyphs,
SpriteImage,
SpriteJSON
SpriteJSON,
Image
}

[StructLayout(LayoutKind.Sequential)]
Expand Down
17 changes: 4 additions & 13 deletions Naxam.Mapbox.sln
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "nuget", "nuget", "{D8F96117
mapbox-ios.nuspec = mapbox-ios.nuspec
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Naxam.Mapbox.Common", "Naxam.Mapbox.Common\Naxam.Mapbox.Common.csproj", "{A80B2873-6EAF-48A1-8445-2896815EFEE0}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo", "demo", "{22E7F713-BE34-4A11-939A-E358DA858995}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -48,20 +48,11 @@ Global
{3A2E7243-0208-4292-92B4-8C25F27B9843}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
{3A2E7243-0208-4292-92B4-8C25F27B9843}.Debug|iPhone.ActiveCfg = Debug|iPhone
{3A2E7243-0208-4292-92B4-8C25F27B9843}.Debug|iPhone.Build.0 = Debug|iPhone
{A80B2873-6EAF-48A1-8445-2896815EFEE0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A80B2873-6EAF-48A1-8445-2896815EFEE0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A80B2873-6EAF-48A1-8445-2896815EFEE0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A80B2873-6EAF-48A1-8445-2896815EFEE0}.Release|Any CPU.Build.0 = Release|Any CPU
{A80B2873-6EAF-48A1-8445-2896815EFEE0}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{A80B2873-6EAF-48A1-8445-2896815EFEE0}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{A80B2873-6EAF-48A1-8445-2896815EFEE0}.Release|iPhone.ActiveCfg = Release|Any CPU
{A80B2873-6EAF-48A1-8445-2896815EFEE0}.Release|iPhone.Build.0 = Release|Any CPU
{A80B2873-6EAF-48A1-8445-2896815EFEE0}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{A80B2873-6EAF-48A1-8445-2896815EFEE0}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{A80B2873-6EAF-48A1-8445-2896815EFEE0}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{A80B2873-6EAF-48A1-8445-2896815EFEE0}.Debug|iPhone.Build.0 = Debug|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{3A2E7243-0208-4292-92B4-8C25F27B9843} = {22E7F713-BE34-4A11-939A-E358DA858995}
EndGlobalSection
EndGlobal
77 changes: 30 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,63 +1,46 @@
# Xamarin Binding - Mapbox iOS SDK
<img src="./art/repo_header.png" alt="Mapbox for Xamarin.iOS" width="728" />

> This binding library is in internal verification and testing.
> Any forks are warmly welcome to make it quicker and better.
# Mapbox for Xamarin.iOS
A Xamarin.iOS binding library for [Mapbox](https://www.mapbox.com/ios-sdk/) library.

```
Install-Package Naxam.Mapbox.iOS -Pre
```

## Mapbox Access Token

An access token is necessary to use Mapbox services and APIs, such as maps, directions, and geocoding. Your access tokens can be managed in your account settings, where you can retrieve current tokens and generate new ones. You should create a new token for each of your apps, which will help you track usage and minimize disruption in the event a token needs to be revoked.
## About
This project is maintained by Naxam Co.,Ltd.<br>
We specialize in developing mobile applications using Xamarin and native technology stack.<br>

Visit http://mapbox.com to create an account and generate an access token.
**Looking for developers for your project?**<br>

### Configure your iOS project
<a href="mailto:[email protected]">
<img src="https://github.com/NAXAM/naxam.github.io/blob/master/assets/img/hire_button.png?raw=true" height="40"></a> <br>

Once you have generated an access token, you need to set it up within your app. There are two ways to provide an access token in your app:
## Installation

1. In the Info.plist file set MGLMapboxAccessToken with the value of your token.
2. In the AppDelegate.FinishedLaunching method, call AccountManager.AccessToken = "YOUR-TOKEN";

## Metrics Opt-Out

The Mapbox Terms of Service require your app to provide users with a way to individually opt out of Mapbox Metrics. You can provide this opt out in one of two ways:

1. Add a setting to your app’s section in the system Settings app (via a Settings.bundle in your application bundle). You can download a [sample Settings.bundle](https://www.mapbox.com/guides/data/ios/Settings.bundle.zip) file to help you implement this.
2. Integrate the setting directly into your app. Hook the UISwitch control up to the MGLMapboxMetricsEnabled Boolean user default, which should be YES by default. Then set MGLMapboxMetricsEnabledSettingShownInApp to YES in your app’s Info.plist file.
```
Install-Package Naxam.Mapbox.iOS
```

## Location Services
## Usage

In order to show the user’s position on the map, you must first ask for their permission. In iOS 8 and above, this is accomplished by creating and setting the NSLocationAlwaysUsageDescription key in the Info.plist file.
Plz follow the official guide [here](https://www.mapbox.com/ios-sdk/).

For developers on the free Starter plan, background location services must also be enabled. You can find instructions on how to do this in our First Steps guide.
## License

## Add Nuget package
```
Install-Package Naxam.Mapbox.iOS
```
Mapbox binding library for iOS is released under the MIT license.
See [LICENSE](./LICENSE) for details.

## Show it up
# Get our showcases on AppStore/PlayStore
Try our showcases to know more about our capabilities.

Creating a map is very simple using the MapView class:
<a href="https://itunes.apple.com/us/developer/tuyen-vu/id1255432728/" >
<img src="https://github.com/NAXAM/imagepicker-android-binding/raw/master/art/apple_store.png" width="117" height="34"></a>

```c#
// Create a MapView and set the coordinates/zoom
mapView = new MGLMapView (View.Bounds);
mapView.SetCenterCoordinate (new CLLocationCoordinate2D (40.7326808, -73.9843407), false);
mapView.SetZoomLevel (11, false);
<a href="https://play.google.com/store/apps/developer?id=NAXAM+CO.,+LTD" >
<img src="https://github.com/NAXAM/imagepicker-android-binding/raw/master/art/google_store.png" width="117" height="34"></a>

View.AddSubview (mapView);
```
Contact us if interested.

You can add annotations to your map like this:
<a href="mailto:[email protected]">
<img src="https://github.com/NAXAM/naxam.github.io/blob/master/assets/img/hire_button.png" height="34"></a> <br>
<br>

```
// Add new annotation
mapView.AddAnnotation (new MGLPointAnnotation {
Coordinate = new CLLocationCoordinate2D (40.7326808, -73.9843407),
Title = "Sample Marker",
Subtitle = "This is the subtitle"
});
```
Follow us for the latest updates<br>[![Twitter URL](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=https://github.com/NAXAM/mapbox-ios-binding)
[![Twitter Follow](https://img.shields.io/twitter/follow/naxamco.svg?style=social)](https://twitter.com/naxamco)
Binary file added art/repo_header.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#import <UIKit/UIKit.h>

#import "MGLFoundation.h"

NS_ASSUME_NONNULL_BEGIN

/**
Expand All @@ -8,6 +10,7 @@ NS_ASSUME_NONNULL_BEGIN
objects and may be recycled later and put into a reuse queue that is maintained
by the map view.
*/
MGL_EXPORT
@interface MGLAnnotationImage : NSObject <NSSecureCoding>

#pragma mark Initializing and Preparing the Image Object
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#import <UIKit/UIKit.h>

#import "MGLFoundation.h"

NS_ASSUME_NONNULL_BEGIN

@protocol MGLAnnotation;
Expand Down Expand Up @@ -50,6 +52,7 @@ typedef NS_ENUM(NSUInteger, MGLAnnotationViewDragState) {
interactivity such as dragging, you can use an `MGLAnnotationImage` instead to
conserve memory and optimize drawing performance.
*/
MGL_EXPORT
@interface MGLAnnotationView : UIView <NSSecureCoding>

#pragma mark Initializing and Preparing the View
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,23 @@

NS_ASSUME_NONNULL_BEGIN

/**
Orientation of circle when map is pitched.
Values of this type are used in the `MGLCircleStyleLayer.circlePitchAlignment`
property.
*/
typedef NS_ENUM(NSUInteger, MGLCirclePitchAlignment) {
/**
The circle is aligned to the plane of the map.
*/
MGLCirclePitchAlignmentMap,
/**
The circle is aligned to the plane of the viewport.
*/
MGLCirclePitchAlignmentViewport,
};

/**
Controls the scaling behavior of the circle when the map is pitched.
Expand Down Expand Up @@ -220,6 +237,21 @@ MGL_EXPORT
*/
@property (nonatomic) MGLTransition circleOpacityTransition;

/**
Orientation of circle when map is pitched.
The default value of this property is an `MGLStyleValue` object containing an
`NSValue` object containing `MGLCirclePitchAlignmentViewport`. Set this
property to `nil` to reset it to the default value.
You can set this property to an instance of:
* `MGLConstantStyleValue`
* `MGLCameraStyleFunction` with an interpolation mode of
`MGLInterpolationModeInterval`
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *circlePitchAlignment;

/**
Circle radius.
Expand Down Expand Up @@ -490,6 +522,19 @@ MGL_EXPORT

#pragma mark Working with Circle Style Layer Attribute Values

/**
Creates a new value object containing the given `MGLCirclePitchAlignment` enumeration.
@param circlePitchAlignment The value for the new object.
@return A new value object that contains the enumeration value.
*/
+ (instancetype)valueWithMGLCirclePitchAlignment:(MGLCirclePitchAlignment)circlePitchAlignment;

/**
The `MGLCirclePitchAlignment` enumeration representation of the value.
*/
@property (readonly) MGLCirclePitchAlignment MGLCirclePitchAlignmentValue;

/**
Creates a new value object containing the given `MGLCircleScaleAlignment` enumeration.
Expand Down
Loading

0 comments on commit 7325bd5

Please sign in to comment.