日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > php >内容正文

php

php矢量瓦片,矢量瓦片相关计算函数

發布時間:2023/12/15 php 39 豆豆
生活随笔 收集整理的這篇文章主要介紹了 php矢量瓦片,矢量瓦片相关计算函数 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

import turf from 'turf'

export default {

TILE_SIZE: 256,

/*

* 獲取指定級別的瓦片數目

*/

_getMapSize(level) {

return Math.pow(2, level);

},

/**

* Convert a longitude coordinate (in degrees) to the tile X number at a

* certain zoom level.經度轉瓦片列號

* @param longitude

* the longitude coordinate that should be converted.

* @param zoom

* the zoom level at which the coordinate should be converted.

* @return the tile X number of the longitude value.

*/

longitudeToTileX(longitude, zoom) {

let px = this.longitudeToPixelX(longitude, zoom);

return this.pixelXToTileX(px, zoom);

},

/**

* Convert a latitude coordinate (in degrees) to a tile Y number at a

* certain zoom level.緯度轉瓦片行號

* @param latitude

* the latitude coordinate that should be converted.

* @param zoom

* the zoom level at which the coordinate should be converted.

* @return the tile Y number of the latitude value.

*/

latitudeToTileY(latitude, zoom) {

let py = this.latitudeToPixelY(latitude, zoom);

return this.pixelYToTileY(py, zoom);

},

/**

* Convert a latitude coordinate (in degrees) to a pixel Y coordinate at a

* certain zoom level.經緯度坐標(緯度)轉屏幕像素坐標(Y)

*

* @param latitude

* the latitude coordinate that should be converted.

* @param zoom

* the zoom level at which the coordinate should be converted.

* @return the pixel Y coordinate of the latitude value.

*/

latitudeToPixelY(latitude, zoom) {

let sinLatitude = Math.sin(latitude * Math.PI / 180);

return (0.5 - Math.log((1 + sinLatitude) / (1 - sinLatitude)) / (4 * Math.PI)) * (this.TILE_SIZE << zoom);

},

/**

* Convert a longitude coordinate (in degrees) to a pixel X coordinate at a

* certain zoom level.經緯度坐標(經度)轉屏幕像素坐標(X)

*

* @param longitude

* the longitude coordinate that should be converted.

* @param zoom

* the zoom level at which the coordinate should be converted.

* @return the pixel X coordinate of the longitude value.

*/

longitudeToPixelX(longitude, zoom) {

return (longitude + 180) / 360 * (this.TILE_SIZE << zoom);

},

/*

* 指定級別下,將宏觀上的經度轉換為對應列上的瓦片的像素矩陣列號(微觀)

例如:鼠標點擊地圖,鼠標位置在點擊的瓦片內的行列號(即使像素行列號)。根據該瓦片(png)和計算出的行列號,即可取得鼠標點擊位置的像素值。

*/

_lngToPixelX(longitude, level) {

let x = (longitude + 180) / 360;

let pixelX = Math.floor(x * this._getMapSize(level) * 256 % 256);

return pixelX;

},

/*

* 指定級別緯度對應的像素行號

*/

_latToPixelY(latitude, level) {

let sinLatitude = Math.sin(latitude * Math.PI / 180);

let y = 0.5 - Math.log((1 + sinLatitude) / (1 - sinLatitude)) / (4 * Math.PI);

let pixelY = Math.floor(y * this._getMapSize(level) * 256 % 256);

return pixelY;

},

/**

* Convert a pixel X coordinate to the tile X number.

* 像素坐標X轉瓦片行列號X

* @param pixelX

* the pixel X coordinate that should be converted.

* @param zoom

* the zoom level at which the coordinate should be converted.

* @return the tile X number.

*/

pixelXToTileX(pixelX, zoom) {

return Math.floor(Math.min(Math.max(pixelX / this.TILE_SIZE, 0), Math.pow(2, zoom) - 1));

},

/**

* Converts a pixel Y coordinate to the tile Y number.

* 像素坐標Y轉瓦片行列號Y

* @param pixelY

* the pixel Y coordinate that should be converted.

* @param zoom

* the zoom level at which the coordinate should be converted.

* @return the tile Y number.

*/

pixelYToTileY(pixelY, zoom) {

return Math.floor(Math.min(Math.max(pixelY / this.TILE_SIZE, 0), Math.pow(2, zoom) - 1));

},

}

總結

以上是生活随笔為你收集整理的php矢量瓦片,矢量瓦片相关计算函数的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 一级黄色片免费在线观看 | 国产高清视频免费 | 99热最新在线 | 亚洲第二色 | 狠狠操一区 | 国产a视频 | 中文视频一区 | 亚洲黄色免费在线观看 | 一卡二卡在线 | av永久在线 | 黄视频在线观看免费 | 欧美久久久久 | 日本不卡网 | 进去里在线观看 | 草久久免费视频 | 色婷婷av一区 | 中文字幕成人av | 欧美成年人视频 | 污视频网站免费在线观看 | 国产日韩欧美中文字幕 | 青青久视频 | 欧美午夜精品一区二区蜜桃 | 黑人大群体交免费视频 | 欧美日韩高清丝袜 | 天天干天天弄 | 亚洲精品v日韩精品 | 九九在线观看视频 | 欧美久久久久 | 亚色91| 精品少妇av | 日本狠狠爱 | 亚洲AV无码成人精品区在线观 | www欧美视频| 午夜黄色剧场 | 黄色一级片免费在线观看 | 国产美女特级嫩嫩嫩bbb | 国模小丫大尺度啪啪人体 | 91国偷自产一区二区三区老熟女 | 欧美精品一二三区 | 欧美色综合网站 | 免费一级suv好看的国产网站 | 欧美xxxx在线| 亚洲精品久久久久中文字幕二区 | 亚洲特黄一级片 | 中文在线字幕免费观 | 日日涩| 被警察猛c猛男男男 | 亚洲国产精品一区二区久久hs | 日日摸夜夜添狠狠添欧美 | 视频日韩 | 免费精品视频 | 91免费观看视频 | 久久久久久久久久久久久久久久久久 | 亚洲调教| 成人毛片观看 | 久操免费在线 | 激烈的性高湖波多野结衣 | 中文字幕不卡在线播放 | sm国产在线调教视频 | 久久r视频 | 久久极品视频 | 18禁男女爽爽爽午夜网站免费 | 日韩一二三区视频 | 超碰蜜臀 | 又污又黄的网站 | 欧美一区自拍 | 一本一道久久a久久综合蜜桃 | av一片 | 日韩欧美一区二区视频 | 国产精品美女久久 | 男女国产精品 | 亚洲人成777 | 欧美一区二区三区激情啪啪 | 国产精品欧美日韩 | 人超碰 | 友田真希一区二区 | 欧美成人a视频 | 制服丝袜一区二区三区 | 国产xxxx| xxx日韩| 黄片毛片在线看 | 国产毛片视频 | 蜜桃视频一区二区在线观看 | 青青青手机在线视频 | 亚洲暴爽 | 免费日本特黄 | 大尺度av | 亚洲综合丁香 | 草久久久 | 欧美日韩少妇 | 99人妻碰碰碰久久久久禁片 | 国产无码精品一区二区 | 国产大片av| 黄色国产在线视频 | 欧美 日韩 国产 激情 | 国产又色又爽又黄 | 91av视频网 | a级黄毛片 | 欧美sm极限捆绑bd |