1L.TileLayer.ChinaProvider = L.TileLayer.extend({ 2 3 initialize: function(type, options) { // (type, Object) 4 var providers = L.TileLayer.ChinaProvider.providers; 5 6 var parts = type.split('.'); 7 8 var providerName = parts[0]; 9 var mapName = parts[1]; 10 var mapType = parts[2]; 11 12 var url = providers[providerName][mapName][mapType]; 13 options.subdomains = providers[providerName].Subdomains; 14 options.key = options.key || providers[providerName].key; 15 L.TileLayer.prototype.initialize.call(this, url, options); 16 } 17}); 18 19L.TileLayer.ChinaProvider.providers = { 20 TianDiTu: { 21 Normal: { 22 Map: "http://t{s}.tianditu.com/DataServer?T=vec_w&X={x}&Y={y}&L={z}&tk={key}", 23 Annotion: "http://t{s}.tianditu.com/DataServer?T=cva_w&X={x}&Y={y}&L={z}&tk={key}" 24 }, 25 Satellite: { 26 Map: "http://t{s}.tianditu.com/DataServer?T=img_w&X={x}&Y={y}&L={z}&tk={key}", 27 Annotion: "http://t{s}.tianditu.com/DataServer?T=cia_w&X={x}&Y={y}&L={z}&tk={key}" 28 }, 29 Terrain: { 30 Map: "http://t{s}.tianditu.com/DataServer?T=ter_w&X={x}&Y={y}&L={z}&tk={key}", 31 Annotion: "http://t{s}.tianditu.com/DataServer?T=cta_w&X={x}&Y={y}&L={z}&tk={key}" 32 }, 33 Subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'], 34 key: "174705aebfe31b79b3587279e211cb9a" 35 }, 36 37 GaoDe: { 38 Normal: { 39 Map: 'http://webrd0{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}' 40 }, 41 Satellite: { 42 Map: 'http://webst0{s}.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}', 43 Annotion: 'http://webst0{s}.is.autonavi.com/appmaptile?style=8&x={x}&y={y}&z={z}' 44 }, 45 Subdomains: ["1", "2", "3", "4"] 46 }, 47 48 Google: { 49 Normal: { 50 Map: "http://www.google.cn/maps/vt?lyrs=m@189&gl=cn&x={x}&y={y}&z={z}" 51 }, 52 Satellite: { 53 Map: "http://www.google.cn/maps/vt?lyrs=s@189&gl=cn&x={x}&y={y}&z={z}" 54 }, 55 Subdomains: [] 56 }, 57 58 Geoq: { 59 Normal: { 60 Map: "http://map.geoq.cn/ArcGIS/rest/services/ChinaOnlineCommunity/MapServer/tile/{z}/{y}/{x}", 61 PurplishBlue: "http://map.geoq.cn/ArcGIS/rest/services/ChinaOnlineStreetPurplishBlue/MapServer/tile/{z}/{y}/{x}", 62 Gray: "http://map.geoq.cn/ArcGIS/rest/services/ChinaOnlineStreetGray/MapServer/tile/{z}/{y}/{x}", 63 Warm: "http://map.geoq.cn/ArcGIS/rest/services/ChinaOnlineStreetWarm/MapServer/tile/{z}/{y}/{x}", 64 }, 65 Theme: { 66 Hydro: "http://thematic.geoq.cn/arcgis/rest/services/ThematicMaps/WorldHydroMap/MapServer/tile/{z}/{y}/{x}" 67 }, 68 Subdomains: [] 69 }, 70 71 OSM: { 72 Normal: { 73 Map: "http://{s}.tile.osm.org/{z}/{x}/{y}.png", 74 }, 75 Subdomains: ['a', 'b', 'c'] 76 } 77 78}; 79 80L.tileLayer.chinaProvider = function(type, options) { 81 return new L.TileLayer.ChinaProvider(type, options); 82};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.