I'm following the documentation (or what little there is), and trying to attach a KML file and reference it. Upon submission of the content creation form, I get this message at the top of the page, and the Track text data field is outlined in red:

Field Track: At least two data points must be given.

CommentFileSizeAuthor
#2 route.txt3.93 KBauris
#2 TestRoute.kml_.txt464 bytesauris
SHT.zip57.94 KBtonyyarusso

Comments

raintonr’s picture

Point 1: If you don't like the documentation, try and add to it using what you've learnt.

Did you install the Track KML module? Did you select the correct 'Treat data as...' dropdown?

Yes... I know better integration (with filefield probably) is required but this was done as a stop gap. On my site we don't actually use files and find data cut/paste directly from Google Earth (in the case of KML) works better.

auris’s picture

StatusFileSize
new464 bytes
new3.93 KB

Here is my setup:
Enabled modules:

  • Track
  • Track CSV
  • Track File
  • Track KML
  • Track Map
  • GMap

I made a new content type with fields:

Track Data
Name: field_track_data, Type: Track
Track
Name: field_track, Type: Track Map, Reference Field Name: field_track_data

The export of the content type is in file route.txt

I try to add a new route node with this procedure:

Attach file
TestRoute.kml
Track Data
TestRoute.kml
Treat data as:
File KML

Submit node.

I take the following errors:

    * warning: Invalid argument supplied for foreach() in /var/www/vasta/sites/all/modules/trackfield/trackfield_file.module on line 30.
    * warning: file_get_contents() [function.file-get-contents]: Filename cannot be empty in /var/www/vasta/sites/all/modules/trackfield/trackfield_file.module on line 41.
    * warning: DOMDocument::loadXML() [domdocument.loadxml]: Empty string supplied as input in /var/www/vasta/sites/all/modules/trackfield/trackfield_kml.module on line 19.
    * Field Track Data: Invalid KML or no paths found in KML.

and a red border around Track Data field.

TestRoute.kml is renamed to TestRoute.kml_.txt in order to attach it.

What am I doing wrong?

PS. I haven't find any way to take my data from google maps at csv format.

auris’s picture

Anyone?

raintonr’s picture

I have just specifically tested file functionality for another bug report. It is working perfectly with Drupal 6.16 and the latest dev. version of trackfield (2010-Jan-07).

If you are getting this:

* warning: Invalid argument supplied for foreach() in /var/www/vasta/sites/all/modules/trackfield/trackfield_file.module on line 30.

It's probably because you haven't correctly attached a file. You have to browse then upload the file (under the 'File attachments' part of the node submission form). Then place that filename inside the track data field. Did you do that?

Sorry, I know this is cumbersome but after writing the file part I actually found that we didn't use it. Most people just copy/paste their data from Google Earth in KML.

raintonr’s picture

Status: Active » Closed (cannot reproduce)