niryariv / opentaba-client

BSD 3-Clause "New" or "Revised" License
8 stars 15 forks source link

calculate geojson center/boundaries automatically #67

Closed niryariv closed 10 years ago

niryariv commented 10 years ago

We use these values for centering the maps and setting maximal boundaries (so users don't accidentally scroll away cant return).

Currently we enter them manually, but we can use the topojson files to calculate by simply determining min/max lon/lat for boundaries, and the center point between them for center.

we can either calculate it it in the create_client script and then enter the values in munis.json or calculate every time we load the map. either way, we should allow munis.json to override the calculation in case we want to set specific center/boundaries manually.

florpor commented 10 years ago

the create_client task does do it: https://github.com/niryariv/opentaba-server/blob/master/scripts/client_fabfile.py#L180

niryariv commented 10 years ago

cool, so just add boundaries

florpor commented 10 years ago

added automatic or "override" option in app.js for center and bounds: https://github.com/niryariv/opentaba-client/commit/9d4e53deb17ec6ef0772275b024eb15e5e8fb029 added bounds calculation in client_fabfile: https://github.com/niryariv/opentaba-server/commit/6790399b5456f69a1a054342bb0eb9060da2daf4