问题
I'm adding a Here Map as fullscreen interactive background to a website. Now I'm searching for a way to change the color scheme to a more subtile one.
I know there is the Map Tile API - but I really want to have the map interactive, not just an image. I think with API 2.5 there was a way for a grey color scheme?
In moment I just change the CSS opacity but this isn't optimal, because it also makes the buttons like (zoom, ...) less visible.
回答1:
The JS API connects pretty seamlessly to the Map Tile API in the background and in fact the default layers (retrieved by a call to platform.createDefaultLayers()) do exactly that: they use the Map Tile API. If you don't want to use any of the default ones provided you can create a custom map tile layer pointing to any of the available map schemes:
//Step 1: initialize communication with the platform
var platform = new H.service.Platform({
app_id: 'DemoAppId01082013GAL',
app_code: 'AJKnXv84fjrb0KIHawS0Tg',
useCIT: true
});
//Instead of using the default layers...
//var defaultLayers = platform.createDefaultLayers();
//...create your own layer (with e.g. the "reduced" scheme
var reduced = platform.getMapTileService({
type: 'base'
}).createTileLayer("maptile", "reduced.day", 256, "png8");
//Step 2: initialize a map using your custom map tile layer
var map = new H.Map(document.getElementById('mapp'), reduced, {
center: {
lat: 52.3,
lng: 13.8
},
zoom: 10
});
//Step 3: make the map interactive
var behavior = new H.mapevents.Behavior(new H.mapevents.MapEvents(map));
Here are some links that may be useful for your quest:
MapTileService class description http://developer.here.com/javascript-apis/documentation/v3/maps/topics_api_nlp/h-service-maptileservice.html
Available schemes on the Map Tile API http://developer.here.com/rest-apis/documentation/enterprise-map-tile/topics/resource-map-tile.html
来源:https://stackoverflow.com/questions/26604660/here-javascript-3-0-api-decent-color-scheme