LocationTextField add-on

LocationTextField is an add-on that geocodes addresses using a configurable geocoder. Any class implementing org.vaadin.addons.locationtextfield.LocationProvider can be used with LocationTextField. There are currently two LocationProvider implementations provided; one using Google’s geocoder and the other using OpenStreetMap’s Nominatim. Adding new implementations is trivial. Results for the geocoded address are available to choose from in a drop-down menu.

Note: It is the user’s responsibility to make sure he or she abides by any rules or requirements for geocoder use. For instance, Google’s geocoder will not even work unless it is used in a browser with GMaps in the DOM. OpenStreetMap has a usage limit upon which they will cut you off; however, MapQuest uses the OpenStreetMap code and has no limit. MapQuest should be added next.

Hi,
first of all thanks for making this addon.

I have a couple of questions:
The first is that I had to add the json/slf4j jars to my widgetset, as I could not make the addon work as a standalone. Is this right or am I missing something?

The other is about the LocationTextField component. I’m getting this error: “Widgetset does not contain implementation for org.vaadin.addons.locationtextfield.LocationTextField.”.
This basically prevents me for using your addon. What should I do to fix it?

There is a problem with the “parent” dependency in the new pom.xml of add-on version 1.2.2. The pom file specifies “org.vaadin.addons:locationtextfield-parent” as parent, but unfortunately this artifact has not been published in the vaadin add-on repository. As a consequence maven fails to find this dependencies when I try to compile my vaadin app. As workaround I went back to version 1.2.1 which works still well with maven.

Version 1.2.6 doe broke maven build (it search without success for parent).
I downloaded all sources, modified some maven props into pom.xml, installed lib on local maven repos and now builds works.

But I cannot build widgedset (I usually have no problem building Vaadin widgetset).

Is there any bug fix for both?

Regards

I downloaded 1.2.6 version of LocationTextField add-on. But I have this error: “Widgetset does not contain implementation for org.vaadin.addons.locationtextfield.LocationTextField…”

What’s wrong?

You have either not compiled the widget set or if you have, you have some classpath problem in the compilation so that it doesn’t include the add-on JAR.

I compiled and had no errors.


Compiling widgetset com.graphics.widgetset.BBTWidgetset
Updating GWT module description file...
Nov 20, 2012 4:25:01 PM com.vaadin.terminal.gwt.widgetsetutils.ClassPathExplorer getAvailableWidgetSets
INFO: Widgetsets found from classpath:
	org.vaadin.hezamu.googlemapwidget.widgetset.GooglemapwidgetWidgetset in jar:file:/workspace/BBT/WebContent/WEB-INF/lib/googlemapwidget-0.9.13.jar!/
	com.vaadin.terminal.gwt.DefaultWidgetSet in jar:file:/workspace/BBT/WebContent/WEB-INF/lib/vaadin-6.8.5.jar!/
	org.vaadin.addons.locationtextfield.LocationTextFieldWidgetset in jar:file:/workspace/BBT/WebContent/WEB-INF/lib/locationtextfield-1.2.6.jar!/
	com.graphics.widgetset.BBTWidgetset in file:/workspace/BBT/src
	com.invient.vaadin.charts.widgetset.InvientChartsWidgetset in jar:file:/workspace/BBT/WebContent/WEB-INF/lib/invientcharts-0.8.6.jar!/

Nov 20, 2012 4:25:02 PM com.vaadin.terminal.gwt.widgetsetutils.ClassPathExplorer getAvailableWidgetSets
INFO: Search took 70ms
Done.
Starting GWT compiler
Nov 20, 2012 4:26:09 PM com.vaadin.terminal.gwt.widgetsetutils.ClassPathExplorer getPaintablesHavingWidgetAnnotation
INFO: Searching for paintables..
Nov 20, 2012 4:26:14 PM com.vaadin.terminal.gwt.widgetsetutils.ClassPathExplorer getPaintablesHavingWidgetAnnotation
INFO: Search took 4992ms
Widgetset compilation completed

Have no ideas how to solve that…

Can anyone help??

Hi,

First of all thank to all the vaadin team and community !

I have also the same problem (went through all the forum post I think) and I don’t know how to solve this.

