Skip to content

Instantly share code, notes, and snippets.

@1ec5
Last active November 10, 2021 22:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 1ec5/506255c09018f6f3abea916759fca9ec to your computer and use it in GitHub Desktop.
Save 1ec5/506255c09018f6f3abea916759fca9ec to your computer and use it in GitHub Desktop.
Order in the coord

Coordinate order in various Mapbox libraries

Legend:

  • βœ… Behaves correctly at runtime
  • ❌ Compile-time or runtime error or otherwise impossible to write
  • πŸ™€ Behaves incorrectly at runtime
Mapbox-related library Latitude, longitude Longitude, latitude Order-independent
Flutter Mapbox GL Native (Dart) βœ… πŸ™€ ❌
Leaflet (JavaScript) βœ… πŸ™€ βœ…
Mapbox CLI πŸ™€ βœ… ❌
Mapbox GL Directions (JavaScript) πŸ™€ βœ… ❌
mapbox-gl-draw.js (JavaScript) πŸ™€ βœ… ❌
Mapbox GL JS (JavaScript) πŸ™€ βœ… βœ…
Mapbox Java SDK πŸ™€ Directions
πŸ™€ Geocoding
❌ Static maps
πŸ™€ Line simplification
πŸ™€ Turf
βœ… Directions
βœ… Geocoding
❌ Static maps
βœ… Line simplification
βœ… Turf
❌ Directions
❌ Geocoding
βœ… Static maps
❌ Line simplification
❌ Turf
Mapbox JavaScript SDK πŸ™€ βœ… ❌
Mapbox Maps SDK for Android v9 (Java) βœ… Map camera
βœ… Annotations
βœ… User location
βœ… Offline maps
πŸ™€ Runtime styling
πŸ™€ Feature querying
πŸ™€ Map camera
πŸ™€ Annotations
πŸ™€ User location
πŸ™€ Offline maps
βœ… Runtime styling
βœ… Feature querying
❌
Mapbox Maps SDK for Android v10 (Kotlin) πŸ™€ βœ… βœ… Camera
Mapbox Maps SDK for iOS v6 βœ… Objective-C
βœ… Swift
❌ Interface Builder
πŸ™€ Objective-C
❌ Swift
❌ Interface Builder
βœ… Objective-C
❌ Swift
βœ… Interface Builder
Mapbox Maps SDK for iOS v10 (Swift) βœ… ❌ ❌
Mapbox Maps SDK for macOS βœ… Objective-C
βœ… Swift
βœ… AppleScript
❌ Interface Builder
πŸ™€ Objective-C
❌ Swift
πŸ™€ AppleScript
❌ Interface Builder
βœ… Objective-C
❌ Swift
βœ… AppleScript
βœ… Interface Builder
Mapbox Maps SDK for Qt (C++, QML) βœ… πŸ™€ ❌
Mapbox Maps SDK for Unity (C#) βœ… πŸ™€ ❌
mapbox.js (JavaScript) βœ… πŸ™€ βœ…
mapbox-directions.js (JavaScript) βœ… πŸ™€ βœ…
MapboxGeocoder.swift βœ… Objective-C
βœ… Swift
βœ… AppleScript
πŸ™€ Objective-C
❌ Swift
πŸ™€ AppleScript
βœ… Objective-C
❌ Swift
βœ… AppleScript
Mapbox Directions (Swift) βœ… ❌ ❌
MapboxStatic.swift βœ… Objective-C
βœ… Swift
βœ… AppleScript
πŸ™€ Objective-C
❌ Swift
πŸ™€ AppleScript
βœ… Objective-C
❌ Swift
βœ… AppleScript
Mapbox Navigation SDK for Android πŸ™€ βœ… ❌
Mapbox Navigation SDK for iOS (Swift) βœ… ❌ ❌
Mapbox Python SDK πŸ™€ βœ… ❌ Directions
❌ Distances
βœ… Geocoding
βœ… Static maps
❌ Surface
Mapbox Ruby SDK ❌ ❌ βœ…
Mapbox Search SDK for Android πŸ™€ βœ… ❌
Mapbox Search SDK for iOS (Swift) βœ… ❌ ❌
Mapbox SceneKit SDK for iOS (Swift) βœ… ❌ ❌
Mapbox Vision SDK for Android βœ… πŸ™€ ❌
Mapbox Vision SDK for iOS (Swift) ❌ βœ… ❌
node-mapbox-gl-native (JavaScript) πŸ™€ βœ… ❌
polyline βœ… πŸ™€ ❌
React Native Mapbox GL (JavaScript) ❌ Map camera
βœ… Annotations
❌ Map camera
πŸ™€ Annotations
βœ… Map camera
❌ Annotations
Turf (JavaScript) πŸ™€ βœ… ❌
Turf (Swift) βœ… ❌ ❌

For the purposes of this table:

  • Ordered:
    • array literals
    • unnamed parameter lists
    • named, order-dependent parameter lists (Swift)
  • Unordered:
    • object literals with key-value pairs
    • named, order-independent parameter lists (Python)
    • designated initializers (Objective-C)
    • Builder pattern where the constructor doesn’t take latitude or longitude (Java)
    • GUI text fields that you can fill out in any order (Interface Builder)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment