2019-01-24 17:56:37 +03:00
|
|
|
package tilerendererjob
|
|
|
|
|
|
|
|
import (
|
|
|
|
"mapserver/app"
|
|
|
|
"mapserver/coords"
|
2019-02-19 10:33:38 +03:00
|
|
|
"github.com/sirupsen/logrus"
|
2019-01-24 17:56:37 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
func worker(ctx *app.App, coords <-chan *coords.TileCoords) {
|
|
|
|
for tc := range coords {
|
2019-01-27 20:34:04 +03:00
|
|
|
//render tile
|
2019-02-19 10:33:38 +03:00
|
|
|
|
|
|
|
fields := logrus.Fields{
|
|
|
|
"X": tc.X,
|
|
|
|
"Y": tc.Y,
|
|
|
|
"Zoom": tc.Zoom,
|
|
|
|
"LayerId": tc.LayerId,
|
|
|
|
"prefix": "tilerenderjob",
|
|
|
|
}
|
|
|
|
logrus.WithFields(fields).Debug("Tile render job tile")
|
|
|
|
|
2019-02-07 21:48:05 +03:00
|
|
|
_, err := ctx.Tilerenderer.Render(tc)
|
2019-01-24 17:56:37 +03:00
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|