Is possible to add a map to draw a route

Events happening in the community are now at Drupal community events on www.drupal.org.
-enzo-'s picture

Hello Folks

I build a new site to enable people to request or offer rides in Costa Rica, ride.alapar.net I've a custom content type to store rides, but I'm wondering if it's possible to add a map to enable users to draw a simple route ( lines) and store in database, in this way people could check if a ride is accurate for him/her.

Best regards

enzo

Comments

Trackfield

raintonr's picture

Hi,

You can use trackfield for this:

http://drupal.org/project/trackfield

An example from NoBMoB:

http://nobmob.com/node/5931

This is a standard content type which happens to have a CCK 'trackfield' field. Then for display it has a trackfield map, graph and number of stats that are all derived from the entered route.

On NoBMoB, these 'track' content types are grouped in a 'ride area', so we can have a view that shows all trails in a specific area, like this:

http://nobmob.com/node/5917/tracks

You can also get KML generated for such a view, like this (see this just loads the KML generated into Google maps):

http://maps.google.com.au/?q=http://nobmob.com/node/5917/kml

Is that what you meant?

Although trackfield is still early in development it's been working quiet nicely for us (and I do know a few other sites too) for a while now.

Hope this helps,

Rob

Problem using Trackfield

-enzo-'s picture

Hello raintonr

I download and I'm trying to create a Track Map, but when this cck field request me a "Reference Field Name" and I get this error

You must specify the reference field of type track.

Could you write a little readme about how use track map to draw a route in a node.

Thanks for your help

enzo - Eduardo Garcia

enzo - Eduardo Garcia

Doco updated

raintonr's picture

Have updated the doco and added a 'quickstart' section here:

http://drupal.org/node/274516

Hope this helps.

It's working, but is a little trick

-enzo-'s picture

Hello Raintonr

Thanks for you explanation, all works as you said, but I have couple question

  1. Track data field is enable in add/edition and you could choose how treat data I understand the Latitude, Longitude and Altitude options, but what does USR mean?

  2. I guess this a little geek way to store information, I'm thinking in a easy way to draw the route using a cursor, I want enable my service for regular people, sometimes without computer knowledge, do you have any approach on this way, I could help you if you have any advance in this direction.

Best regards.

enzo

P.S track_cvs.modulo have a error in line 192, I resolve mix lines 191 and 192 and remove a character \, maybe is a error in cvs file.

enzo - Eduardo Garcia

enzo - Eduardo Garcia

USR

raintonr's picture

'USR' refers to USR data. The idea is that in the end you will be able to put any number of fields and use them for whatever you like.

Ie. a cyclist might like to record cadence, power, time, etc.

In the latest trackfield_crs for example, these are used and heartrate, cadence and time are all stored.

The idea is these will be user definable or site configurable after time.

As for the drawing thing... there are many, many sites online for drawing routes so I didn't want to re-invent them. I like to draw paths on Google Earth and then just copy/paste the KML into my Drupal site. Works very well.

The bug you refer to has been closed:

http://drupal.org/node/313731

I am wondering if is is

kirilius's picture

I am wondering if is is possible to use only the Location module for this? Locations allows for multiple locations to be stored for a node. I am just not sure how to make GMap use those to raw lines between them???

Trackfield is not available for Drupal 6 yet and it will take some time for this to happen so a Location-only solution will be best for me.

D6 Trackfield

raintonr's picture

I'm working on D6 Trackfield, but am a bit held up by lack of doco for D6 CCK :(

See here: http://drupal.org/node/247932

Anyhow - if someone wants to see this progress and knows a bit about D6 CCK would love to hear from them! :)

As for the location only thing? Hmmmm... I'm guessing you might have some luck with themeing GMAP but haven't looked into that possibility.

D6 Trackfield

raintonr's picture

Ah... all sorted. There's a dev. release of Trackfield now if anyone wants to try it.

Thanks, but I don't see the

kirilius's picture

