Skip to content

allow GeoJSON Options object instead of just StyleFunction #56

@crotwell

Description

@crotwell

Noticed the geojson code from PR #52 only allows the style function to be set, but leaflet allows more options. I think it would be better and more flexible to have the third argument to the addGeoJsonLayer() function match the leaflet argument. So instead of

  addGeoJsonLayer(layername: string, geoJsonData: GeoJsonObject, styleFunction?: L.StyleFunction) {

it would be:

  addGeoJsonLayer(layername: string, geoJsonData: GeoJsonObject, geoJsonOptions?: L.GeoJSON_options) {

and to use it, instead of passing in a style function, you would pass in an object. So instead of this:

addGeoJsonLayer("the layer", myGeoJson, myStyleFun);

you would do this:

addGeoJsonLayer("the layer", myGeoJson,
    {
      style: myStyleFun
    });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions