@maptrip/map-tiles 1.0.8 → 1.1.1

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
@@ -47,10 +47,10 @@ Install [LeafletJS](https://leafletjs.com/) with `npm install leaflet@~1.9.x`. T
47
47
  you create an instance of `MapTripLeafletGridLayer` and add it to the layers of a map:
48
48
 
49
49
  ```js
50
- import { MapTripLeafletGridLayer } from "dist/map-tiles.js";
50
+ import { MapTripLeafletGridLayer } from "@maptrip/map-tiles";
51
51
 
52
- import L from 'leaflet';
53
- import 'leaflet/dist/leaflet.css';
52
+ import L from "leaflet";
53
+ import "leaflet/dist/leaflet.css";
54
54
 
55
55
  const layer = new MapTripLeafletGridLayer({
56
56
  provider: "TomTom",
@@ -79,7 +79,7 @@ Install [OpenLayers](https://openlayers.org/) with `npm install ol@~8.2.x`. To c
79
79
  and MapTrip map tiles, you create an instance of `MapTripOpenLayersSource` and add it to the layers of a map:
80
80
 
81
81
  ```js
82
- import { MapTripOpenLayersSource } from "dist/map-tiles.js";
82
+ import { MapTripOpenLayersSource } from "@maptrip/map-tiles";
83
83
 
84
84
  import Map from "ol/Map.js";
85
85
  import View from "ol/View.js";
@@ -117,7 +117,7 @@ Install the [Google Maps JavaScript API](https://developers.google.com/maps/docu
117
117
  JS loader with `npm install @googlemaps/js-api-loader@~1.16.x`.
118
118
 
119
119
  ```js
120
- import { MapTripGoogleMapType } from "dist/map-tiles.js";
120
+ import { MapTripGoogleMapType } from "@maptrip/map-tiles";
121
121
  import { Loader } from "@googlemaps/js-api-loader";
122
122
 
123
123
  new Loader({
@@ -160,6 +160,8 @@ This function will be called with the x, y and z indexes of all tiles. To create
160
160
  you can use our factory class. This is initialized with the map provider you want to use:
161
161
 
162
162
  ```js
163
+ import { VectorTileFactory } from "@maptrip/map-tiles";
164
+
163
165
  const factory = VectorTileFactory.createFactory({ provider: "TomTom" });
164
166
  ```
165
167
 
@@ -193,6 +195,37 @@ const factory = VectorTileFactory.createFactory({
193
195
  Which data you are allowed to use depends on your MapTrip license.
194
196
  If in doubt, please contact our [support team](mailto:support@infoware.de).
195
197
 
198
+ ## MapTrip Detour Profiles
199
+
200
+ You can use the [MapTrip Detour Editor](https://editor.maptrip.de/detour/) to create your own profiles that change the map data. For example, you can block or prioritize roads and even delete or add new roads.
201
+
202
+ Deleting or adding new roads affect the map when you specify your profile: Deleted roads are no longer visible and newly created roads are shown in the map.
203
+
204
+ Use the endpoint `GET /detour/file/all` of the [MapTrip Server API](https://api.maptrip.de/) to query the profile string of all your Detour files created in the editor or with the API.
205
+
206
+ Let's assume the response looks like this:
207
+
208
+ ```json
209
+ [
210
+ {
211
+ "id": 12345,
212
+ "name": "My Detour File",
213
+ "version": 10,
214
+ "profile": "olrclient_MapTrip_xxxxx_56789_My Detour File"
215
+ }
216
+ ]
217
+ ```
218
+
219
+ In this case you have to provide the profile `olrclient_MapTrip_xxxxx_56789_My Detour File` to show it in the map:
220
+
221
+ ```js
222
+ const layer = new MapTripLeafletGridLayer({
223
+ provider: "TomTom",
224
+ detourProfile: "olrclient_MapTrip_xxxxx_56789_My Detour File",
225
+ token: "Insert your MapTrip token here",
226
+ });
227
+ ```
228
+
196
229
  ## Properties
197
230
 
198
231
  You can specify a third parameter with properties when creating the factory. These values are available:
@@ -204,6 +237,7 @@ You can specify a third parameter with properties when creating the factory. The
204
237
  | traffic | Add traffic flows to the map tiles (only available for TomTom and HERE maps) | false |
205
238
  | timeout | Load timeout for tiles in milliseconds. Increase this if you have a very slow internet connection | 5000 |
206
239
  | parallelDownloads | The number of tiles that are loaded in parallel | 12 |
240
+ | detourProfile | The name of a MapTrip Detour Profile, see _MapTrip Detour_ | |
207
241
  | renderingConfig | Set a custom rendering configuration to customize layers, colors, line widths etc. | RENDERING_CONFIG_DEFAULT |
208
242
 
209
243
  This factory initializes a factory with TomTom data and traffic flows:
@@ -237,3 +271,9 @@ const factory = VectorTileFactory.createFactory({
237
271
 
238
272
  It will create tiles which have a transparent background and semi-transparent traffic flows.
239
273
  To use them, you mapping API has to be able to use both base layers and overlays.
274
+
275
+ ## History
276
+
277
+ - 1.1.1: Added rendering config for foot_path layer
278
+ - 1.1.0: Added MapTrip detour profiles
279
+ - 1.0.8: First public version