Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
micro-customization-system
/
oEshield
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit b2cb5f3b
authored
Feb 14, 2025
by
wangzhihui
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fixed
1 parent
8cf43f19
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
9 deletions
src/utils/mapBgeo.js
src/utils/mapBgeo.js
View file @
b2cb5f3
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: 'wangzhihui' '1733904062@qq.com'
* @Author: 'wangzhihui' '1733904062@qq.com'
* @Date: 2024-11-28 16:37:15
* @Date: 2024-11-28 16:37:15
* @LastEditors: 'wangzhihui' '1733904062@qq.com'
* @LastEditors: 'wangzhihui' '1733904062@qq.com'
* @LastEditTime: 2025-02-1
3 17:17:1
2
* @LastEditTime: 2025-02-1
4 15:00:0
2
* @FilePath: \oEshield\src\utils\mapgeo.js
* @FilePath: \oEshield\src\utils\mapgeo.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
*/
...
@@ -42,7 +42,7 @@ const MAPGEO = {
...
@@ -42,7 +42,7 @@ const MAPGEO = {
}
}
})
})
// console.log(data,'data')
// console.log(data,'data')
Promise
.
race
([
geocoderGetAdr
(
data
),
limitload
()])
//
Promise.race([geocoderGetAdr(data),limitload()])
geocoderGetAdr
(
data
)
geocoderGetAdr
(
data
)
function
fixed6
(
num
)
{
function
fixed6
(
num
)
{
return
Number
(
num
).
toFixed
(
6
);
return
Number
(
num
).
toFixed
(
6
);
...
@@ -70,6 +70,7 @@ const MAPGEO = {
...
@@ -70,6 +70,7 @@ const MAPGEO = {
try
{
try
{
const
o
=
await
AMap
.
invoke
(
'Point'
,
item
.
blng
,
item
.
blat
);
const
o
=
await
AMap
.
invoke
(
'Point'
,
item
.
blng
,
item
.
blat
);
await
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
10
))
await
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
10
))
MAPGEO
.
geocoder
.
getLocation
(
o
,(
res
)
=>
{
MAPGEO
.
geocoder
.
getLocation
(
o
,(
res
)
=>
{
setAddress
(
o
,
res
);
setAddress
(
o
,
res
);
obj
.
totalNum
++
;
obj
.
totalNum
++
;
...
@@ -79,8 +80,24 @@ const MAPGEO = {
...
@@ -79,8 +80,24 @@ const MAPGEO = {
cb
(
data
);
cb
(
data
);
resolve
()
resolve
()
}
}
});
});
// const res=await new Promise((resolve)=>{
// MAPGEO.geocoder.getLocation(o,(res)=>{
// resolve(res)
// });
// })
// console.log(res,obj.totalNum , obj.realNum,obj.totalNum === obj.realNum)
// setAddress(o, res);
// obj.totalNum++;
// // console.log(obj.totalNum , obj.realNum,obj.totalNum === obj.realNum)
// if (obj.totalNum === obj.realNum && typeof cb === 'function') {
// cb(data);
// resolve()
// }
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
error
(
`Error processing item
${
item
}
:`
,
error
);
console
.
error
(
`Error processing item
${
item
}
:`
,
error
);
}
}
...
@@ -90,13 +107,13 @@ const MAPGEO = {
...
@@ -90,13 +107,13 @@ const MAPGEO = {
}
}
function
limitload
(){
function
limitload
(){
let
time
=
(
data
.
length
/
58
)
*
1000
;
// let time=data.length
*1000;
new
Promise
(
resolve
=>
setTimeout
(()
=>
{
//
new Promise(resolve => setTimeout(()=>{
if
(
typeof
cb
===
'function'
)
{
//
if ( typeof cb === 'function') {
cb
(
data
);
//
cb(data);
resolve
()
//
resolve()
}
//
}
},
time
))
//
}, time))
}
}
}
}
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment