Options
All
  • Public
  • Public/Protected
  • All
Menu

destination.maps API 1.0.1

This d.maps API currently uses Mapbox GL JS API in order to show destination.one content on a map based on vector tiles.

Interfaces to Mapbox/Leaflet Javascript API's (for raster tiles) are available, but not yet implemented.

Currently there is no release plan for this feature.

Changelog

Version 1.0.0

  • initial version

Version 1.0.1 (2019-09-02)

  • Sharpened d.meta layer icons (2x pixel ratio)
  • Fixed a visiblity bug with custom map popup's
  • Removed fullscreen control, if using iOS devices
  • Tour lazy loading is now using the d.meta light schema
  • Integrated the destination.one logo
  • Upgraded Typescript, Babel, Rollup and other packages for better browser support
  • Fixed a bug, which sometimes made meta map marker invisible at deeper zoom levels
  • d.maps-API can use MapboxGL-JS Version 1.2.1 now (URLs are in the example below)
  • It is possible to use the IMap.showContent with d.meta result data. (previously it was only possible to provide a d.meta request)
  • addLocationMarker method => adding location marker at coordinate (looks like geolocate maker)
  • New map options added:
    • fullscreenControl: false => hide fullscreen control
    • geolocateControl: false => hide geolocate control
    • styleControl: true => hide style changer control
    • style: id of the inital map style
    • oneFingerPan: false => one finger panning will be disabled and an overlay will be shown

Getting started

Use Done.Maps.newMap in order to create a new map.

Versions

All versions currently need the Mapbox GL JS API:

Please have a look at https://github.com/mapbox/mapbox-gl-js/releases for current releases.

Standard Version (JSON)

The standard version uses JSON in order to fetch data from the destination.meta service.

Version: 1.0.1

Protobuf Version (PB)

The protobuf version needs an additional protobuf javascript library in oder to run.

Please have a look at https://github.com/dcodeio/protobuf.js for futher details.

Protobuf-Version: 1.0.1

Examples

Standard API

<!-- Mapbox GL JS API -->
<link rel="stylesheet" href="https://api.maps.destination.one/lib/mapbox-gl-js/v1.2.1/mapbox-gl.css">
<script src="https://api.maps.destination.one/lib/mapbox-gl-js/v1.2.1/mapbox-gl.js"></script>

<!-- destination.maps API -->
<link rel="stylesheet" href="https://api.maps.destination.one/v1.0.1/d-maps.css">
<script src="https://api.maps.destination.one/v1.0.1/d-maps.js"></script>

<script>
var mapOptions = {
    container: "my-map",
    center: { lon: 13.0, lat: 49.2 },
    zoom: 12
};
if (Done.Maps.isSupported()) {
    var map = Done.Maps.newMap(mapOptions);
    map.on('load', function (event) {
        ...
    });
}
</script>

Protobuf API

  ...
<!-- minimal Protobuf library -->
<script src="https://api.maps.destination.one/lib/protobuf/v6.8.8/protobuf.min.js"></script>

<!-- destination.maps API for Protobuf -->
<link rel="stylesheet" href="https://api.maps.destination.one/v1.0.1/d-maps.css">
<script src="https://api.maps.destination.one/v1.0.1/d-maps.pb.js"></script>
  ...
<script>
var mapOptions = {
  ...

LOC

$ sloc src/ -e et2014a

Lines of code without auto-generated et2014a files:

            Physical :  4307
              Source :  2825
             Comment :  957
 Single-line comment :  76
       Block comment :  881
               Mixed :  19
 Empty block comment :  0
               Empty :  544
               To Do :  26

Number of files read :  81

Index

Enumerations

Classes

Interfaces

Type aliases

Type aliases

TEventType

TEventType: keyof IMapEvents

All available events can be found at IMapEvents

TEventTypeListener

TEventTypeListener<TYPE>: function

All available events can be found at IMapEvents

Type parameters

Type declaration

    • (event: IMapEvents[TYPE]): void
    • Parameters

      • event: IMapEvents[TYPE]

      Returns void

TLayerData

TLayerData: Feature<GeoJSON.Geometry, TLayerProperties> | FeatureCollection<GeoJSON.Geometry, TLayerProperties>

Layer data as GeoJSON (Feauture or FeatureCollection)

TLayerProperties

TLayerProperties: object | null

Custom layer data, if needed

TLayerType

TLayerType: "meta" | "line" | "symbol"

Currently supported layer types

TMetaAddressRel

TMetaAddressRel: "author" | "organisation" | "support" | "contact_person" | "organizer" | "lessor"

TMetaGeometryType

TMetaGeometryType: "wkt" | "linestring"

TMetaItemType

TMetaItemType: "Hotel" | "Event" | "Gastro" | "Tour" | "POI" | "City" | "Area" | "Package" | "Article"

TMetaMediaObjectRatio

TMetaMediaObjectRatio: "" | "3:2" | "4:3" | "16:9"

TMetaMediaObjectRel

TMetaMediaObjectRel: "default" | "gallery" | "download" | "video" | "audio" | "qrcode" | "booking" | "socialmedia" | "rating" | "barrierfree" | "print" | "summer" | "winter" | "mobile" | "pages" | "homepage" | "other"

TMetaRequestType

TMetaRequestType: "All" | "Hotel" | "Event" | "Gastro" | "Tour" | "POI" | "City" | "Area" | "Package" | "Article"

TMetaStatusType

TMetaStatusType: "OK" | "INVALID_LICENSE" | "INVALID_EXPERIENCE" | "INVALID_REQUEST" | "SERVER_ERROR"

TMetaTextRel

TMetaTextRel: "teaser" | "destination" | "date" | "dayoff" | "directions" | "barrierfree" | "long" | "short" | "highlight" | "insidertip" | "openinghours" | "equipment" | "roominfo" | "pricerange" | "classification" | "convention" | "games" | "styles" | "meals" | "mealsavail" | "paymentinfo" | "clubinfo" | "guestinfo" | "cinemainfo" | "program" | "parking" | "rentalcar" | "schedule" | "additional" | "details" | "kitchen"

TMetaTextType

TMetaTextType: "text/html" | "text/plain"

TPersistType

TPersistType: "persist" | "saved" | "none"

Flag which indicates, if the Layer should be or is saved in the Layer-Cache.

TPopupAnchor

TPopupAnchor: "center" | "left" | "right" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right"