Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#1825 closed bug (fixed)

searchmembers: text/ map search zoomlevel calculation is broken on alpha

Reported by: mahouni Owned by:
Priority: major Milestone: 1.2
Component: BW Search Keywords:
Cc: jsfan, planetcruiser, toub

Description

searching by text is broken on alpha.bewelcome.org...

loading forever

Attachments (1)

searchmember_fix_zoomlevel.patch (848 bytes) - added by sanderr 6 years ago.
Fixes calculation of the zoomlevel

Download all attachments as: .zip

Change History (15)

comment:1 Changed 6 years ago by globetrotter_tt

  • Cc jsfan planetcruiser toub added
  • Milestone changed from unassigned to 1.2

This should be fixed in before the next release. I assign this to 1.2

comment:2 Changed 6 years ago by beatnickgr

Same problem here, i tried with both internet explorer and tor

comment:3 Changed 6 years ago by sanderr

It works if you don't fill in anything.

comment:4 Changed 6 years ago by sanderr

Like mahouni pointed out on the mailinglist, there is no place.geometry.bounds.ea
There is a place.geometry.bounds.ca and a place.geometry.bounds.Z, guess we should use those to calculate the distance.

If you don't fill in a place it will default to zoomlevel 3, which works, since it skips the distance calculation.

comment:5 Changed 6 years ago by shevek

Just tried the map search. As to be expected by the info given in the last comment map search is broken as well.

Changed 6 years ago by sanderr

Fixes calculation of the zoomlevel

comment:6 Changed 6 years ago by sanderr

The attached patch fixes the zoomlevel calculation, but on my install it broke the OSM layer... (?) though I didn't touch it. Could someone have a look?

comment:7 Changed 6 years ago by shevek

Fix worked here. Please commit.

comment:8 Changed 6 years ago by shevek

Found a better solution (starting line 51):

if (place.geometry.viewport){
   var ne = place.geometry.viewport.getNorthEast();
   var sw = place.geometry.viewport.getSouthWest();
   var distance = calculateDistance(ne.lat(), sw.lat(), ne.lng(), sw.lng());
   addressPoint.zoomLevel = calculateZoomLevel(distance);
}else{
   addressPoint.zoomLevel = 3;
}

comment:9 Changed 6 years ago by sanderr

Oh, commit this one then. I just committed the quick fix, but this one's way more elegant.

comment:11 Changed 6 years ago by crumbking

  • Summary changed from searchmembers: text search is broken on alpha to searchmembers: text/ map search zoomlevel calculation is broken on alpha

comment:12 Changed 6 years ago by jsfan

Deployed on alpha.

comment:13 Changed 6 years ago by shevek

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

Works after clearing the cache on Chrome and Firefox. Cache clearing shouldn't be a problem when moving to WWW as all scripts are called with ?1 versions now.

comment:14 Changed 6 years ago by crumbking

tested on alpha, too.

Just add it to the changelog.

Last edited 6 years ago by crumbking (previous) (diff)
Note: See TracTickets for help on using tickets.