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

feat(urlParams): add url params to define map view and context #60

Merged
merged 3 commits into from
May 31, 2017

Conversation

mbarbeau
Copy link
Member

These params are added:
context=contextName
center=-73.5,-46.8 (lon, lat)
projection=EPSG:4326
zoom=5

@@ -58,6 +74,29 @@ export class ContextService {
this.context$.next(context);
}

private updateContextWithQueryParams(context: DetailedContext) {
return this.route.queryParams
Copy link
Collaborator

@cbourget cbourget May 29, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be better if this subscription was in the service constructor and then it could simply update the current context?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I put this in constructor, it will be overwritten after the context is loaded

private options: ContextServiceOptions) {}
private options: ContextServiceOptions) {

this.readQueryParamsRoute();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would name this method readParamsFromRoute.

@mbarbeau mbarbeau merged commit 9c11f37 into master May 31, 2017
@mbarbeau mbarbeau deleted the urlparams branch May 31, 2017 17:09
mbarbeau pushed a commit that referenced this pull request Apr 20, 2021
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.

2 participants