JavaScript 3.0 API-体面的配色方案 [英] Here JavaScript 3.0 API - decent color scheme
问题描述
我正在将此处地图"作为全屏交互式背景添加到网站. 现在,我正在寻找一种将配色方案更改为更微妙的方案.
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.
我知道有Map Tile API-但我真的想让地图具有交互性,而不仅仅是图像. 我认为使用API 2.5可以实现灰色配色方案?
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?
此刻,我只是更改CSS的不透明度,但这并不是最佳选择,因为它还会使(zoom,...)之类的按钮不可见.
In moment I just change the CSS opacity but this isn't optimal, because it also makes the buttons like (zoom, ...) less visible.
推荐答案
JS API在后台无缝连接到Map Tile API,实际上,默认图层(通过调用platform.createDefaultLayers()获取)正是这样:他们使用Map Tile API.如果您不想使用提供的任何默认设置,则可以创建一个指向任何可用地图方案的自定义地图图块层:
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类说明 http://developer.here.com /javascript-apis/documentation/v3/maps/topics_api_nlp/h-service-maptileservice.html
MapTileService class description http://developer.here.com/javascript-apis/documentation/v3/maps/topics_api_nlp/h-service-maptileservice.html
Map Tile API上可用的方案 http://developer.here .com/rest-apis/documentation/enterprise-map-tile/topics/resource-map-tile.html
Available schemes on the Map Tile API http://developer.here.com/rest-apis/documentation/enterprise-map-tile/topics/resource-map-tile.html
这篇关于JavaScript 3.0 API-体面的配色方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!