Posted by rhymeswithcamera on October 24, 2010 at 7:04pm
8 followers
Jump to:
| Project: | OpenLayers Geocoder |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | major |
| Assigned: | Unassigned |
| Status: | active |
| Issue tags: | Housenumber, Streetname |
Issue Summary
I have two text fields - one displaying the [street_address] and the other displaying the [formatted_address]. No matter what address I enter, the values in these fields are identical. Is this by design? For display purposes, does it make any difference which token I use? And lastly, is there a token that captures just the street address - without the city, state, zip and country?
As a side note: I just discovered OL and these modules yesterday - as I was searching for alternative methods to track and search by location for multiple content types. This is the most exciting discovery I've made in Drupal land since I started my Drupal development journey about 6 weeks ago. Great stuff!
Comments
#1
The [formatted_address] provided the full address which includes all information returned aside from the name of the location, and the [street_address] only gave the actual number within the returned results. If you would like to break down the address into multiple fields this would achieve the functionality you mention I believe which is an address field without city, state, zip, and country.
When creating the content type breakdown the address fields individually as a CCK field so you would have Street[stree_address], City[locality], State[administrative_area_level_1], Zip[postal_code].
It took me a bit to figure out that in order to break down the fields on the Geocoder widget field settings I had to first create each of the individual fields and then change the settings. After I figured that out and the auto-complete(requires the dev version) it was all downhill from there for the implementation on a per node map content.
#2
After further usage of this functionality I'm also having the issue of full address being auto-completed when using only [street_address] which it should only be the street number, and name not to include the city, state, zip info.
#3
I'm upgrading this from a support issue to a bug as there is no solution to fixing the issue. I am curious as to whether or not this could be related to using Google Maps as opposed to say OSM. I wonder if Google Maps geo information has a different token for producing just a [street_address] other than what is being requested.
I have tried editing the code in a couple of places but it didn't fix the issue so I can't provide a patch.
I am currently using dev versions of both Openlayers and Openlayers_Geocoder, and my map layer is using Google normal maps as the base.
My fields include:
Search Address - Openlayers Geocoder Field
Address - Tokenized as [street_address] - Populates full [formatted_address]
City - Tokenized as [locality] - Works as expected.
State - Tokenized as [administrative_area_level_1] - Works as expected.
Zip - Tokenized as [postal_code] - Works as expected
#4
@JoshuaBud: Thanks for your comment in #1. I wrote a tutorial at http://drupal.org/node/1002852
#5
Also having this issue. Would be great if it were possible to parse out the street number along with street name only as [street_address]. Tried playing with openlayers_geocoder.token.inc, but couldn't get it to work. For now using [street_number] [route] works.
#6
Subscribe
#7
In addition to a token for street address which would populate a number and street name, it would be very beneficial to have only street name. I have a requirement on a project to create not only "official" street names but also an alias. The application for this is to allow for a "common" name to be used to search an official list while records are saved with the "official" name as well as the geocoded coordinates.
Great module by the way!
#8
It's not an issue of Openlayers Geocoder. The values are given by Google, so you only have to follow the code that is given by google and use those tokens:
[route] [street_number]
to get a Streetname with the housenumber.
#9
In order to get a "street address" in its common parlance (i.e. the second line when you write an address) I use these tokens:
[street_number] [route] [post_box] [floor] [room]
That covers everything that might be included on that line, under any normal circumstances.
However, this doesn't answer the OP's original question about the difference between the tokens [street_address] (which is the complete address, not just the street address "line") and [formatted_address]. I Googled around but couldn't find a listing of current Google Geocoding values (I found some from v1 and v2 but nothing current) so I guess the question is unresolved.