Migration Guide - Map SDK

Version 3.0

The bump from 2.x to 3.x only affects Python users.

Upgrading to 3.0

For Python

  • Helper classes are now public - many "private" classes (with an underscore prefix in the name) are now public, i.e. exported at root level (foursquare.map_sdk) without the leading underscore.
  • Union type simplification - more simple union types have been flattened (removed their aliases) to avoid excessive obfuscation and make it work better with certain IDEs.

Note that most changes have no functional effect on your code. These changes improve typing and clarity.

Your type checker may point out certain issues that should be very easy and straighforward to upgrade, and to make that switch easy, we provide a complete set of changes below. To locate any of the new types and classes, just import them from the root (foursquare.map_sdk).

Removed the underscore prefix:

  • _LayerCreationProps
  • _LayerUpdateProps
  • _LayerGroupUpdateProps
  • _LayerGroupCreationProps
  • _VectorTilestats
  • _VectorTileDatasetCreationProps
  • _VectorTileDatasetRemoteCreationProps
  • _RasterTileDatasetCreationProps
  • _LocalDatasetCreationProps
  • _VectorTileDatasetCreationProps
  • _RasterTileDatasetCreationProps
  • _VectorTileDatasetRemoteCreationProps
  • _RasterTileDatasetRemoteCreationProps
  • _DatasetUpdateProps
  • _EffectUpdateProps
  • _EffectCreationProps
  • _PartialRangeFilter
  • _PartialSelectFilter
  • _PartialTimeRangeFilter
  • _PartialMultiSelectFilter
  • _PartialMapControlVisibility
  • _PartialViewLimits
  • _PartialView
  • _PartialSplitModeContext
  • _VectorLayer (has also been renamed to VectorTileLayer to avoid aliasing a type name)

Flattened types:

Old typeNew type
FieldUnion[BasicField, TimestampField]
RasterTileLocalMetadataUnion[RasterTileLocalItemMetadata, RasterTileLocalCollectionMetadata]
_DatasetCreationPropsUnion[LocalDatasetCreationProps, VectorTileDatasetCreationProps, RasterTileDatasetCreationProps]
_TileDatasetCreationPropsUnion[VectorTileDatasetRemoteCreationProps, RasterTileDatasetRemoteCreationProps]
FilterUnion[RangeFilter, SelectFilter, TimeRangeFilter, MultiSelectFilter]
SplitModeLiteral["single", "dual", "swipe"]
SetSplitModeOptionsPartialSplitModeContext
ThemePresetsLiteral["light", "dark"]
ViewModeLiteral["2d", "3d", "globe"]

New types:

  • AnnotationCreationProps
  • AnnotationUpdateProps

Documentation now also has a new page for Python best practices.

The experimental submodule has been moved (to foursquare.map_sdk.api.layer) and is now accessible from the root (foursquare.map_sdk) directly, without having to import further submodules. To upgrade, switch any of your foursquare.map_sdk.api.experimental.* imports to foursquare.map_sdk.

For Javascript/Typescript:

  • None.

Version 2.0

🚧

Deprecation notice:

We will be phasing out v1.x of the libraries in favor of the new ones, so we recommend you upgrade as soon as possible. There are no plans to make further updates to these older versions of the libraries. The final sunset will happen no earlier than September 30th, 2024. For any additional help, you can reach us via our Studio Community Slack channel.

Upgrading from 1.x to 2.x

For Python:

  • install the new version of the library from PyPI (pip install foursquare.map-sdk)
  • update all your imports from unfolded.map_sdk.* to foursquare.map_sdk.*
  • provide the api_key parameter in your create_map() calls (learn more about API Keys in Authentication)

For Javascript/Typescript:

  • install the new version of the library from npm (npm install @foursquare/map-sdk)
  • update all your imports from @unfolded/map-sdk to @foursquare/map-sdk
  • provide the apiKey parameter in your createMap() calls (learn more about API Keys in Authentication)