Opened 6 years ago

Closed 3 years ago

#14186 closed New feature (wontfix)

Adding GDirections wrapper to

Reported by: maraujop Owned by: maraujop
Component: GIS Version: master
Severity: Normal Keywords:
Cc: muchochini@… Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Today I needed to add support to GoogleMap GeoDjango abstraction so it could draw directions in a map. So I coded GDirections class, modified 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 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

Attachments (1)

geodjango-gdirections.patch (5.1 KB) - added by maraujop 6 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 Changed 6 years ago by maraujop

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

I'm not sure why but the patch diff is not showing correctly in the Trac interface, sorry.

Changed 6 years ago by maraujop

comment:2 Changed 6 years ago by thejaswi_puthraya

  • Component changed from Uncategorized to GIS

comment:3 Changed 6 years ago by maraujop

  • Cc muchochini@… added

comment:4 Changed 6 years ago by russellm

  • Triage Stage changed from Unreviewed to Design decision needed

This seems to me like something that should be handled as an external extension, rather than a builtin feature -- but I'll defer to anyone with better GeoDjango experience.

comment:5 Changed 5 years ago by maraujop

  • Severity set to Normal
  • Type set to Uncategorized

As GeoDjango is moving or has moved to the new Google API v3. This is probably unnecessary anymore, as GDirections doesn't exist anymore and directions handling is done completely different.

Version 0, edited 5 years ago by maraujop (next)

comment:6 Changed 5 years ago by julien

  • Type changed from Uncategorized to New feature

comment:7 Changed 5 years ago by jacob

  • milestone 1.3 deleted

Milestone 1.3 deleted

comment:11 Changed 4 years ago by aaugustin

  • UI/UX unset

Change UI/UX from NULL to False.

comment:12 Changed 4 years ago by aaugustin

  • Easy pickings unset

Change Easy pickings from NULL to False.

comment:13 Changed 3 years ago by aaugustin

  • Resolution set to wontfix
  • Status changed from new to closed

Closing per comment 5.

Note: See TracTickets for help on using tickets.
Back to Top