This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var o = { | |
get: function(localImagePath) | |
{ | |
// 本地项目图片上传到远程CDN图片服务器的路径 | |
var imageCDNPrefix = 'http://******.clouddn.com/mp-travel/'; | |
// 使用项目中的图片 or 使用远程CDN服务器 的图片。 | |
var useLocalImage = false; | |
if(useLocalImage) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 本地项目图片上传到远程CDN图片服务器的路径 | |
const imageCDNPrefix = 'http://******.clouddn.com/mp-travel/'; | |
// 使用项目中的图片 or 使用远程CDN服务器 的图片。 | |
const useLocalImage = false; | |
export default class MPImageUtil | |
{ | |
// 获取图片路径 | |
static getImagePath(localImagePath) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 将微信小程序(wepy)源代码目录:src/assets/images 下的所有图片上传到七牛云服务器, | |
* 请修改参数: | |
* 七牛云参数:accessKey,secretKey,bucket | |
* 工程目录参数:imageFolderPath,projectQiNiuFolder | |
* 七牛云文档:https://developer.qiniu.com/kodo/sdk/1289/nodejs | |
*/ | |
let qiniu = require("qiniu"); | |
let fs = require("fs"); | |
let path = require("path"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 由18/19级的左上角/右下角瓦片,推导出20/21级的瓦片编码规则。 | |
* 依赖于[tile-lnglat-transform](https://github.com/CntChen/tile-lnglat-transform) | |
*/ | |
var TileLnglatTransform = require('../builds/index'); | |
var TileLnglatTransformBaidu = TileLnglatTransform.TileLnglatTransformBaidu; | |
// 可以通过百度web地图获取18级的瓦片 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 重命名[`dzt`](https://github.com/dblock/dzt)切的瓦片 | |
*/ | |
let tileDir = "/Users/issuser/Desktop/zhangxd/study/map/tiles/14"; | |
let startX = 388528; | |
let startY = 154424; | |
// 设置Y方向有几张图片(因为dzt的原点在左上角,百度的原点在左下角) | |
let yImageCount = 0; |