Was this helpful?
Google Maps provide the Maps Platform for developers to create features from the Google Maps platform
Alpaca provides ways to be able to leverage the data from Alpaca within your Google Map.
Alpaca provides two main methods for developers to consider integrating their data on to the Google Maps platform.
GeoJSON data format provides a way to easily add data from the Alpaca
platform to maps. The data contains locations as well as directions that can be
used directly on the maps.
Alternatively, you can leverage the
GraphQL API that provides access to the
content on the Alpaca platform, including itinerary information and geometry
such as LngLat positions and polylines (that can be summarised).
Developers can also mix the data approaches, and choose to use the data entered in Alpaca but draw routes from Google platform. To achieve this, data entered including waypoint information, is avialable for querying via the GraphQL API and can then be used withing the Maps Platform.
When making requests to either GraphQL or resources hosted on Alpaca, you must
GeoJSON can be easily integrated into the maps API via the
call on a map instance.
1map.data.loadGeoJson( 2 "https://mapping.withalpaca.travel/v1/itinerary/XXX.geojson?accessToken=YOUR_ACCESS_TOKEN" 3);
Note: You will need to update the above URL with the correct itinerary id and accessToken.