forked from MTSR/mapserver
layer find cleanup
This commit is contained in:
parent
16d691abf0
commit
6583d6c3a5
@ -12,19 +12,13 @@ const (
|
||||
func GetTileCoordsFromMapBlock(mbc *MapBlockCoords, layers []*layer.Layer) *TileCoords {
|
||||
tc := TileCoords{X: mbc.X, Y: (mbc.Z + 1) * -1, Zoom: MAX_ZOOM}
|
||||
|
||||
var layerid *int
|
||||
for _, l := range layers {
|
||||
if mbc.Y >= l.From && mbc.Y <= l.To {
|
||||
layerid = &l.Id
|
||||
break
|
||||
}
|
||||
}
|
||||
currentLayer := layer.FindLayerByY(layers, mbc.Y)
|
||||
|
||||
if layerid == nil {
|
||||
if currentLayer == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
tc.LayerId = *layerid
|
||||
tc.LayerId = currentLayer.Id
|
||||
|
||||
return &tc
|
||||
}
|
||||
|
@ -50,15 +50,9 @@ func (a *MapBlockAccessor) FindMapBlocksByMtime(lastmtime int64, limit int, laye
|
||||
result.LastMtime = block.Mtime
|
||||
}
|
||||
|
||||
inLayer := false
|
||||
for _, l := range layerfilter {
|
||||
if block.Pos.Y >= l.From && block.Pos.Y <= l.To {
|
||||
inLayer = true
|
||||
break
|
||||
}
|
||||
}
|
||||
currentLayer := layer.FindLayerByY(layerfilter, block.Pos.Y)
|
||||
|
||||
if !inLayer {
|
||||
if currentLayer == nil {
|
||||
continue
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user