mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 19:07:08 +00:00
#24044: Style-function as possible input
This commit is contained in:
parent
549360d30e
commit
9ee1c87616
6
types/leaflet/index.d.ts
vendored
6
types/leaflet/index.d.ts
vendored
@ -919,6 +919,12 @@ export class GeoJSON<P = any> extends FeatureGroup<P> {
|
||||
*/
|
||||
resetStyle(layer: Layer): Layer;
|
||||
|
||||
/**
|
||||
* Same as FeatureGroup's setStyle method, but style-functions are also
|
||||
* allowed here to set the style according to the feature.
|
||||
*/
|
||||
setStyle(style: PathOptions | StyleFunction<P>): this;
|
||||
|
||||
options: GeoJSONOptions<P>;
|
||||
}
|
||||
|
||||
|
||||
@ -414,6 +414,14 @@ let nestedTwoCoords = [ [12, 13], [13, 14], [14, 15] ];
|
||||
const nestedLatLngs: L.LatLng[] = L.GeoJSON.coordsToLatLngs(nestedTwoCoords, 1);
|
||||
nestedTwoCoords = L.GeoJSON.latLngsToCoords(nestedLatLngs, 1);
|
||||
|
||||
const geojson = new L.GeoJSON();
|
||||
const style: L.PathOptions = {
|
||||
className: "string",
|
||||
};
|
||||
const styler: L.StyleFunction<MyProperties> = () => style;
|
||||
geojson.setStyle(style);
|
||||
geojson.setStyle(styler);
|
||||
|
||||
class MyMarker extends L.Marker {
|
||||
constructor() {
|
||||
super([12, 13]);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user