just photo

Drupal Google maps. I choose the Simplest gmap

Julia 21/06/2009
CCK field of Simplest Gmap module
Simplest gmap field settings

The common task is:
- add location to a node by pointing it on the google map, highly desirable with cck field
- create maps with groups of node on one map with views.

I worked with GMap and location,
I saw at the newer module Google Maps Tools as well,

but when I've found Simplest gmap module I understood that is really what I need.

The main advantages of this module in my opinion:
- really very simple and small
- that is a CCK field
- perfect map widget
(when you drop a marker, it doesn't zoom in as other modules)

There are no any requirements for this module.

There is a one weakness of this field - there are no way to add location
by typing city, country and so on, only by dropping marker.

Views

And what about views integration?
Maintainer says that he is going to do that,
but even now we have such possibility!

  1. Download and enable modules:

    Of course - Simplest gmap and Views as well.

  2. Then create content type with three fields:
    • field of type Simplest gmap
    • Longitude field of computed type
    • Latitude field of computed type
  3. Configure computed fields:

    Write in the Computed code textarea of your Longitude and Latitude fields:

    $node_field[0]['value'] = $node->field_geolocation[0]['longitude'];
    $node_field[0]['value'] = $node->field_geolocation[0]['latitude '];

    respectively,
    where field_geolocation - name of your simplest gmap field

  4. Add new view,

    add longitude and latitude fields,
    for style choose - Mapstraction

And now you have a big map with nodes on it :)
mapstruction map

тэги:

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options