Skip to content

Commit

Permalink
example: add labels in Shapefile example
Browse files Browse the repository at this point in the history
  • Loading branch information
zarov committed Jun 10, 2020
1 parent 0fd1ee3 commit 5aa2fdc
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions examples/source_file_shapefile.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,30 @@
return itowns.ShapefileParser.parse(res, {
buildExtent: true,
crsOut: view.tileLayer.extent.crs,
style: new itowns.Style({
zoom: { min: 10, max: 20 },
point: {
color: 'white',
line: 'green',
},
text: {
field: '{name}\n(id: {station_id})',
size: 14,
haloColor: 'white',
haloWidth: 1,
font: ['monospace'],
},
}),
});
}).then(function _(feature) {
var velibSource = new itowns.FileSource({
parsedData: feature,
});

var velibLayer = new itowns.ColorLayer('velib', { source: velibSource,
style: {
point: {
color: 'white',
line: 'green',
}
}});
var velibLayer = new itowns.ColorLayer('velib', {
source: velibSource,
labelEnabled: true,
});

debug.createTileDebugUI(menuGlobe.gui, view);

Expand Down

0 comments on commit 5aa2fdc

Please sign in to comment.