I am a newbie, might be on my side, but event with copying the demo code on git (https://github.com/markathomas/LocationTextField/tree/master/demo) I do have the same troubles. I miss something I know…

Thanks for the help !



UPDATE > 19 Feb 2013

I don’t know if it will help, but I achieved to make it work on eclipse with version 1.2.1


Quick history :

1 - I find a project on github using this addon, with a maven build :
https://github.com/carlos-salinas/router.planner
. Thanks for the person who posted this project on github !

2 - tested it on eclipse juno with m2e and m2e-wtp > errors on the pom.xml (at that time it was mainly my fault, but I’ll explain)

3 - tested it then with intellij idea (community). WORKED, automagically
As I won’t buy itellij licences (this is a personnal project) and the community doesn’t allow to debug on tomcat (without remote connexion), I decided to try make it working on eclipse.

4 - adapted the pom form the former projet to make it work on eclipse with my project.

5 - this ressource helped to understand why eclipse wasn’t happy with the pom.xml file :
http://stackoverflow.com/questions/8523737/getting-error-plugin-execution-not-covered-by-lifecycle-configuration-with-gwt
. Then I adapted my pom.xml for eclipse and

6 - as I did, please do not forget to create the blablawidgetset.gwt.xml (created by eclipse vaadin plugin when you use it)

7 - too, don’t forget to modify the web.xml…

I hope I’m clear and this post is not stupid…

Anyway thanks to vaadin team this famework is really great !

I have alos problems that the widgetset is not compiled. I have put the add-on file and also all jars from the lib folder to the lib folder of the application. And however when I compile the widgetset the add-on jar is found. But during compilation of the widgets there is no information that the widget is compiled.

The jar file is found:


INFO: Widgetsets found from classpath:
	at.test.ClubadminportalWidgetset
	com.github.wolfie.refresher.RefresherApplicationWidgetset
	com.vaadin.terminal.gwt.DefaultWidgetSet
	org.vaadin.vaadinvisualizations.widgetset.VaadinvisualizationApplicationWidgetset
	org.vaadin.addons.locationtextfield.LocationTextFieldWidgetset
	org.vaadin.codemirror.CodemirrorWidgetset
	org.vaadin.sasha.portallayout.PortallayoutWidgetset
	com.vaadin.addon.calendar.gwt.CalendarWidgetset

But there is no information that the widgetset is compiled:


Widget set will contain implementations for following components: 
               	com.github.wolfie.refresher.Refresher
               	com.vaadin.addon.calendar.ui.Calendar
               	com.vaadin.ui.AbsoluteLayout
               	com.vaadin.ui.Accordion
               	com.vaadin.ui.Audio
               	com.vaadin.ui.Button
               	com.vaadin.ui.CheckBox
               	com.vaadin.ui.ComboBox
               	com.vaadin.ui.CssLayout
               	com.vaadin.ui.CustomComponent
               	com.vaadin.ui.CustomLayout
               	com.vaadin.ui.DateField
               	com.vaadin.ui.DragAndDropWrapper
               	com.vaadin.ui.Embedded
               	com.vaadin.ui.Form
               	com.vaadin.ui.FormLayout
               	com.vaadin.ui.GridLayout
               	com.vaadin.ui.HorizontalLayout
               	com.vaadin.ui.HorizontalSplitPanel
               	com.vaadin.ui.InlineDateField
               	com.vaadin.ui.Label
               	com.vaadin.ui.Link
               	com.vaadin.ui.ListSelect
               	com.vaadin.ui.MenuBar
               	com.vaadin.ui.NativeButton
               	com.vaadin.ui.NativeSelect
               	com.vaadin.ui.OptionGroup
               	com.vaadin.ui.OrderedLayout
               	com.vaadin.ui.Panel
               	com.vaadin.ui.PasswordField
               	com.vaadin.ui.PopupView
               	com.vaadin.ui.ProgressIndicator
               	com.vaadin.ui.RichTextArea
               	com.vaadin.ui.Select
               	com.vaadin.ui.Slider
               	com.vaadin.ui.SplitPanel
               	com.vaadin.ui.TabSheet
               	com.vaadin.ui.Table
               	com.vaadin.ui.TextArea
               	com.vaadin.ui.TextField
               	com.vaadin.ui.Tree
               	com.vaadin.ui.TreeTable
               	com.vaadin.ui.TwinColSelect
               	com.vaadin.ui.Upload
               	com.vaadin.ui.UriFragmentUtility
               	com.vaadin.ui.VerticalLayout
               	com.vaadin.ui.VerticalSplitPanel
               	com.vaadin.ui.Video
               	com.vaadin.ui.Window
               	org.vaadin.codemirror.CodeMirror
               	org.vaadin.sasha.portallayout.PortalLayout
               	org.vaadin.vaadinvisualizations.AnnotatedTimeLine
               	org.vaadin.vaadinvisualizations.AreaChart
               	org.vaadin.vaadinvisualizations.AreaChartImage
               	org.vaadin.vaadinvisualizations.BarChart
               	org.vaadin.vaadinvisualizations.BarChartImage
               	org.vaadin.vaadinvisualizations.ColumnChart
               	org.vaadin.vaadinvisualizations.Gauge
               	org.vaadin.vaadinvisualizations.GeoMap
               	org.vaadin.vaadinvisualizations.ImageChart
               	org.vaadin.vaadinvisualizations.IntensityMap
               	org.vaadin.vaadinvisualizations.LineChart
               	org.vaadin.vaadinvisualizations.LineChartImage
               	org.vaadin.vaadinvisualizations.Map
               	org.vaadin.vaadinvisualizations.MotionChart
               	org.vaadin.vaadinvisualizations.OrganizationalChart
               	org.vaadin.vaadinvisualizations.PieChart
               	org.vaadin.vaadinvisualizations.PieChartImage
               	org.vaadin.vaadinvisualizations.ScatterChart
               	org.vaadin.vaadinvisualizations.SparklineImage
               	org.vaadin.vaadinvisualizations.Table

Do I have to do anything with the gwt-jar, make a reference in web.xml?
However the widget is not compiled and therefor it will not work.

Thanks for your help,
Florian

It doesn’t work on my pc. can you add a working demo?

Hi!
First of all thanks, it works pretty good. The only problem is that I can’t change the css styles that define the suggest box popup. I’ve tried by adding this code to my scss but didn’t work:

  table td{
      font-family: $v-font-family !important;
  }

  .gwt-SuggestBoxPopup {
    padding: 4px 4px;
    border-radius: 4px;
    background-color: white;
    color: #474747;
    -webkit-box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.14);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.14);
    -webkit-backface-visibility: hidden;
    -moz-backface-visibility: hidden;
    -ms-backface-visibility: hidden;
    backface-visibility: hidden;
    padding: 6px 0;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
    margin-top: 4px;
  }

