Shadowdata Map添加天地图影像地图服务

'use strict';

/*global require*/
var WebMapTileServiceCatalogItem = require('../Models/WebMapTileServiceCatalogItem');
var BaseMapViewModel = require('./BaseMapViewModel');
var CompositeCatalogItem = require('../Models/CompositeCatalogItem');
var UrlTemplateCatalogItem = require('../Models/UrlTemplateCatalogItem');

var createTiandituBaseMapOptions = function(terria) {
    var result = [];

    const tiandituImage = new UrlTemplateCatalogItem(terria);
    tiandituImage.name = '天地图影像';
    tiandituImage.url = 'http://t1.tianditu.gov.cn/img_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=f9ffe7d68026044b2f284a5fd62f4aad';
    tiandituImage.opacity = 1.0;

    result.push(new BaseMapViewModel({
        image: require('../../wwwroot/images/tianditu-img.png'),
        catalogItem: tiandituImage
    }));
    
    const tiandituCia = new UrlTemplateCatalogItem(terria);
    tiandituCia.name = '天地图影像注记';
    tiandituCia.url = 'http://t1.tianditu.gov.cn/cia_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cia&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=f9ffe7d68026044b2f284a5fd62f4aad';
    tiandituCia.opacity = 1.0;
    var items = [tiandituImage,tiandituCia];
    const composite = new CompositeCatalogItem(terria,items);
    composite.name = '天地图影像(带注记)';
    
    result.push(new BaseMapViewModel({
        image: require('../../wwwroot/images/tianditu-cia.png'),
        catalogItem: composite
    }));
    
    const tiandituVec = new UrlTemplateCatalogItem(terria);
    tiandituVec.name = '天地图矢量';
    tiandituVec.url = 'http://t1.tianditu.gov.cn/vec_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=vec&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=f9ffe7d68026044b2f284a5fd62f4aad';
    tiandituVec.opacity = 1.0;
    
    const tiandituCva = new UrlTemplateCatalogItem(terria);
    tiandituCva.name = '矢量注记';
    tiandituCva.url = 'http://t1.tianditu.gov.cn/cva_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cva&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=f9ffe7d68026044b2f284a5fd62f4aad';
    tiandituCva.opacity = 1.0;
    var items1 = [tiandituVec,tiandituCva];
    const composite1 = new CompositeCatalogItem(terria,items1);
    composite1.name = '天地图矢量(带注记)';

    result.push(new BaseMapViewModel({
        image: require('../../wwwroot/images/tianditu-vec.png'),
        catalogItem: composite1,
        contrastColor: '#000000'
    }));
    
    const googleMap = new UrlTemplateCatalogItem(terria);
    googleMap.name = '谷歌影像';
    googleMap.url = 'http://mt0.google.cn/vt/lyrs=s&hl=zh-CN&x={x}&y={y}&z={z}';
    googleMap.opacity = 1.0;
    
    result.push(new BaseMapViewModel({
        image: require('../../wwwroot/images/googlemap.png'),
        catalogItem: googleMap
    }));
    
    return result;
};

module.exports = createTiandituBaseMapOptions;

你可能感兴趣的:(Shadowdata Map添加天地图影像地图服务)