I'd like to introduce OpenLayers Geocoder which provides geocoding capabilities to the OpenLayers CCK widget. The module relies on the Google Map geocoding service which allows to retrieve geographical coordinates of a location by simply providing its full address.

Thanks to the well detailed information Google makes available (like country, postal code, bounding box etc...) the module can correctly visualize the location adjusting the map's edges to fit its dimensions, for example: querying the name of a city will visualize the entire metropolitan area while providing the full address of a building will zoom the map at street level.

Currently OpenLayers Geocoder doesn't store any additional information about the location then the WKT handled by OpenLayers CCK module. However the next step will be to store the full Google geocoding response and to expose it to Views module: this integration will make possible to display, filter and sort locations according to their country, postal code, administrative area, etc...
Another interesting integration would be with the Geo Taxonomy module: since OpenLayers Geocoder retrieves well structured information about the address it could automatically populate a hierarchical geo taxonomy vocabulary.
You can download a dev version from the module's project page, I'll keep the group informed about further developments.

Comments
Looks Cool
These screenshots look pretty cool. Hopefully I will get a chance to install it this week.
--
zzolo
Nice work Antonio
I have tested it with CCK and it works just as expected. OpenLayers lacks a nice WYSIWYG way to plot locations based on address, this module does the trick.
As you mentioned OpenLayers Geocoder still does not expose itself to Views so still I cannot get my locations to display on the Views generated map. I was trying to figure out how to solve this with Token combined with Geo as you mentioned but it seems a bit tricky. What is your timeplan on the views integration? Also I think OpenLayers should mention this module in the description as soon the views integration is ready.
Keep up the good work.
Stormfors - Sweden
Hi Frico, happy you like the
Hi Frico, happy you like the module! Since OpenLayers Geocoder just provides an additional widget to OpenLayers CCK you have views integration out-of-the-box: try to display with views the CCK field you bound the geocoder to and choose one of the map presets as formatter. This solution is, anyway, temporary, I plan to provide my own formatters too, then I'll be able to use geocoder information to better drive the map visualization (like location bounds, zoom levels, etc...).
Thanks
Perhaps I was mistaken. Ill try to link the fields properly to get the mapping of locations to work in Views. I was a bit confused of how I would get it done but I'll try it out tomorrow in front of the big screen :)
Stormfors - Sweden
This is what I have tried without succes... any tips?
The CCK content type I have created consists of only one extra input field where:
Type: OpenLayers WKT
Operations: OpenLayer Geocoder
It works perfect to create content with this setting. Though when I try to plot the points in views I can't get it to work? Is this because the value is not saved or do I need to map it to another field in CCK in order to get the coordinates to show in the View?
These are my settings in views:
Basic settings > Style: OpenLayers
Row style > fields, Inline fields: Content: Map (field_map_location)
Fields > Content: Map with Format: OpenLayers: Map or WKT value.
These settings will show the map but not plot the points? What step am I missing?
Many thanks for your assistance :)
Stormfors - Sweden
Issue fixed, I got it to work now
I had one setting wrong. Tip for others that might be interested:
In the Style: OpenLayers settings choose
To get all plots on the same map leave the
Grouping field:
Stormfors - Sweden
Search function doesn't display dropdown list
Hello,
I'm trying this module currently.
When I try to create content in the WKT field, I can manually plot a point on the map but I did not dropdown list with search function.
For instance I try type "Rome, Italy" in the search address field, blue icon search and it displays nothing. It' looking for something but found nothing.
Any idea ?
Thanks.
To resolve this problem
The problem is the Google Maps API key is missing.
To resolve this problem go to the openlayers settings in layers section and complete the "Google Maps API Key" field.
To get a valid API Key :
http://code.google.com/intl/fr-FR/apis/maps/signup.html
Same problem
I have the same problem even if the Google Maps API key is already set properly.
When I type in the "Search Address" field, no dropdown list appears.
Using Firebug I saw that the responce of GET is: [ ]
and the responce of POST is: { "latitude": 0, "longitude": 0, "box": [ ], "fields": [ ], "keep_points": false }
I'm using the 6.x-2.x-dev of 2010-Oct-12.
Token integration
Hi,
Nice module, very usefull. But I have no idea how to use the Token integration to fill other cck fields. I have a Content type with a cck-field (type: OpenLayers WKT
operations: OpenLayer Geocoder), and some cck-fields for address, postalcode, city, etc.
Can someone help please?
Thanks,
Mike.
Yeah...
I'd be interested in that as well. Can't seem to get it to work.
Thanks
Andreas
Found it
I finally found it. After you've added some extra cck-fields that need to be auto-filled, you'll have to configure the OpenLayers WKT cck-field again. Then there you'll find some options for Autocompletion. Good luck.
Mike.
Nice module!
I'm also testing it at the moment - seems to work very well.
Looking forward to any updates also!
Tokens
The token [thoroughfare] returns the street + number. I would like to have the street and number separately. So, a token for returning the streetname and a token for the (house)number. Is this possible?
Mike.
Tokens
Sorry, double submission.
better maps
I would like to geocode a location in Berlin without an address - but unfortunatley the maps of openlayers don't have enough details. How do I integrate e.g. Google Maps into OpenLayers Geocoder?
Best
Joerg
Re: better maps
This is a standard feature of the openlayers module. Go to the layers tab under: /admin/settings/openlayers/layers and enter your google API key. Then under the presents /admin/settings/openlayers/presets add a new preset with google maps layers as an option. The trick is to set the projection to 900913 or you won't see an option to use the Google maps layers. When you're done, use your new layer as the default, and you should be able to add markers etc with the map even without this module.
This module does however give you the option of just typing Berlin and having the city come up. Works very well so far from what I can see.
Open street maps?
Hi there,
Does this module work with layers other than google such as open street maps?
Cheers,
F
Yes it does, it is a basic
Yes it does, it is a basic feature of the main OpenLayers module.
Problem with openlayers_cck_widget
Hi!
I'm getting this error message since I installed Geocoder.
warning: Parameter 1 to openlayers_cck_widget() expected to be a reference, value given in /opt/lampp/htdocs/drupal/includes/module.inc on line 462.
With openlayers working alone I don't have the message. I see the geocoder field and I get directions when I start writing something but once I select the direction the map never gets centered at that point. I don't know if the warning has something to do with that problem or if those are two different issues. Anyone is receiving the same message?
Thanks
Marcos
I have the same problem
I have now upgraded to Drupal 6.16 and I am getting the same message:
warning: Parameter 1 to openlayers_cck_widget() expected to be a reference, value given in C:......\includes\module.inc on line 462.
Stormfors - Sweden
Did you find a solution to
Did you find a solution to this problem? I'm seeing this in Drupal 6.19
[Edit] I should have mentioned that I am using openlayers gecoder 6.x-2.x-dev with openlayers 6.x-2.0-alpha10
I also was getting the following error:
warning: Parameter 1 to theme_openlayers_geocoder_widget_autocompletion_settings() expected to be a reference, value given in <..path removed..>/drupal/includes/theme.inc on line 656.
When on the same Manage fields page for the openlayers cck widget field.
I fixed both by commenting out the references in both functions:
In sites/all/modules/openlayers/modules/openlayers_cck/openlayers_cck.module l306
//function openlayers_cck_widget(&$form, &$form_state, $field, $items, $delta = 0) {
function openlayers_cck_widget($form, $form_state, $field, $items, $delta = 0) {
and in sites/all/modules/openlayers_geocoder/includes/openlayers_geocoder.theme.inc l7
function theme_openlayers_geocoder_widget_autocompletion_settings(&$form) {
//function theme_openlayers_geocoder_widget_autocompletion_settings($form) {
This latter one fixed the Autocompletion section for me.
Neither function seem to require any of their arguments to be passed by reference. Note I haven't tested these yet. I'll comment here if these raise issues elsewhere
I'd recommend keeping bugs
I'd recommend keeping bugs and support requests in the module's issue queue - it's much easier for the module maintainer to keep track of them there - http://drupal.org/project/issues/openlayers_geocoder
http://www.thomasturnbull.com
http://twitter.com/thomasturnbull
Bug reports here
Openlayers cck http://drupal.org/node/919906
Openlayers geocoder http://drupal.org/node/919898
Explain the Geo Taxonomy Integration
Would this allow you to use your own addresses as taxonomy terms? That way you know you are getting a valid address?
So when the user is typing the address it will autocomplete using the addresses that are taxonomy terms?
Is this right? I could see this as very useful for validating street names or street addresses.
My Wiki Planet
These modules will be great on www.mywikipla.net
Geo-drupalers, you're welcome to join.
Can this be used to do
Can this be used to do reverse geocoding, where you send in long/lat to return address or addresses of places near you.. I'm thinking of looking at the Google Places api for my iPhone app to send long/lat to the server, return location places with name of place, street location etc.. thoughts?
Auto complete non-text CCK field?
I there any way at all to make it auto complete using tokens on a non-text field? At the moment only text fields are showing up in the OpenLayers WKT table. I'd really like to populate a taxonomy with terms generated from OpenLayers tokens like, city name, venue name etc..
Or does anyone know of a module that czn do this.. ive found Geo Taxonomy Geocoder (http://drupal.org/node/861836) but it's not working well and still requires a 'manual entry' in the CCK taxonomy field for its term name.
thanks!
mappingkit postgresql error
Aside from trying to figure out how and where to put my layers and set map area (long, lat, and zoom), I'm getting "can't find postgresql with postgis" error in mappingkit.
As far as I have read, since drupal core is now using mysql, postgresql cannot reside on the same server (even in different directories).
I'm not sure where openlayers ends and mappingkit begins. Maps seems to be working so far except for this error.
So does this mean that I will never get this error to go away and that I must remove mappingkit? I would rather not use google maps.
Thanks for any input
MB