p:autocomplete populated by Google Maps address data?

UI Components for JSF
Post Reply
smithh032772
Posts: 6144
Joined: 10 Sep 2011, 21:10

03 Jan 2012, 02:03

I'd like to do the following:

1. Avoid purchasing Google maps API license, if possible
2. Add p:autocomplete to xhtml/jsf that can provide Address-data suggestions where the source is a reliable source of valid addresses data like Google Maps (API).

Another/related topic:

I analyzed PrimeFaces Gmap component and Google Maps API (geocoder javascript object), and I see that latitude/longitude coordinates are necessary when instantiating or initializing Gmap component. When I'm ready to output Address information via PrimeFaces mobile, I'd like to expose Address data stored in my database via Gmap component; I really don't want to have to use latitude/longitude data, unless there is a reliable cost-free way of doing so via Google Maps API or some other Address-data-vendor/provider.

someone please let me know your thoughts/advice/recommendations.

Thanks,
Howard
Howard

PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome

Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache

BigBwana
Posts: 71
Joined: 29 Dec 2011, 03:45

03 Jan 2012, 04:40

I was looking at Google Map Geocoder stuff earlier today and it looks like there are limits to the number of addresses you can look up on a daily basis.
http://code.google.com/apis/maps/docume ... ng/#Limits
I may be wrong, but my interpretation is that it looks like you can access up to 2,500 items/day without a license, then you can access up to 100,000/day with a license.

I suspect there are services that you could subscribe to in order to get Address<->LatLon coordinate information other than Google Maps, but I'm sure these have associated fees.
I am not aware of any other "free" services besides Google Maps.

Depending on the size of your database, and the amount of addresses you need to access each day, I would suggest that you consider trying to accumulate your database over time.
When you attempt to access an address and get it's lat/lon coordinates, check to see if you have that information in your database, if not, then get it and save it.
If you are a small environment, then you should be able to accumulate your information over time without having to obtain a business license.
If you are a large environbment, then get a Google Map business license (at least while you build your database), or else just bite the bullet and consider it as the cost of doing business.

<caveat emptor>
I do not know the legality of fetching and storing this information, so consult your attorney.
PrimeFaces 3.0 / 3.2, Mobile 0.9.2, Glassfish 3.1.1 (Mojarra 2.1.3), NetBerans 7.1

smithh032772
Posts: 6144
Joined: 10 Sep 2011, 21:10

03 Jan 2012, 06:32

Thanks BigBwana for the response; I viewed/found that page about the Limits as well, and I did see the 2,500 items per day, but I didn't know that the 2,500 items per day can be requested without a license. Interesting.

1. So, it should be possible to use Google Maps API (geocoder) to request a list of addresses if JSF/Primefaces web app end user is beginning to type/enter an address in a p:inputText or h:inputText, and I can write some type of Javascript that calls Google Maps API (geocoder) to 'autocomplete' enduser entry?

2. Yes, we are small business, and will definitely not reach or exceed 2,500 items per day; I think the maximum items per day will be less than 100, possiby.

3. Today, I was reviewing geocoder in Google Maps API (reference page), and I saw that geocoder returns an error status that says UNAUTHORIZED web site or something like that. That made me assume that web sites are authorized after purchasing business license. :(

Per your response, I'll have to see if I can access geocoder. Please let me know your response to what I mentioned above.
Howard

PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome

Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache

BigBwana
Posts: 71
Joined: 29 Dec 2011, 03:45

03 Jan 2012, 08:25

The 2,500 hits without a license was my interpretation, but I think it would be hard to put the API out there and require a license before it could be used by the generic user.

1) I came from an IceFaces environment where they have server side geocoder implementation. I suggested a while back that PrimeFaces incorporate geocoder capabilities when they first enabled their gmap implementation. I was told that was on the list of things to do, and thought it was to be in the 3.0 release, but apparently not. I do not know how you would implement client side geocoder info to create an "autocomplete" end user entry. Personally, I am at a loss to explain why PrimeFaces did not implement server side geocoder functionality like IceFaces has had for a couple of years. I do not know how many people relate to lat/lng coordinates in their real life as opposed to address info.

2) Hopefully, you can use the "free" implementation for your application. I am dealing with an environment where there may be a need to access more than 2,500 hits because I have some real-time tracking involved and potentially a fairly large client base internationally.

3) From the example I managed to find, I saw a return status, but I do not know what all the statuses are. I do know that I have not purchased a license and can access the geocoder functionality. From what I went through to get my application to get an address from a LatLng object, I come away with the impression that when you are using client side access like I was doing, it is browser dependent. Unfortunately, I do not have the web references to document the stuff I went through to get the code I used to enable me to get an address from the google map geocoder - should have documented that. I was using IE9.

I have given the code in my other post on fetching addresses . viewtopic.php?f=3&t=17266
PrimeFaces 3.0 / 3.2, Mobile 0.9.2, Glassfish 3.1.1 (Mojarra 2.1.3), NetBerans 7.1

smithh032772
Posts: 6144
Joined: 10 Sep 2011, 21:10

03 Jan 2012, 19:00

Thanks for the response. I did some research last night related to Google Maps API and I hope to integrate Google Maps API on server-side via RestFUL web service at some point. I bookmarked this topic for later reference. Thanks again.
Howard

PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome

Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 46 guests