Any ideas?
Thanks in advance

Matias, did u find out CSS issue in suggestbox?

Hey Damian, I didn’t :frowning:

Ok, i guess the only way is changing the addon.

Download addon from repo - https://github.com/markathomas/LocationTextField
edit styles.css with the style from valo

.gwt-SuggestBoxPopup {
    font: 300 16px/1.55 "Open Sans", sans-serif;
    padding: 4px 4px ;
     border-radius: 4px ;
     background-color: white ;
     color: #474747 ;
     -webkit-box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.1), 0 3px 5px 0 rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.09098) ;
     box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.1), 0 3px 5px 0 rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.09098) ;
     -webkit-backface-visibility: hidden ;
     -moz-backface-visibility: hidden ;
     -ms-backface-visibility: hidden ;
     backface-visibility: hidden ;
     padding: 4px 4px ;
     -webkit-box-sizing: content-box ;
     -moz-box-sizing: content-box ;
     box-sizing: content-box ;
     position: relative ;
     z-index: 1 ;
     display: block ;
}

.v-locationtextfield .item {
     cursor: pointer  ;
         line-height: 27px ;
         padding: 0 20px 0 10px ;
         border-radius: 3px ;
         font-weight: 400 ;
         white-space: nowrap ;
         position: relative ;
         height: 27px ;
         box-sizing: border-box ;
         text-overflow: ellipsis ;
         overflow-x: hidden ;
}
.v-locationtextfield .item-selected {
    background-color: #197de1 ;
        background-image: -webkit-linear-gradient(top, #1b87e3 2%, #166ed5 98%) ;
        background-image: linear-gradient(to bottom,#1b87e3 2%, #166ed5 98%) ;
        color: #ecf2f8 ;
        text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.05) ;
}

edit pom.xml in locationtextfield project, increase version number.
mvn clean compile install
or add jar to your own repo.

in your main project type new version of addon, compile widget set and viola. You are done.

Thanks for the LocationTextField add on.

It seems it has a problem when try to set its styleName to be inside icon.
The icon and input prompt will be overlapped each other. Don’t know why.

This won’t happend with the TextField component.