11use crate :: * ;
2- use egui:: TextBuffer ;
32use feature:: collection:: LayerInfo ;
43use glyphon:: {
54 Attrs , Buffer , Color , Family , FontSystem , Metrics , Shaping , TextArea , TextBounds , Weight ,
@@ -9,8 +8,8 @@ use lyon::{
98 tessellation:: { geometry_builder:: VertexBuffers , FillOptions , FillTessellator } ,
109} ;
1110use quick_protobuf:: { BytesReader , MessageRead } ;
11+ use std:: collections:: HashMap ;
1212use std:: sync:: { Arc , RwLock } ;
13- use std:: { collections:: HashMap , thread:: spawn} ;
1413use std:: { fmt:: Display , ops:: Range } ;
1514use vector_tile:: vector_tile:: mod_Tile:: { Feature , GeomType , Layer , Value } ;
1615
@@ -168,12 +167,14 @@ impl Tile {
168167
169168 let paths = geometry_commands_to_paths ( feature. type_pb , & feature. geometry ) ;
170169
170+ let mut title = None ;
171171 if let Some ( tag) = tags. get ( "name:en" ) {
172172 let point = paths[ 0 ] [ ControlPointId ( 0 ) ] ;
173173 text. push ( (
174174 ( point. x / extent as f32 , point. y / extent as f32 ) ,
175175 tag. clone ( ) ,
176176 ) ) ;
177+ title = Some ( tag. clone ( ) ) ;
177178 }
178179
179180 // If we have a valid object at hand, insert it into the object list
@@ -191,6 +192,8 @@ impl Tile {
191192 paths[ 0 ] . points ( ) . to_vec ( ) ,
192193 tags,
193194 ot,
195+ * tile_id,
196+ title,
194197 ) ) ;
195198 }
196199
@@ -341,7 +344,13 @@ impl Tile {
341344 . tessellate_path ( & path, & FillOptions :: tolerance ( 0.0001 ) , builder)
342345 . expect ( "This is a bug. Please report it." ) ;
343346
344- let object = Object :: new ( selector, path. points ( ) . to_vec ( ) , ObjectType :: Polygon ) ;
347+ let object = Object :: new (
348+ selector,
349+ path. points ( ) . to_vec ( ) ,
350+ ObjectType :: Polygon ,
351+ TileId :: new ( 0 , 0 , 0 ) ,
352+ Some ( "background" . to_string ( ) ) ,
353+ ) ;
345354
346355 (
347356 current_feature_id,
0 commit comments