@maptrip/map-tiles 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -68,6 +68,7 @@ L.map("map", {
68
68
 
69
69
  - `token`: A valid and non-expired token for your account, see section _Authorization_ (**required**)
70
70
  - `attribution`: The copyright notes to show in the map
71
+ - `releaseDate`: Boolean value stating whether to append the map release data to the attribution; default is false.
71
72
  - `minZoom`: The minimum zoom level for the map (must not be smaller than 2)
72
73
  - `maxZoom`: The maximum zoom level for the map (must not be larger than 18)
73
74
 
@@ -108,6 +109,8 @@ new Map({
108
109
  `MapTripOpenLayersSource` can be configured with all properties listed in the section _Properties_, and also with these:
109
110
 
110
111
  - `token`: A valid and non-expired token for your account, see section _Authorization_ (**required**)
112
+ - `attribution`: The copyright notes to show in the map
113
+ - `releaseDate`: Boolean value stating whether to append the map release data to the attribution; default is false.
111
114
 
112
115
  ### Google Maps
113
116
 
@@ -274,6 +277,8 @@ To use them, you mapping API has to be able to use both base layers and overlays
274
277
 
275
278
  ## History
276
279
 
280
+ - 1.3.0: Added map release data for Leaflet and OpenLayers map attributions
281
+ - 1.2.1: Fixed a bug in MapTripLeafletGridLayer type implementation
277
282
  - 1.2.0: Added TypeScript declaration file
278
283
  - 1.1.1: Added rendering config for foot_path layer
279
284
  - 1.1.0: Added MapTrip detour profiles
@@ -1,4 +1,4 @@
1
- import { PointXY, RENDERING_CONFIG } from '../../types/interfaces.js';
1
+ import { RENDERING_CONFIG, PointXY } from '../../types/interfaces.js';
2
2
  import { VectorTileFactory } from '../../core/VectorTileFactory.js';
3
3
 
4
4
  declare class MapTripGoogleMapType {
@@ -1,4 +1,36 @@
1
+ import { PointXY, RENDERING_CONFIG } from '../../types/interfaces.js';
2
+ import { MapReleaseFetcher } from '../../util/MapReleaseFetcher.js';
3
+ import { VectorTileFactory } from '../../core/VectorTileFactory.js';
1
4
  import { default as L } from 'leaflet';
2
5
 
3
- declare const MapTripLeafletGridLayer: (new (...args: any[]) => any) & typeof L.Class;
6
+ declare class MapTripLeafletGridLayer extends L.GridLayer {
7
+ MIN_ZOOM: number;
8
+ MAX_ZOOM: number;
9
+ token: string;
10
+ factory: VectorTileFactory;
11
+ releaseFetcher: MapReleaseFetcher;
12
+ provider: string;
13
+ attribution: string;
14
+ release: string;
15
+ releaseDate: boolean;
16
+ constructor(options: {
17
+ provider?: string;
18
+ baseMap?: boolean;
19
+ traffic?: boolean;
20
+ timeout?: number;
21
+ parallelDownloads?: number;
22
+ detourProfile?: string;
23
+ renderingConfig?: RENDERING_CONFIG;
24
+ token?: string;
25
+ attribution?: string;
26
+ minZoom?: number;
27
+ maxZoom?: number;
28
+ releaseDate?: boolean;
29
+ });
30
+ createTile(coords: PointXY): HTMLCanvasElement;
31
+ private initializeAttribution;
32
+ private setRelease;
33
+ private setAttribution;
34
+ private onBaseLayerChange;
35
+ }
4
36
  export { MapTripLeafletGridLayer };
@@ -1,3 +1,4 @@
1
+ import { MapReleaseFetcher } from '../../main.js';
1
2
  import { RENDERING_CONFIG } from '../../types/interfaces.js';
2
3
  import { VectorTileFactory } from '../../core/VectorTileFactory.js';
3
4
  import { default as XYZ } from 'ol/source/XYZ.js';
@@ -5,6 +6,9 @@ import { default as XYZ } from 'ol/source/XYZ.js';
5
6
  declare class MapTripOpenLayersSource extends XYZ {
6
7
  token: string;
7
8
  factory: VectorTileFactory;
9
+ release: string;
10
+ releaseFetcher: MapReleaseFetcher;
11
+ releaseDate: boolean;
8
12
  constructor(properties: {
9
13
  provider?: string;
10
14
  baseMap?: boolean;
@@ -14,6 +18,9 @@ declare class MapTripOpenLayersSource extends XYZ {
14
18
  detourProfile?: string;
15
19
  renderingConfig?: RENDERING_CONFIG;
16
20
  token?: string;
21
+ releaseDate?: boolean;
17
22
  });
23
+ private fetchAndSetAttribution;
24
+ private updateAttribution;
18
25
  }
19
26
  export { MapTripOpenLayersSource };
@@ -1,4 +1,4 @@
1
- import { RENDERING_CONFIG, SuccessCallback, MapTilesProperties } from '../types/interfaces.js';
1
+ import { SuccessCallback, MapTilesProperties, RENDERING_CONFIG } from '../types/interfaces.js';
2
2
 
3
3
  /**
4
4
  * Creates a factory to create tiles from the provided URL templates.
@@ -1,4 +1,4 @@
1
- import { Boundaries, PointXY, PolygonStyle, PolylineStyle, PolylineTextStyle, PositionXY, RENDERING_CONFIG, Renderer, Vertex } from '../types/interfaces.js';
1
+ import { Boundaries, PointXY, PolygonStyle, PolylineStyle, PolylineTextStyle, PositionXY, Renderer, Vertex, RENDERING_CONFIG } from '../types/interfaces.js';
2
2
  import { CollisionDetector } from './CollisionDetector.js';
3
3
  import { GeoJsonProperties } from 'geojson';
4
4
 
@@ -21,6 +21,7 @@ declare const RENDERING_CONFIG_GRAYSCALE: {
21
21
  residential_road: string;
22
22
  residential_road_oneway: string;
23
23
  residential_road_oneway_rev: string;
24
+ foot_path: string;
24
25
  ferry: string;
25
26
  rail: string;
26
27
  capital: string;
@@ -483,6 +484,22 @@ declare const RENDERING_CONFIG_GRAYSCALE: {
483
484
  size: number;
484
485
  color: string;
485
486
  font: string;
487
+ outlineColor: string;
488
+ outlineWidth: number;
489
+ };
490
+ } | {
491
+ from: number;
492
+ to: number;
493
+ line: {
494
+ width: number;
495
+ color: string;
496
+ };
497
+ text: {
498
+ size: number;
499
+ color: string;
500
+ font: string;
501
+ outlineColor?: undefined;
502
+ outlineWidth?: undefined;
486
503
  };
487
504
  } | {
488
505
  from: number;
@@ -586,6 +603,23 @@ declare const RENDERING_CONFIG_GRAYSCALE: {
586
603
  outlineWidth: number;
587
604
  };
588
605
  })[];
606
+ foot_path: {
607
+ from: number;
608
+ to: number;
609
+ line: {
610
+ width: number;
611
+ color: string;
612
+ dashColor: string;
613
+ dashLength: number;
614
+ };
615
+ text: {
616
+ size: number;
617
+ color: string;
618
+ font: string;
619
+ outlineColor: string;
620
+ outlineWidth: number;
621
+ };
622
+ }[];
589
623
  rail: {
590
624
  from: number;
591
625
  to: number;
@@ -1,9 +1,10 @@
1
1
  import { MapTripOpenLayersSource } from './api-extensions/openlayers/MapTripOpenLayersSource.js';
2
2
  import { MapTripLeafletGridLayer } from './api-extensions/leaflet/MapTripLeafletGridLayer.js';
3
3
  import { MapTripGoogleMapType } from './api-extensions/google/MapTripGoogleMapType.js';
4
+ import { MapReleaseFetcher } from './util/MapReleaseFetcher.js';
4
5
  import { RENDERING_CONFIG_TRAFFIC } from './core/rendering_config_traffic.js';
5
6
  import { RENDERING_CONFIG_GRAYSCALE } from './core/rendering_config_grayscale.js';
6
7
  import { RENDERING_CONFIG_DEFAULT } from './core/rendering_config_default.js';
7
8
  import { VectorTileFactory } from './core/VectorTileFactory.js';
8
- import type * as types from "./types/interfaces.js";
9
- export { VectorTileFactory, RENDERING_CONFIG_DEFAULT, RENDERING_CONFIG_GRAYSCALE, RENDERING_CONFIG_TRAFFIC, MapTripLeafletGridLayer, MapTripGoogleMapType, MapTripOpenLayersSource, types, };
9
+
10
+ export { VectorTileFactory, RENDERING_CONFIG_DEFAULT, RENDERING_CONFIG_GRAYSCALE, RENDERING_CONFIG_TRAFFIC, MapReleaseFetcher, MapTripLeafletGridLayer, MapTripGoogleMapType, MapTripOpenLayersSource, };