Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GeoJSON layer - this context for option callbacks #4352

Closed
wants to merge 2 commits into from
Closed

GeoJSON layer - this context for option callbacks #4352

wants to merge 2 commits into from

Conversation

tugrul
Copy link

@tugrul tugrul commented Mar 26, 2016

Following option callbacks can access GeoJSON layer
instance through this keyword.

  • pointToLayer
  • onEachFeature
  • filter
  • coordsToLatLng

Following option callbacks can access GeoJSON layer
instance through this keyword.

- pointToLayer
- onEachFeature
- filter
- coordsToLatLng
@tugrul
Copy link
Author

tugrul commented Mar 26, 2016

There are some lack about this pull request. I didn't see geometryToLayer is static function and i'm going to change this. Please ignore first commit of this pull request.

@IvanSanchez
Copy link
Member

I cannot see why this is needed. Can you illustrate with a use case?

@tugrul
Copy link
Author

tugrul commented Mar 27, 2016

@mourner
Copy link
Member

mourner commented Mar 28, 2016

I don't think this is necessary, since you can just use bind to set the context whatever you need.

@tugrul
Copy link
Author

tugrul commented Mar 28, 2016

@mourner using bind can be workaround but not solution. Also i can set option in initializer and access in this scope. Basic principle: Every callback should have context own instance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants