Re: Gmap3 Geocoding shows Status 610

2013-04-03 Thread vp143
The new code works for me!!
Thanks again!



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Gmap3-Geocoding-shows-Status-610-tp4657298p4657703.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Gmap3 Geocoding shows Status 610

2013-03-22 Thread Martin Grigorov
Hi,

Wicket 6.7.0 will be cut today and if everything is OK released early next
week. Then we will release WicketStuff 6.7.0.
In the meantime you can build wicketstuff-gmap3 locally and test it.
Otherwise you'll have to wait another month if you find there is a bug in
the current version.


On Fri, Mar 22, 2013 at 12:39 AM, vp143 vishal.po...@cipriati.co.uk wrote:

 Thank you very much for this Dieter and Martin!

 One other question, when will wicketstuff gmap3 be packaged up? I normally
 pick up the jar from maven central.

 Thanks
 Vishal



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Gmap3-Geocoding-shows-Status-610-tp4657298p4657429.html
 Sent from the Users forum mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com http://jweekend.com/


Re: Gmap3 Geocoding shows Status 610

2013-03-21 Thread vp143
Thank you very much for this Dieter and Martin!

One other question, when will wicketstuff gmap3 be packaged up? I normally
pick up the jar from maven central.

Thanks
Vishal



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Gmap3-Geocoding-shows-Status-610-tp4657298p4657429.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Gmap3 Geocoding shows Status 610

2013-03-19 Thread Dieter Tremel
I tried to fix it by using the json library from json.org:
dependency
groupIdorg.json/groupId
artifactIdjson/artifactId
version20090211/version
/dependency

I changed GeoCoder.java, GeoCoderException.java, and improved
GeoCoderTest.java which run without complains. Sorry, I never committed
to github or any other open source project. If you think I should do so,
please give me some short instruction what I should do.

Dieter Tremel

The central part of Geocoder is
private final String output = OUTPUT_JSON;

public GLatLng decode(String response) throws GeocoderException {
try {
JSONObject jsonResponse = new JSONObject(response);
GeocoderException.GeocoderStatus status =
GeocoderException.GeocoderStatus.valueOf(jsonResponse.getString(status));
if (status != GeocoderException.GeocoderStatus.OK) {
throw new GeocoderException(status);
}
JSONArray results = jsonResponse.getJSONArray(results);
JSONObject location =
results.getJSONObject(0).getJSONObject(geometry).getJSONObject(location);
return new GLatLng(location.getDouble(lat),
location.getDouble(lng));
} catch (JSONException ex) {
Logger.getLogger(Geocoder.class.getName()).log(Level.SEVERE,
null, ex);
throw new
GeocoderException(GeocoderException.GeocoderStatus.PARSER_ERROR);
}
}

public String encode(final String address) {
//changed since this was Google API V2, see
https://developers.google.com/maps/documentation/geocoding/
//return http://maps.google.com/maps/geo?q=; +
urlEncode(address) + output= + output;
StringBuilder sb = new
StringBuilder(http://maps.googleapis.com/maps/api/geocode/;);
sb.append(output);
sb.append(?);
sb.append(address=).append(urlEncode(address));
sb.append(sensor=false);
return sb.toString();
}

Am 18.03.2013 15:27, schrieb Dieter Tremel:
 Am 16.03.2013 22:43, schrieb Vishal Popat:
 I am using GMap3 from here: 
 https://github.com/wicketstuff/core/tree/master/jdk-1.6-parent/gmap3-parent/gmap3.
  My Geocoding has recently stopped working and is showing Status 610. Google 
 searching shows that this is all related to GMap2 being deprecated etc 
 (There maybe other reasons why I am getting a 610).

 However, when looking here: 
 https://github.com/wicketstuff/core/blob/master/jdk-1.6-parent/gmap3-parent/gmap3/src/main/java/org/wicketstuff/gmap/geocoder/Geocoder.java.
  The encoding url looks like it is from Gmap v2 (see here: 
 https://developers.google.com/maps/documentation/geocoding/index), which 
 would explain the 610.

 Am I mistaken?
 
 Hello Vishal,
 
 I have the same problem and think you are right. Geocoder#encode in
 Version 6.5.0 uses an old URL and parses the return value as CSV,
 whereas https://developers.google.com/maps/documentation/geocoding/ only
 talks about JSON and XML return values. The unit test of Geocoder fails
 with error code 610.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Gmap3 Geocoding shows Status 610

2013-03-19 Thread Martin Grigorov
Hi Dieter,

Welcome to the Open Source community! :-)
You can follow the guide at https://help.github.com/articles/fork-a-repo to
send a Pull Request with your fix.
If you have not time for this then please send me the changes in .patch
format and I will apply them for you.


On Tue, Mar 19, 2013 at 11:37 AM, Dieter Tremel
tre...@tremel-computer.dewrote:

 I tried to fix it by using the json library from json.org:
 dependency
 groupIdorg.json/groupId
 artifactIdjson/artifactId
 version20090211/version
 /dependency

 I changed GeoCoder.java, GeoCoderException.java, and improved
 GeoCoderTest.java which run without complains. Sorry, I never committed
 to github or any other open source project. If you think I should do so,
 please give me some short instruction what I should do.

 Dieter Tremel

 The central part of Geocoder is
 private final String output = OUTPUT_JSON;

 public GLatLng decode(String response) throws GeocoderException {
 try {
 JSONObject jsonResponse = new JSONObject(response);
 GeocoderException.GeocoderStatus status =
 GeocoderException.GeocoderStatus.valueOf(jsonResponse.getString(status));
 if (status != GeocoderException.GeocoderStatus.OK) {
 throw new GeocoderException(status);
 }
 JSONArray results = jsonResponse.getJSONArray(results);
 JSONObject location =

 results.getJSONObject(0).getJSONObject(geometry).getJSONObject(location);
 return new GLatLng(location.getDouble(lat),
 location.getDouble(lng));
 } catch (JSONException ex) {
 Logger.getLogger(Geocoder.class.getName()).log(Level.SEVERE,
 null, ex);
 throw new
 GeocoderException(GeocoderException.GeocoderStatus.PARSER_ERROR);
 }
 }

 public String encode(final String address) {
 //changed since this was Google API V2, see
 https://developers.google.com/maps/documentation/geocoding/
 //return http://maps.google.com/maps/geo?q=; +
 urlEncode(address) + output= + output;
 StringBuilder sb = new
 StringBuilder(http://maps.googleapis.com/maps/api/geocode/;);
 sb.append(output);
 sb.append(?);
 sb.append(address=).append(urlEncode(address));
 sb.append(sensor=false);
 return sb.toString();
 }

 Am 18.03.2013 15:27, schrieb Dieter Tremel:
  Am 16.03.2013 22:43, schrieb Vishal Popat:
  I am using GMap3 from here:
 https://github.com/wicketstuff/core/tree/master/jdk-1.6-parent/gmap3-parent/gmap3.
 My Geocoding has recently stopped working and is showing Status 610. Google
 searching shows that this is all related to GMap2 being deprecated etc
 (There maybe other reasons why I am getting a 610).
 
  However, when looking here:
 https://github.com/wicketstuff/core/blob/master/jdk-1.6-parent/gmap3-parent/gmap3/src/main/java/org/wicketstuff/gmap/geocoder/Geocoder.java.
 The encoding url looks like it is from Gmap v2 (see here:
 https://developers.google.com/maps/documentation/geocoding/index), which
 would explain the 610.
 
  Am I mistaken?
 
  Hello Vishal,
 
  I have the same problem and think you are right. Geocoder#encode in
  Version 6.5.0 uses an old URL and parses the return value as CSV,
  whereas https://developers.google.com/maps/documentation/geocoding/ only
  talks about JSON and XML return values. The unit test of Geocoder fails
  with error code 610.


 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com http://jweekend.com/


Re: Gmap3 Geocoding shows Status 610

2013-03-19 Thread Dieter Tremel
Am 19.03.2013 13:25, schrieb Martin Grigorov:
 Welcome to the Open Source community! :-)
 You can follow the guide at https://help.github.com/articles/fork-a-repo to
 send a Pull Request with your fix.
 If you have not time for this then please send me the changes in .patch
 format and I will apply them for you.

Hi Martin,

After some drops of sweat I succeeded in
https://github.com/wicketstuff/core/pull/203

Hope I did it all well. Would be glad if my changes are accepted and I
can contribute.

By the way, this is a great community here in this list, I am often
surprised how fast and well the users get help. Thank to all for it.

Dieter

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Gmap3 Geocoding shows Status 610

2013-03-19 Thread Martin Grigorov
On Tue, Mar 19, 2013 at 5:09 PM, Dieter Tremel tre...@tremel-computer.dewrote:

 Am 19.03.2013 13:25, schrieb Martin Grigorov:
  Welcome to the Open Source community! :-)
  You can follow the guide at https://help.github.com/articles/fork-a-repoto
  send a Pull Request with your fix.
  If you have not time for this then please send me the changes in .patch
  format and I will apply them for you.

 Hi Martin,

 After some drops of sweat I succeeded in
 https://github.com/wicketstuff/core/pull/203

 Hope I did it all well. Would be glad if my changes are accepted and I
 can contribute.

 By the way, this is a great community here in this list, I am often
 surprised how fast and well the users get help. Thank to all for it.


Your PR is merged!
Thank you!


  Dieter

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com http://jweekend.com/


Re: Gmap3 Geocoding shows Status 610

2013-03-18 Thread Dieter Tremel
Am 16.03.2013 22:43, schrieb Vishal Popat:
 I am using GMap3 from here: 
 https://github.com/wicketstuff/core/tree/master/jdk-1.6-parent/gmap3-parent/gmap3.
  My Geocoding has recently stopped working and is showing Status 610. Google 
 searching shows that this is all related to GMap2 being deprecated etc (There 
 maybe other reasons why I am getting a 610).
 
 However, when looking here: 
 https://github.com/wicketstuff/core/blob/master/jdk-1.6-parent/gmap3-parent/gmap3/src/main/java/org/wicketstuff/gmap/geocoder/Geocoder.java.
  The encoding url looks like it is from Gmap v2 (see here: 
 https://developers.google.com/maps/documentation/geocoding/index), which 
 would explain the 610.
 
 Am I mistaken?

Hello Vishal,

I have the same problem and think you are right. Geocoder#encode in
Version 6.5.0 uses an old URL and parses the return value as CSV,
whereas https://developers.google.com/maps/documentation/geocoding/ only
talks about JSON and XML return values. The unit test of Geocoder fails
with error code 610.

Unfortunately I changed a few weeks ago from an own solution to the
wicketstuff gmap3 solution for not to reinvent the wheel. Now I will
have a look at my solution again.

Martin, is there an issue for this or should we open one?

Dieter


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Gmap3 Geocoding shows Status 610

2013-03-16 Thread Vishal Popat
Hi,

I am using GMap3 from here: 
https://github.com/wicketstuff/core/tree/master/jdk-1.6-parent/gmap3-parent/gmap3.
 My Geocoding has recently stopped working and is showing Status 610. Google 
searching shows that this is all related to GMap2 being deprecated etc (There 
maybe other reasons why I am getting a 610).

However, when looking here: 
https://github.com/wicketstuff/core/blob/master/jdk-1.6-parent/gmap3-parent/gmap3/src/main/java/org/wicketstuff/gmap/geocoder/Geocoder.java.
 The encoding url looks like it is from Gmap v2 (see here: 
https://developers.google.com/maps/documentation/geocoding/index), which would 
explain the 610.

Am I mistaken?

Regards
Vishal