GeoTextStyle and render cache process
2017-04-07 16:34:53 0 举报
GeoTextStyle和render cache是地图渲染中常用的技术。GeoTextStyle用于设置文本样式,包括字体、颜色、大小等属性。而render cache则用于缓存已经渲染过的图层,以提高渲染效率。在地图渲染过程中,首先使用GeoTextStyle设置文本样式,然后使用render cache对已经渲染过的图层进行缓存,最后将缓存后的图层输出到屏幕上。这样可以避免重复渲染相同的图层,从而提高渲染效率。总之,GeoTextStyle和render cache是地图渲染中不可或缺的两个重要技术。
作者其他创作
大纲/内容
has source chache
drawTileImage
createApplyInstructions
set
this.GetTile
source Tile stateload
IsOverMaxDataZoom
strokeText
create instructs
tile = tile.getInterimTile
cache source if it comes from MaxDataZoom
is key queued
Y
Remove
No
geoTextStyle.getConvertedStyleCore
Has
this.createRepaly(tile)
setLabelPosition
sourceTile = tile.getTile(tile.tileKeys)
return Tile
Get
vectorImageTileCoordsourceTileCoordrequestCoord
dequeue tile
N
return tile
ExpireCache
ol.style.Text setZindex
tile.SetFeature
tile.load
Get originalReplayGroup
Check replays state then replayGroup.replay
has apply cache
this.isTileToDraw(tile)
source.getTile
getApplyTileInstructions
post succeed
sourceTileCoord === vectorImageTileCoordis apply tile
add listen
postMessage for CreateReplay
postMessagecreateReplayGroup
onmessage
is the cache exist
saveTileInstructions
request method
Cancel
Post backCancel
has originalReplayGroup
check cancel
fillText
Updata replayGroup andChange Event
tileFeatureAndInstrictions
tilesLoadingKeys_
getLabelInfos
tileSource.getTile
===
handlePostRender
tile. success
this.createReplayGroup
tile state === IDLE
self.createReplayGroup
Load tile event
Get Feature and GeoTextStyle
CreateReplayGroup
RegisterTileLoadEvent
tile is LOADED
request
this.getDrawingTile(tile)
DrawTileImage
self.disposeSourceTile
tileLoadEventInfos
removeTileInstructions
Set
Get textLabelingStrategy
is tile Loaded and createReplay
Limit 16
RenderTileImage
readFeaturesAndInstructions
{name:\"USA\"}
self.createReplay
CreateDrawingInstructs
change replay state
successFunction
send xhr request
save source if requestCoord is maxDataZoom
feature + ol.style.Style
No cache
textLabelingStrategy.MarkLocation
Get Cached TileFeatureAndInstruction
Get the \"box\" of the Text
self.request
sourceTile.setReplayGroup
success func
prepareFrame
manageTilePyramid
added
Post \"request\" message
is IDLE Or CANCEL
getImage
has cache
tileQueue.loadMoreTiles
isDrawableTile(tile)
LoadMoreTiles
tileFeatureAndInstruction(requestCoord+zoom)tileCoords
is tile Feature and
Read Feature and Instructions
the.renderTileImage
applayInstructions
featureLoader
request Source
CreateInstructionsForHomologousTiles
createReplay call back
TileQueue.enqueue
!=
return
check the cache of request source
succeed event
DrawTextCanvas
Create VectorImageTile
listen 'change' event
Failure
如果对应的vectortile 没有loaded就会尝试去创建interimTile,具体为查询到对应VectorTileLayer已加载的
Error
getTileFeatureAndInstrictionsrequestCoord+sourceTileZoom
tile = tile.getInterimTile()
LoadFeatureXhr
is sourceTileloaded
limit 16
response
getTileInstrictions
send \"succeed\" to main thread
Postsucceed
Request
get RegisterTile load Event
sourceTile setReplayGroup
get featureTextand Set to ol.style.Text
is the cache of source
Get feature and instriction
foreach source tile to create replayGroup
tile state ===IDLE/CANCEL
drawMask
post Backreplay data
postback
enqueue tile
foreach tilekeys
Set label image to ol.style.Text
tile state === LOADED
postMessagedisposeSourceTile
rbush.collides
Get flatCoordinates by GeometryType
\"text-content\":\
PostBack
Add to TilesToDrawByZ
create ReplayGroup
this.renderTileImage(tile)
Loaded and CreatedReplay
Request Back
PostMessagerequest
GeoVectorTile disposeInternal
set tile state as loading
Post backFailure
sendRequest
GeoVectorTileRender.prepareFrame
get tile from cache or craete
0 条评论
下一页