Git Product home page Git Product logo

geoswiftmapboxgl's Introduction

GEOSwiftMapboxGL

Cocoapods Compatible Supported Platforms Build Status

See GEOSwift for full details

Requirements

  • iOS 9.0+
  • Swift 5.1+
  • CocoaPods 1.4.0+
  • MapboxGL 6

Installation

CocoaPods

  1. Follow the Mapbox Maps SDK installation instructions to configure your ~/.netrc file.

  2. Update your Podfile to include:

     use_frameworks!
     pod 'GEOSwiftMapboxGL'
    
  3. Run $ pod install

Usage

import GEOSwift
import Mapbox
import GEOSwiftMapboxGL

...

let point = Point(longitude: 10, latitude: 45)
let polygon = try! Polygon(wkt: "POLYGON((35 10, 45 45.5, 15 40, 10 20, 35 10),(20 30, 35 35, 30 20, 20 30))")

let annotations = [
    MGLShape.make(with: point),
    MGLShape.make(with: polygon)
]
self.mapView.showAnnotations(annotations, animated: true)

...

In this table you can find which annotation class you should expect when using MGLShape.make(with:):

GEOSwift MapboxGL
Point MGLPointAnnotation
LineString MGLPolyline
Polygon MGLPolygon
MultiPoint MGLPointCollection
MultiLineString MGLMultiPolyline
MultiPolygon MGLMultiPolygon
GeometryCollection MGLShapeCollection

You can also use MGLShape.makeFeature(with:):

GEOSwift MapboxGL
Point MGLPointFeature
LineString MGLPolylineFeature
Polygon MGLPolygonFeature
MultiPoint MGLPointCollectionFeature
MultiLineString MGLMultiPolylineFeature
MultiPolygon MGLMultiPolygonFeature
GeometryCollection MGLShapeCollectionFeature

Each of these MapboxGL types also receive convenience initializers that accept the corresponding GEOSwift type.

Contributing

To make a contribution:

  • Fork the repo
  • Start from the main branch and create a branch with a name that describes your contribution
  • Follow the Mapbox Maps SDK installation instructions to configure your ~/.netrc file.
  • Run $ pod install
  • Open GEOSwiftMapboxGL.xcworkspace and make your changes.
  • Run $ swiftlint from the repo root and resolve any issues.
  • Push your branch and create a pull request to main
  • One of the maintainers will review your code and may request changes
  • If your pull request is accepted, one of the maintainers should update the changelog before merging it.
  • Due to the need for a secret Mapbox token to install the Mapbox SDK, CI will not run for PRs from forks. Maintainers should be sure to run the test suite locally before accepting any changes.

Maintainer

Past Maintainers

License

  • GEOSwiftMapboxGL was released by Andrea Cremaschi (@andreacremaschi) under a MIT license. See LICENSE for more information.
  • GEOSwift was released by Andrea Cremaschi (@andreacremaschi) under a MIT license. See LICENSE for more information.
  • GEOS stands for Geometry Engine - Open Source, and is a C++ library, ported from the Java Topology Suite. GEOS implements the OpenGIS Simple Features for SQL spatial predicate functions and spatial operators. GEOS, now an OSGeo project, was initially developed and maintained by Refractions Research of Victoria, Canada.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.