﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
14186	Adding GDirections wrapper to overlays.py	Miguel Araujo	Miguel Araujo	"Today I needed to add support to GoogleMap GeoDjango abstraction so it could draw directions in a map. So I coded GDirections class, modified gmap.py to add a directions parameter and modified the template. Directions are drawn in a path within the map, adding a directions div and getting direction steps would be trivial with this. Take in mind only one GDirections object is passed to the GoogleMap object, as only one route will be drawn in the map. 

You can find an example of use in the Doc strings of the class:

{{{
from django.shortcuts import render_to_response
from django.contrib.gis.maps.google.overlays import GDirections

def sample_request(request):
    route = GDirections(LineString(POINT(40.44 -3.77), POINT(42.33 -3.66))
    return render_to_response('mytemplate.html', {'google' : GoogleMap(directions=route)})
}}}

You can still pass other overlays and they will get drawn in the map. Just be careful with zoom, because GDirections will set automatically the zoom to show the whole path.

I hope somebody finds this useful, Best regards
Miguel Araujo"	New feature	closed	GIS	dev	Normal	wontfix		muchochini@…	Design decision needed	1	0	0	0	0	0
