Development Resources - MAPC/bostonparks GitHub Wiki

Some notes and links related to ongoing development and implementation.

Staging Server

For now the staging server is hosted at MAPC: bostonparks.mapc.org. Currently we don't have CI or any other form of automated deployment, everything happens manual (only master branch is deployed to that server).

Encoding geometries in Google Maps

To achieve good performance for rendering polygons and polylines on Google Maps, geometries encoding is recommended. In Python (and Django) this can be done with GPolyEncode.

If encoded geometries are output through Django templates, you need to take care of backslashes that would cause problems in JavaScript. Below is a template tag string filter that would fix that problem:

@register.filter
@stringfilter
def fixbackslash(value):
"""Replace backslashes '\'  in encoded polylines for Google Maps overlay."""
return value.replace('\\','\\\\')

Google Maps Utility Library V3

Some JavaScript libs worth looking when working with Google Maps: google-maps-utility-library-v3.