Releases: watergis/mapbox-gl-legend
Releases · watergis/mapbox-gl-legend
v1.2.6
What's Changed
- #27: Configure the title of the legend by @JacobGeoGeek in #28
New Contributors
- @JacobGeoGeek made their first contribution in #28
Full Changelog: v1.2.5...v1.2.6
v1.2.5
- updated legend-symbol. Now linedasharray is supported
Full Changelog: v1.2.4...v1.2.5
v1.2.4
v1.2.3
fixed a bug of creating legend symbol
v1.2.2
v1.2.1
1.2.1
v1.2.0
- Now scripts and css can be loaded directly in your html file through CDN
- Due to supporting CDN format, Importing method was changed as follows
-import MapboxLegendControl from "@watergis/mapbox-gl-legend";
+import { MapboxLegendControl } from "@watergis/mapbox-gl-legend";
- For CDN, you can use scripts as follows
<link href='https://watergis.github.io/mapbox-gl-legend/mapbox-gl-legend.css' rel='stylesheet' />
<script src="https://watergis.github.io/mapbox-gl-legend/mapbox-gl-legend.js"></script>
<script>
map.on('load', function() {
const targets = {
'pipeline': 'Pipeline',
'pipeline_annotation': 'Pipeline Label',
'meter': 'Water Meter',
'flow meter': 'Flow Meter',
'valve': 'Valve',
'firehydrant': 'Fire Hydrant',
'washout': 'Washout',
'tank': 'Tank',
'tank_annotation': 'Tank Label',
'wtp': 'WTP',
'wtp_annotation': 'WTP Label',
'intake': 'Intake',
'intake_annotation': 'Intake Label',
'parcels': 'Parcels',
'parcels_annotation': 'Parcels Label',
'village': 'Village',
'village_annotation': 'Village Label',
'dma': 'DMA',
'dma-annotation': 'DMA Label',
'contour-line': 'Countour',
'contour-label': 'Contour Label',
'hillshade': 'Hillshade'
};
map.addControl(new watergis.MapboxLegendControl(targets, {
showDefault: false,
showCheckbox: false,
onlyRendered: true,
reverseOrder: true
}), 'top-right');
})
</script>
v1.1.7
v1.1.6
v1.1.5
- change
legend-symbol
to use npm package itself.