Thanks, but I don't see the dev release on the project page. The last version I saw was 6.x-0.5 (Oct 29)

Dev for 6.x

raintonr's picture

Ah... here you go:

http://drupal.org/node/330668

Give it a while to populate though.

Just tried that version. I

kirilius's picture

Just tried that version. I added a new field of type Track to my content type, then tried to add a field of type Track Map, hit Save and got the following error message:

user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NOT NULL DEFAULT 'TRUE'' at line 1 query: ALTER TABLE content_type_test ADD field_track_map_dummy NOT NULL DEFAULT 'TRUE' in /home/newnomad/public_html/includes/database.mysql-common.inc on line 298.

Wrong version

raintonr's picture

Doh! What's going on here? This is the wrong version of the code.

This comes from my lack of understanding of how Drupal/CVS interact. I created a branch point for D6 in CVS but it won't let me tag anything with DRUPAL-6--1 :(

Look here - you'll see what I mean:

http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/trackfield/...

OK, I'll be checking the

kirilius's picture

OK, I'll be checking the module home page and wait for the packaged update. Thanks for the quick reaction!

Just checking back: do you

kirilius's picture

Just checking back: do you plan to release a new version on the module home page. The one there is still from Oct 29. Or if not there, where can find the updated packaged module?

CVS?

raintonr's picture

Hmmm... I wasn't going to make a release until the webmasters fix up my silly release problem :(

Don't suppose you can get these from CVS in the mean time? You could just wget them if you don't fancy messing with CVS itself:

wget http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/trackfield/trackfield.module?revision=1.10

wget http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/trackfield/trackfield_map.module?revision=1.9

wget http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/trackfield/trackfield_graph.module?revision=1.8

wget http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/trackfield/trackfield_stats.module?revision=1.7

Sorry, I haven't had much time to test this thoroughly... if you can confirm this is working that would be a great help :)

Ooooops! I used the links

kirilius's picture

Ooooops! I used the links above to override the packaged module files and I don't get an error anymore but... when I try to create a new node with a trackfield in it, all I get is a text field to drop some coordinates into. In fact I was looking for a functionality similar to that of Location module, where you have a clickable google map to select your coordinates from (ton type them in). Is there such an option for trackfield?

Maybe

raintonr's picture

So you want a clickable map like Google maps 'My Maps' has? And GPSies and a whole load of other sites?

Sorry, but although someone could probably write an extension like that I don't plan to. What I do is use Google Earth (or one of the sites just mentioned) to draw lines then copy/paste the KML (or GPX export or whatever) into the trackfield and there you go.

This was meant to be a co-ordinate storage system, not a map builder like you want.

No worries, thanks for your

kirilius's picture

No worries, thanks for your help.
I was looking for something that combines the Location module (it already has the clickable map) and trackfield. In fact Location supports multiple locations (latitude+longitude) per node but apparently it cannot connect those locations visually on the map.

Use GMap Macro builder

eelkeboezeman's picture

From the GMap module readme.txt:

"GMap macros" are text-based representations of Google Maps. A GMap macro can be created with the GMap Macro Builder tool or by hand. Any map parameter not specified by a macro will use the defaults from the GMap settings page (Administer > Site configuration > GMap). There are several places where you may use Gmap macros, mainly:

1) GMap settings, like the GMap Location module's settings page.
2) Any node where the GMap filter is enabled (as part of the input format).
A GMap macro will look something like this (see API.txt for syntax details):
[gmap markers=blue::41.902277040963696,-87.6708984375 |zoom=5 |center=42.94033923363183,-88.857421875 |width=300px |height=200px |control=Small |type=Map]

The GMap Macro Builder is a GUI for creating GMap macros; you may use it to create a map with points, lines, polygons, and circles, and then copy and paste the resulting macro text. After you insert the macro into a node, you can edit it using raw values that you get from elsewhere to create a different set of points or lines on the map.

Location and Mapping

Group organizers

Group categories

Wiki type

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: