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

Update the measure tool how to to include initialUnits #460

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 14 additions & 0 deletions docs/howto/configure-measure-tool.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,17 @@ Here's the example from the demo:
* `ch` for chains.
* `a` for acres.
* `h` for hectares.

## Example of setting the default units to meters

The code below will set the default the measurement units to meters instead of feet.

```javascript
app.add(gm3.components.ServiceManager, 'service-tab', {
services: true,
measureToolOptions: {
pointProjections: point_projections,
initialUnits: 'm'
}
});
```
3 changes: 2 additions & 1 deletion examples/desktop/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ app.loadMapbook({url: 'mapbook.xml'}).then(function() {
app.add(gm3.components.ServiceManager, 'service-tab', {
services: true,
measureToolOptions: {
pointProjections: point_projections
pointProjections: point_projections,
initialUnits: 'mi'
}
});

Expand Down