@mapcatch/util 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -0
- package/dist/catchUtil.min.esm.js +3184 -3183
- package/dist/catchUtil.min.js +13 -13
- package/package.json +1 -1
- package/src/exif/parse_image.js +2 -2
- package/src/util.js +3 -3
package/package.json
CHANGED
package/src/exif/parse_image.js
CHANGED
|
@@ -20,7 +20,7 @@ export const getData = function (img, callback) {
|
|
|
20
20
|
getImageData(img, callback);
|
|
21
21
|
} else {
|
|
22
22
|
if (callback) {
|
|
23
|
-
callback
|
|
23
|
+
callback(img);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
return true;
|
|
@@ -38,7 +38,7 @@ function getImageData(img, callback) {
|
|
|
38
38
|
img.xmpdata = xmpdata || {};
|
|
39
39
|
}
|
|
40
40
|
if (callback) {
|
|
41
|
-
callback
|
|
41
|
+
callback(img);
|
|
42
42
|
}
|
|
43
43
|
} catch (err) {
|
|
44
44
|
callback(null, err)
|
package/src/util.js
CHANGED
|
@@ -311,13 +311,13 @@ export function getLineLabelFeature(lineFeature) {
|
|
|
311
311
|
midPoint.geometry.coordinates.push(((labelLine[0][2] || 0) + (labelLine[1][2] || 0)) / 2)
|
|
312
312
|
return midPoint
|
|
313
313
|
}
|
|
314
|
-
export function project(lngLat) { // 经纬度转墨卡托像素坐标
|
|
314
|
+
export function project(lngLat, zoom=12) { // 经纬度转墨卡托像素坐标
|
|
315
315
|
let [lng, lat] = lngLat
|
|
316
316
|
let x = (180 + lng) / 360
|
|
317
317
|
let y = (180 - (180 / Math.PI) * Math.log(Math.tan(Math.PI / 4 + (lat * Math.PI) / 360))) / 360
|
|
318
318
|
return {
|
|
319
|
-
x: x * Math.pow(2,
|
|
320
|
-
y: y * Math.pow(2,
|
|
319
|
+
x: x * Math.pow(2, zoom) * 512,
|
|
320
|
+
y: y * Math.pow(2, zoom) * 512
|
|
321
321
|
}
|
|
322
322
|
}
|
|
323
323
|
export function addIcons2Map (map, icons) {
|