Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
MapMagicGL
tntileworker
Commits
6cc174e2
Commit
6cc174e2
authored
8 years ago
by
isaret
Browse files
Options
Download
Plain Diff
Merge branch 'hotfix/rasters3'
parents
98488bcd
ad257bc0
master
rasters3
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tnrastertile.js
+8
-1
tnrastertile.js
with
8 additions
and
1 deletion
+8
-1
tnrastertile.js
+
8
−
1
View file @
6cc174e2
...
...
@@ -31,6 +31,7 @@ module.exports = {
var
rasterRender
=
{
renderers
:
[],
awsS3Client
:
[],
loadVectorTileError
:[],
vtconfig
:
vtconfig
};
const
createPool
=
function
(
ratio
,
min
,
max
,
isEng
,
workerIndex
)
{
...
...
@@ -58,6 +59,7 @@ module.exports = {
requestdata
:
requestdata
,
callback
:
function
(
error
,
data
){
var
response
=
{};
rasterRender
.
loadVectorTileError
[
workerIndex
]
=
(
data
.
length
==
0
);
response
.
data
=
zlib
.
unzipSync
(
data
);
callback
(
null
,
response
);
}
...
...
@@ -148,6 +150,7 @@ module.exports = {
secretAccessKey
:
awsConfig
.
awsSecretAccessKey
,
region
:
awsConfig
.
awsRegion
});
rasterRender
.
loadVectorTileError
[
workerIndex
]
=
false
;
//"rtiles-mmg-2017-{name}-{lng}-{scale}"
};
return
new
advancedPool
.
Pool
({
...
...
@@ -185,7 +188,10 @@ module.exports = {
};
const
sendResponseToClient
=
function
(
awsClient
,
channel
,
msg
,
buffer
,
awsParams
,
rabbitmqBucketName
){
if
(
awsParams
){
//console.log('save on s3');
saveTileOnS3
(
awsClient
,
awsParams
,
buffer
,
rabbitmqBucketName
)
}
else
{
//console.log('not save on s3');
}
channel
.
sendToQueue
(
msg
.
properties
.
replyTo
,
buffer
,
...
...
@@ -278,7 +284,8 @@ module.exports = {
});
image
.
png
({
adaptiveFiltering
:
false
});
image
.
toBuffer
(
function
(
err
,
buffer
,
info
)
{
return
sendResponseToClient
(
awsClient
,
mqdata
.
channel
,
mqdata
.
msg
,
buffer
,
awsParams
,
rabbitmqBucketName
);
var
isError
=
rasterRender
.
loadVectorTileError
[
index
];
return
sendResponseToClient
(
awsClient
,
mqdata
.
channel
,
mqdata
.
msg
,
buffer
,
isError
?
null
:
awsParams
,
rabbitmqBucketName
);
});
});
});
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets