Opened 6 years ago

Closed 6 years ago

#1696 closed bug (fixed)

OSM: Search result and mapmarkers are not equal

Reported by: midsch Owned by: toub
Priority: blocker Milestone: 1.2
Component: BW Geo Keywords: OSM
Cc:

Description (last modified by midsch)

Tested on http://rox.mishk.org/searchmembers with Chromium 18.0.1025.168 (Entwickler-Build 134367 Linux) Ubuntu 12.04

Search for "France" (see attached screenshot)

-> 4 results on search list (probably correct)

-> 6 markers on the map (one additional in GB, one in Germany)

Search for "Austria"

-> 0 results on search list (probably correct)

-> 1 marker on the map (in Germany)

-> If you press on map search than, the result in list and on the map is much bigger (obviously this is correct for countries not exactly fitting in a map;), but still different:

-> 8 results in search list

-> 9 markers on the map (the "half" marker from steinwinde is not on the list)

I think this is a minor issue and not blocking the switch to osm, but should be fixed somewhen.

Attachments (1)

screenshot-osm-search-france.jpg (131.9 KB) - added by midsch 6 years ago.
Screenshot from OSM search for "France"

Download all attachments as: .zip

Change History (30)

Changed 6 years ago by midsch

Screenshot from OSM search for "France"

comment:1 follow-up: Changed 6 years ago by midsch

  • Description modified (diff)

comment:2 in reply to: ↑ 1 Changed 6 years ago by mahouni

I can't reproduce that bug with firefox14 on LinuxMint?.

Though it seems that the map cleaning wasn't working properly when you tested. In the screenshot you have two number marks on the map with number 1. That might be a left over from an earlier search request.

comment:3 Changed 6 years ago by toub

I am not able to reproduce on my netbook firefox or chromium, lubuntu.

Midsch, are you able to reproduce the bug? How do you do?

If yes, could you send us the content of javascript console?

Last edited 6 years ago by toub (previous) (diff)

comment:4 Changed 6 years ago by midsch

I'm in a hurry, but was able to reproduce it, mahouni is right, it's a matter of clean up - step by step: Chromium 18.0.1025.168 (Entwickler-Build 134367 Linux) Ubuntu 12.04

http://rox.mishk.org/

login as wukk

-> searchmembers

search for "france" (result is ok, 4/4 although 2 members in paris aren't really visible)

search for "germany" (result is ok, 6/& although 2 members in hamburg aren't really visible)

search for "france" (result is ok, 4/4 although 2 members in paris aren't really visible)

uncheck "yes bewelcome" (upper right corner of the map) -> 2 markers left (nr. 3 is invisible in paris)

check "yes bewelcome" again -> besides the 4 french members you also get a "nr.1" in germany (near swiss)

hope this helps, below the chromium java-console:

OSMMapBuilder.js:45Map "map" initializing... from url http://{s}.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.png using subdomains Array[4] OSMMapBuilder.js:148Center to (25, 10) with zoom level 1. OSMMapBuilder.js:68Map initialized! BWGeosearchMapBuilder.js:31Adding group layers searchmembers.js:39Page loaded. searchmembers.js:84Running text search (address='France', i=0)... BWGoogleMapReverseGeolocator.js:106Try to reverse geolocate address 'France'. BWGoogleMapReverseGeolocator.js:130Search places containing text "France". BWGoogleMapReverseGeolocator.js:133Search places containing text "France" returned 1 results. BWGoogleMapReverseGeolocator.js:16Building address point 'Frankreich' BWGoogleMapReverseGeolocator.js:40Location: BWGoogleMapReverseGeolocator.js:81Zoom level is 5 searchmembers.js:118Search by address point 'Frankreich': 46.227638,2.213749 OSMMapBuilder.js:148Center to (46.227638, 2.213749) with zoom level 5. searchmembers.js:145Loading map (0)... BWGeosearchMapBuilder.js:53Adding layer controls searchmembers.js:149Search members (varsOnLoad=, varSortOrder=, queries=) searchmembers.js:158Search success: processing the results... searchmembers.js:167Parsing results... BWMapSearchResult.js:25Parsing XML response... BWMapSearchResult.js:26 #document BWMapSearchResult.js:56Number of results:4 searchmembers.js:172Adding the pager... BWMapSearchResult.js:99Reading the 4 points... BWMapSearchResult.js:115Combine points summaries when coordinates and accomodation is the same... BWMapSearchResult.js:133Space markers that have the same geo-coordinates... BWMapSearchResult.js:1074 points have been read. searchmembers.js:198Adding the 4 markers... searchmembers.js:310Map succesfully loaded searchmembers.js:84Running text search (address='germany', i=0)... BWGoogleMapReverseGeolocator.js:106Try to reverse geolocate address 'germany'. BWGoogleMapReverseGeolocator.js:130Search places containing text "germany". BWGoogleMapReverseGeolocator.js:133Search places containing text "germany" returned 1 results. BWGoogleMapReverseGeolocator.js:16Building address point 'Deutschland' BWGoogleMapReverseGeolocator.js:40Location: BWGoogleMapReverseGeolocator.js:81Zoom level is 5 searchmembers.js:118Search by address point 'Deutschland': 51.165691,10.451526 OSMMapBuilder.js:148Center to (51.165691, 10.451526) with zoom level 5. searchmembers.js:145Loading map (0)... BWGeosearchMapBuilder.js:53Adding layer controls searchmembers.js:149Search members (varsOnLoad=, varSortOrder=, queries=) searchmembers.js:158Search success: processing the results... searchmembers.js:167Parsing results... BWMapSearchResult.js:25Parsing XML response... BWMapSearchResult.js:26 #document BWMapSearchResult.js:56Number of results:6 searchmembers.js:172Adding the pager... BWMapSearchResult.js:99Reading the 6 points... BWMapSearchResult.js:115Combine points summaries when coordinates and accomodation is the same... BWMapSearchResult.js:133Space markers that have the same geo-coordinates... BWMapSearchResult.js:1076 points have been read. searchmembers.js:198Adding the 6 markers... searchmembers.js:310Map succesfully loaded searchmembers.js:84Running text search (address='france', i=0)... BWGoogleMapReverseGeolocator.js:106Try to reverse geolocate address 'france'. BWGoogleMapReverseGeolocator.js:130Search places containing text "france". BWGoogleMapReverseGeolocator.js:133Search places containing text "france" returned 1 results. BWGoogleMapReverseGeolocator.js:16Building address point 'Frankreich' BWGoogleMapReverseGeolocator.js:40Location: BWGoogleMapReverseGeolocator.js:81Zoom level is 5 searchmembers.js:118Search by address point 'Frankreich': 46.227638,2.213749 OSMMapBuilder.js:148Center to (46.227638, 2.213749) with zoom level 5. searchmembers.js:145Loading map (0)... BWGeosearchMapBuilder.js:53Adding layer controls searchmembers.js:149Search members (varsOnLoad=, varSortOrder=, queries=) searchmembers.js:158Search success: processing the results... searchmembers.js:167Parsing results... BWMapSearchResult.js:25Parsing XML response... BWMapSearchResult.js:26 #document BWMapSearchResult.js:56Number of results:4 searchmembers.js:172Adding the pager... BWMapSearchResult.js:99Reading the 4 points... BWMapSearchResult.js:115Combine points summaries when coordinates and accomodation is the same... BWMapSearchResult.js:133Space markers that have the same geo-coordinates... BWMapSearchResult.js:1074 points have been read. searchmembers.js:198Adding the 4 markers... searchmembers.js:310Map succesfully loaded searchmembers.js:84Running text search (address='france', i=0)... BWGoogleMapReverseGeolocator.js:106Try to reverse geolocate address 'france'. BWGoogleMapReverseGeolocator.js:130Search places containing text "france". BWGoogleMapReverseGeolocator.js:133Search places containing text "france" returned 1 results. BWGoogleMapReverseGeolocator.js:16Building address point 'Frankreich' BWGoogleMapReverseGeolocator.js:40Location: BWGoogleMapReverseGeolocator.js:81Zoom level is 5 searchmembers.js:118Search by address point 'Frankreich': 46.227638,2.213749 OSMMapBuilder.js:148Center to (46.227638, 2.213749) with zoom level 5. searchmembers.js:145Loading map (0)... BWGeosearchMapBuilder.js:53Adding layer controls searchmembers.js:149Search members (varsOnLoad=, varSortOrder=, queries=) searchmembers.js:158Search success: processing the results... searchmembers.js:167Parsing results... BWMapSearchResult.js:25Parsing XML response... BWMapSearchResult.js:26 #document BWMapSearchResult.js:56Number of results:4 searchmembers.js:172Adding the pager... BWMapSearchResult.js:99Reading the 4 points... BWMapSearchResult.js:115Combine points summaries when coordinates and accomodation is the same... BWMapSearchResult.js:133Space markers that have the same geo-coordinates... BWMapSearchResult.js:1074 points have been read. searchmembers.js:198Adding the 4 markers... searchmembers.js:310Map succesfully loaded

comment:5 Changed 6 years ago by toub

Well done, that's a nice bug!

I will have a look on that asap.

comment:6 Changed 6 years ago by toub

  • Owner changed from toub to planetcruiser
  • Status changed from new to assigned

Fixed, merged with develop branch, then pushed to a new temporary branch named "osm": https://gitorious.org/bewelcome/rox/commits/osm

Ready for tests and review.

comment:7 Changed 6 years ago by midsch

I tried the described way and also fooled around with the markers but wasn't able to reproduce this anymore. So I think it's fixed.

comment:8 Changed 6 years ago by crumbking

Tested locally on develop. Lets's move to alpha.... to test with more results.

comment:9 Changed 6 years ago by crumbking

Okay there is a bug on

http://alpha.bewelcome.org/searchmembers

Try Germany, France. First result pages are okay. Second page upwards the "Search is forgotten" and all members are shown randomly

comment:10 Changed 6 years ago by toub

Various parameters are missing in the Ajax query:

  • IdCountry? FR
  • accuracy_level 1
  • place_coordinates 2.213749,46.227638,0

comment:11 Changed 6 years ago by toub

The problem is probably due to the following lines, in searchmembers.js:

reset criterias immediately after request has been sent $('accuracy_level').value = null; $('place_coordinates').value = null; $('IdCountry?').value = null; $('CityName?').value = null;

... but I can not reproduce locally cause I do not have enought data in my database!

comment:12 Changed 6 years ago by mahouni

  • Priority changed from minor to blocker

I changed this ticket to blocker status (on alpha.bewelcome.org).
Only the first page of the pagination returns correct results. It seems to work for cities, but not for regions and countries.

comment:13 Changed 6 years ago by mahouni

when clicking on the page x button this function is called in searchmembers.js:

function hookUpPager(container_id, per_page)

At the end of this function the loadMap(page) is called, but that is too early.

I think I found a solution, but I am not sure if that will do the job and won't break other things:
https://gitorious.org/~mahouni/bewelcome/mahouni-rox/commit/c0d6db779127d2f391f0df3d4ef1ab7b02d2debf

comment:14 Changed 6 years ago by toub

Mahouni, if your patch works we should deploy it to alpha and do massive tests there.

comment:15 Changed 6 years ago by mahouni

okay, I merged the patch to develop. Let's see if it works on alpha.

I tested it locally with a text search for Germany on the testdatabase (set pagination to 3 members per page therefore).

We might need to undo this commit, if it is not working...

comment:16 Changed 6 years ago by jsfan

I'm not sure I really understood the problem but if I did, it looks like it's working for me now. ;)

comment:17 Changed 6 years ago by toub

Still KO.

To reproduce:

  • search for France
  • click on page 2 (or page 3...)
  • expected: only markers in France
  • failed results: markes in Italy, Spain...

Could you please explain me how to reduce pagination to 3 members on my local install?

comment:18 Changed 6 years ago by jsfan

I still cannot reproduce neither on Chromium nor on FF.

The pagination is controlled via input. In the advanced search you have a drop down where you can select the number of results per page (lowest value is 10). To add a value to this drop down, edit

build/searchmembers/templates/filters.php

and look for

<select name="limitcount" class="sval">

comment:19 Changed 6 years ago by mahouni

F5 and then it worked.. ;)

while testing I changed the limitcount variable of the search function in searchmembers.model.php, to a fixed value (and also somewhere in searchmembers.js). I will look at that branch again, if it is still KO. But for me it seems to work now.

Additionally I have set Status to "Active" and Accomodation to "anytime" for all entries of the members table (so at least 180 members to search for instead of 26).

comment:20 Changed 6 years ago by toub

That's working after refreshing (F5)!

After the last deploy on alpha, I suggest to re-test all bugs a last time, since there was a lot of things here, including various regressions.

comment:21 Changed 6 years ago by globetrotter_tt

I noticed a different problem which should probably go to an extra ticket.

Reproduce:

  • search for France
  • click on pages 2,3,4.... -> results are all from France
  • change to "Textview"
  • click on pages 2,3,4.... -> results are mixed (i got profiles from many other countries)

comment:22 Changed 6 years ago by toub

Hmm, I don't know if much people uses textview, but this is an annoying bug, we have to solve it before the release.

comment:23 Changed 6 years ago by planetcruiser

  • Owner changed from planetcruiser to toub

here you go :)

comment:24 Changed 6 years ago by mahouni

mapview and textview seem to work separately. Only after a switch the pagination is broken later.

I would suggest to fix this bug by reducing an unimportant functionality. After switching the map off (or on) you would need to enter the search text again.

comment:25 Changed 6 years ago by mahouni

when changing from mapview to textview and vice versa the search is reinitialised:
https://gitorious.org/bewelcome/rox/commit/3e994e43c3d8ddffded3756a69fc82a0d4321bfa

comment:26 Changed 6 years ago by toub

Hi think that this fix is acceptable, whose of you uses textview?

comment:27 Changed 6 years ago by mahouni

sorry, doesn't work on alpha.

It worked locally but I think I tested it with lines 131+135:

$_SESSION['SearchMembersTList'] = false;

instead of

$_SESSION['SearchMembersTList'] = array();

comment:28 Changed 6 years ago by mahouni

hoppla, I just realized that I confused the commit ids. the current alpha state (7270d89) is still behind the commit to 3e994e4.

comment:29 Changed 6 years ago by jsfan

  • Resolution set to fixed
  • Status changed from assigned to closed

mahouni, just deployed your patch on alpha. Works fine for me. Closing.

Note: See TracTickets for help on using tickets.