我想添加这里通过BruTile/SharpMap将地图贴图映射到我的地图。如何在BruTile/SharpMap中将地图添加到拼贴图层?
的URL方案是以下通过他们的文档:
https://1.base.maps.cit.api.here.com/maptile/2.1/maptile/newest/normal.day/13/4400/2686/256/png8
APP_ID = {YOUR_APP_ID}
&的app_code = {YOUR_APP_CODE}
其中13是缩放级别,4400是列,2686是行。
这是我的代码,但超时了,地图是空的。应用程序ID和应用程序代码是正确的,它是100%确定的。可能是什么问题?
var networkRes = Networking.HasInternetConnection();
if (networkRes.Result == false)
throw new Exception(networkRes.InfoMessage);
var uriString = "https://1.base.maps.cit.api.here.com/maptile/2.1/maptile/newest/normal.day/{z}/{x}/{y}/256/png8";
var customParams = new Dictionary<string, string>();
customParams.Add("app_id", "someappid");
customParams.Add("app_code", "someappcode");
var req = new TmsRequest(new Uri(uriString),"png" , customParams);
var provider = new WebTileProvider(req);
var tileSource = new TileSource(provider, new SphericalMercatorInvertedWorldSchema());
TileLayer tileLayer;
if (CacheWebMaps)
{
var path = Path.Combine(MapCacheRoot, HEREBASELAYERNAME);
tileLayer = new TileLayer(tileSource, HEREBASELAYERNAME, new Color(), true, path);
}
else
{
tileLayer = new TileLayer(tileSource, HEREBASELAYERNAME);
}
tileLayer.SRID = 3857;
MapBox.Map.Layers.Add(tileLayer);
在此先感谢!
您是否将其基于文档?如果是这样,哪个? – pauldendulk
我使用了这个文档:https://developer.here.com/rest-apis/documentation/enterprise-map-tile/topics/example-normal-day-view.html和我的代码,我已经成功地实现了几个瓷砖来源(osm的,MapQuest的,自定义的等),但我不能让这里地图工作 – Tom
[这里](https://1.base.maps.cit.api.here.com/maptile/2.1/maptile/newest/ normal.day/13/4400/2686/256/png8?app_id=xWVIueSv6JL0aJ5xqTxb&app_code=djPZyynKsbTjIUDOBcHZ2g)是您在顶部发布的具有Here地图网站的应用ID和应用代码的网址。它是否也会在浏览器中显示您的应用程序ID和代码? – pauldendulk