Closed (duplicate)
Project:
OpenLayers Geocoder
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Apr 2010 at 15:51 UTC
Updated:
20 Jul 2011 at 18:22 UTC
When you search for an adress with the Geocoder and then select one of the adresses returnd by the autocomplete no Geometry is beeing added into the WKT textfield of OpenLayers Module.
Reason for this is, that the Javascript function Drupal.Geocoder.process was adding the feature onto the first vector layer of the Map. The new dev version of the OpenLayers Module adds the features to the last vector layer.
This can easily be fixed. I've provided a patch file. See line 69.
Greetings,
Ondrej
Comments
Comment #1
ademarco commentedCould you attach the patch you are talking about? Thanks a lot!
Comment #2
hefox commentedSubscribe; as they said, your patch file isn't attached! :(
Comment #3
asb commentedSimilar issue here.
Example procedure (please try to reproduce): On the node editing form, do an address search for "Kenia". The Google webservice responds with one record: "Kenia", and the OpenStreetMap map is adjusted to show a marker at the South Pole (yeah!). The geodata field remains empy. On the saved node a world map without any markers is displayed. Pretty strange behaviour... ;)
Modules used:
The CCK field type I'm using is "Geospatial data". It's exactly the same behaviour if I'm using the field type "OpenLayers WKT".
Edit: Upgraded to openlayers 6.x-2.x-dev, still exactly the same behaviour.
Thanks & greetings, -asb
Comment #4
ademarco commentedCould you try to also upgrade Openlayers Geocoder to 6.x-2.x-dev? It should be fixed there...
Comment #5
asb commentedYeah, lets go bleeding edge ;) Now running openlayers_geocoder 6.x-2.x-dev 2010-Apr-26. Still exactly the same behaviour.
Probably I'm missing something; currently I'm using the field type "OpenLayers WKT" with the input widget "OpenLayers Geocoder". Other field settings:
[country_code]Anything else I can check?
Update: After clearing all caches (through 'admin_menu', the behaviour changed a little bit: On the node editing form, do an address search for "Libyien" (= Libya). The Google webservice responds with one record: "Libyen", and the OpenStreetMap map is correctly positioned to show a marker at Libya (that one in north Afrika - yippie!). The geodata field remains empy, the ISO Country Code field is correctly populated. On the saved node a world map without any markers is displayed. This now works similar with "Kenia". Still strange behaviour... ;)
Thanks & greetings, -asb
Comment #6
kostajh commentedI am having the same problem described in #3. Using latest dev release (as of 4/29/10) of OpenLayers and OpenLayers Geocoder.
Comment #7
ademarco commentedI really cannot replicate using the latest snapshots of both modules. Could you guys give me more information about your settings or, if possible, could you attach an export of your configuration (layers and presets)? Thanks!
Comment #8
ademarco commentedOk, I managed to replicate. The problem is when there are more then one vector layer on a preset used for input. I'll work on it as soon as possible.
Comment #9
ademarco commentedFixed and committed to HEAD: http://drupal.org/cvs?commit=361476
Comment #10
asb commentedUpgraded to the latest openlayers_geocoder 6.x-2.x-dev 2010-Apr-30 which should contain the fix (or was it commit time plus 10 hrs?)
Behaviour so far still unchanged in comparison to the last dev release from 26th of April (#5). I'll re-check in a few hours if a new dev release pops up.
Comment #11
ademarco commentedIf you don't want to wait for the packaging script try with a CVS checkout: http://drupal.org/node/638988/cvs-instructions/DRUPAL-6--2
Comment #12
hefox commentedIt works for me!
Latest dev of both; there's an error on the configuration page, but that is likely unrelated (probably an error in dev of openlayers, I'll check it out later warning: Invalid argument supplied for foreach() in /volumes/crwdev-ebs1/www/hfs/bell/drupal/sites/all/modules/contrib/openlayers/includes/openlayers.render.inc on line 23.)
Comment #13
asb commentedOk, upgrades installed; indeed this is working much better now: Searching for "Japan" fills the WKT test area ("GEOMETRYCOLLECTION(POINT(138.252924 36.204824))"), and some tokens are correctly extracted. Great!
However, when accessing any node with an OpenLayers map on it, I'm getting a JavaScript popup saying: "with map.options" (nothing else).
Maybe just another issue (searching...) Edit: Seems to have to do nothing with 'OpenLayers Geocoder' - it still pops up when the geocoder is disabled.
Thanks for the fix & greetings, -asb
Comment #14
ademarco commentedComment #15
asb commentedSeems to be broken again after fixing the issue mentioned in #13: #787294: JavaScript popup saying: "with map.options"
Comment #16
asb commentedRe-checked all settings, reset all OpenLayers presets and styles, still broken.
Re-opening, sorry!
Edit: This seems to be a bit erratic; on some nodes it works, on othes it doesen't. Still testing to find apattern.
Comment #17
ademarco commentedComment #18
pribeh commentedsubscribing.
Comment #19
steinmb commentedHave not seen this error in the latest dev. snapshots
@asb: Any news from your testing?
Comment #20
asb commented@steinmb:
Last time I checked the behaviour was still there, appearing erratic (as reported in #16). I tried to reproduce it on another site and ran into additional issues and finally gave up in trying to keep this working. I haven't touched geocoding for several weeks and disabled the module, but not yet uninstalled.
OpenLayers Geocoder is well-thought and and user-friendly, in short: extremely cool, but it's basics - OpenLayers - are currently imho the total opposite (intransparent, user-unfriendly, inconsistent). However, if time permits I'll give it another try.
Comment #21
itserich commentedThis may be related: http://drupal.org/node/919162
Comment #22
ademarco commentedCould some of you guys check it again with the latest dev version of both modules? Since #919162: WKT Field does not update if "Search address" originally not populated is for sure not related with this one there are good chances that the problem is now fixed (I still don't have it). Thanks!
Comment #23
ckng[-deleted-]
not a similar problem, wrong settings.
Comment #24
ademarco commentedClosing since I really cannot reproduce: the problem seems to not be there anymore.
Comment #25
jason.lally@gmail.com commentedThis has been closed for a while now, but I seem to be having the same problem. I am running two sites and on one site it works and on another it does not. I have the exact same versions of openlayers and openlayers geocoder installed on each site. What I noticed that differs is the following:
On the working site, the geocoder calls the following through ajax:
http://placematters.org/openlayers/geocoder/response/denver
And returns the following JSON:
{ "Denver, CO, USA": "\x3cspan class=\"openlayers-geocoder-result detail-row-1\"\x3eDenver, CO, USA\x3c/span\x3e\n\x3cspan class=\"openlayers-geocoder-result detail-row-2\"\x3e Denver - United States\x3c/span\x3e" }
On the non-working site, the url is formed this way:
http://staging.nrvlivability.org/autocomplete_element/js?path=openlayers...
And returns the same JSON.
The most important difference between the two is that the response process that runs fine on the working site calling:
http://placematters.org/openlayers/geocoder/response/process
And returning:
{ "latitude": 39.7391536, "longitude": -104.9847034, "box": { "north": 39.8762981, "east": -104.7285846, "south": 39.6017356, "west": -105.2408222 }, "fields": { "field_street": { "value": " ", "name": "field_street", "override": 0, "type": "input" }, "field_city": { "value": "Denver", "name": "field_city", "override": 0, "type": "input" }, "field_state": { "value": "Colorado", "name": "field_state", "override": 0, "type": "input" }, "field_zip": { "value": "", "name": "field_zip", "override": 0, "type": "input" } }, "keep_points": 0 }
When I select a result on the non-working site, nothing is called or processed and the WKT field never gets populated.
I can't seem to trace where this is happening, but it seems like a piece of Javascript isn't getting loaded. Any insights?
Jason
Comment #26
jason.lally@gmail.com commentedI figured out the issue. This is only a problem when Autocomplete Element is enabled. I didn't need that module so I just disabled it, but it may be worth something looking into. I'm not sure where the problem happens, but autocomplete element uses a different autcomplete plugin that is more configurable than core.
I have created a new issue at: #1224746: Autocomplete Element module breaks geocoder
Comment #27
jason.lally@gmail.com commentedClosing