Cant seem to get Display filter Gmap to display the location of my image that has gps data

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

So for the last few days I have been trying to get a map to show up on my image node with the location of where the image was taken. I have verified my image has gps data in it and turned display fields "well known text" which displays :

Location:
POINT(3.4636986915691 50.434256459725)

how ever when its set to gmap no map shows up on my page.

Attached as a jpeg is my devel output form my node, which has the following:

geo
gis type = point
wkb

geo and wkb have some odd chrs in their.. guess its coded gps data.. ?

So since I couldnt get gmap to work I was going to use gmap_simple_map api in the theme.. such as something like this

<?php
  
  
print gmap_simple_map($lat, $long, '', '', 7, '400px', '400px', FALSE,'');
   echo
"lat = $lat , and long = $long";
  
  
?>

However Im not sure how to take the data thats encoded and convert it to long,lat that then I can pass to this.. ?

I followed a tutorial online http://www.geojune.org/doc/getting-started-mapping/drupal-mapping-cookbo... which walked though, of course since this post the modules have been updated as well as drupal/core.

Im running drupal 6.19, php 5.3x

Modules:

Geo 6.x-1.0-alpha 5
Gmap 6.x-1.x-dev
Geocode 6.x-1.0-alpha 2

I have tried a combination of modules, and its clear that from the devel of the node im getting gps data... just gmap isnt working .. however I think if I knew how to convert that data to long/lat I could write my own themed map or even a module that works..

thoughts? sorry I could really use some info, esp on how to convert data , im also willing to blog about this if I can get it working.

Comments

After nearly killing myself

itserich's picture

After nearly killing myself trying to get something location based to work, I finally figured out Openlayers and it maps coordinates quite easily.

This tutorial works with a few modifications (read the last comment I made). http://drupal.org/node/627816

Then geocoder will allow you to enter almost any geographic reference in plain english and plot it on a map.

Good luck.

thanks for the heads up, its

gateway69's picture

thanks for the heads up, its on my list to check out.. did you do this for images..

I guess the biggest question is how to parse wdk data and convert it into human readable via php.. which then I can pass to gmap?

Oh no sorry it was not an

itserich's picture

Oh no sorry it was not an image.

so incase anyone wants a

gateway69's picture

so incase anyone wants a light weight non open layers solution I found a way to do this in the theme.

if you follow that guide you do not need geo+gmap since well its not supported or works with 6.19 etc.. but in the tutorial under this section change this

Then, the Geospatial Data field display is configured as follows:

Label: Hidden
Teaser: Hidden
Full Node: GMap

to

Then, the Geospatial Data field display is configured as follows:

Label: Hidden
Teaser: Hidden
Full Node: Well Known Text

in your images theme.. add this below content or where ever you want to theme it.

<?php

   $data
= $node->field_user_image_location[0]['view'];
   echo
preg_match_all("/(\d+.\d+)/",$data,$matches);
  
print_r($matches[1]);
  
$long = $matches[1][0];
  
$lat = $matches[1][1];
   print
gmap_simple_map($lat, $long, '', '', 7, '400px', '400px', FALSE,'');
  
  
?>

of course with gmap_simple you can do more options if you look up that api..

just a fyi incase anyone else is looking for this.

oh make sure

gateway69's picture

oh make sure field_user_image_location[0]['view'] uses your field for Geospatial Data

Location and Mapping

Group organizers

Group categories

Wiki type

Group notifications

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

Hot content this week