[Rogue] .andOpt with near

7 katselukertaa
Siirry ensimmäiseen lukemattomaan viestiin

Riccardo Sirigu

lukematon,
13.4.2017 klo 8.19.0413.4.2017
vastaanottaja Lift
Hi everyone,

I'm  trying to build the following query

override def page: Seq[Elem] = Elem.whereOpt(...)
   
.andOpt(cityFilter.is)(_.geoAddress near(???, ???, Degrees(0.2)))
   
.fetch()

where cityFilter is 

object cityFilter extends RequestVar[Option[LatLong]](None)

I would like to access to the lat and long fields that are inside the cityFilter but I can't because the compiler spills out type errors

Is there a way to do it?

Thank you in advance

Torsten Uhlmann

lukematon,
13.4.2017 klo 8.47.0913.4.2017
vastaanottaja Lift
Something along these lines might work:

.andOpt(cityFilter.is)((x,latLong) => x.geoAddress near(latLong.lat, latLong.long, Degrees(0.2)))

Let me know if that works,
Torsten.

Riccardo Sirigu

lukematon,
13.4.2017 klo 8.49.1513.4.2017
vastaanottaja Lift
Awesome, thank you Torsten

Torsten Uhlmann

lukematon,
13.4.2017 klo 9.16.3313.4.2017
vastaanottaja lif...@googlegroups.com
Glad I could help!

--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code

---
You received this message because you are subscribed to the Google Groups "Lift" group.
To unsubscribe from this group and stop receiving emails from it, send an email to liftweb+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
AGYNAMIX(R). Passionate Software.
Inh. Torsten Uhlmann | Buchenweg 5 | 09380 Thalheim
Phone:     +49 3721 273445
Fax:         +49 3721 273446
Mobile:     +49 151 12412427
Web:        http://www.agynamix.de
Vastaa kaikille
Vastaa kirjoittajalle
Välitä
0 uutta viestiä