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

Add change event to Geolocation #1858

Merged
merged 2 commits into from Mar 17, 2014
Merged

Add change event to Geolocation #1858

merged 2 commits into from Mar 17, 2014

Conversation

elemoine
Copy link
Member

This PR makes Geolocation instances dispatch change events when the geolocation changes.

Currently the example in the API doc suggests listening to change:position to get notified when the geolocation changes. But speed and accuracy_geometry are not yet up-to-date when this event occurs. This PR fixes this problem by introducing a change event dispached when all the geolocation properties have been updated.

Please review.

@@ -44,7 +44,7 @@ ol.GeolocationProperty = {
* // take the projection to use from the map's view
* geolocation.bindTo('projection', map.getView());
* // listen to changes in position
* geolocation.on('change:position', function(evt) {
* geolocation.on('change', function(evt) {
* window.console.log(geolocation.getPosition());
Copy link
Contributor

Choose a reason for hiding this comment

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

This debugging code should probably be removed (I know that it was already present).

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, I'll remove it.

Copy link
Member Author

Choose a reason for hiding this comment

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

This console.log is actually in the API doc :-)

@fredj
Copy link
Member

fredj commented Mar 14, 2014

+1

elemoine pushed a commit that referenced this pull request Mar 17, 2014
Add change event to Geolocation
@elemoine elemoine merged commit f019f3e into openlayers:master Mar 17, 2014
@elemoine elemoine deleted the geolocation branch March 17, 2014 08:32
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