RobertJay
Posts: 0
Joined: Fri Jun 15, 2012 1:32 pm

Geocoding tutorial

Is the server-side code in the current tutorial up-to-date in terms of the fixes Appery suggested to solve problems mentioned in earlier threads? Thank you.

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Geocoding tutorial

Hi Robert -

Could you please specify the exact tutorial that you mean.

RobertJay
Posts: 0
Joined: Fri Jun 15, 2012 1:32 pm

Geocoding tutorial

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Geocoding tutorial

This is our recently added version, so everything should be well.
Are you having some troubles with it?

RobertJay
Posts: 0
Joined: Fri Jun 15, 2012 1:32 pm

Geocoding tutorial

Thanks Illa.

First, let me say that I've found this tutorial indispensable in learning both about geolocation functionality and the incredible value of server-side script.

Question: when I went to first copy your code into my server-side code, I noticed that your script already existed in my existing scripts - but I don't remember ever putting it there. Is it possible that appery pre-installed it - and that the version that was installed doesn't include subsequent changes made in the tutorial?

But in any case - and I'm sure it's something I'm (not) doing - when I run a test on the related service I keep getting the response:

{
"status":400,
"uri":"https://api.appery.io/rest/1/code/my key is here/exec",
"response":"Wrong parameters"
}

Question: I'm using what is called a db key for my request- is that what the code uses for db id?

I've modified your code so as to use latitude and longitude in my db, rather than getting it from Google. Other than that, I think I've followed the tutorial correctly.

Question: the latitude and longitude values in my db are strings - is their not being a number a possible reason for the problem? I ask, because the "try" in your code seems to require numbers. Should I use JS and convert my string to numbers?

Thanks again for your help.

Miguel Navarro7469744
Posts: 0
Joined: Mon Apr 06, 2015 4:55 pm

Geocoding tutorial

I like working with the javascript and to me this works the best:

function codeAddressAndMark(map, markerTitle, address,icon) {
geocoder = new google.maps.Geocoder();
geocoder.geocode( { 'address': address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
var location= results[0].geometry.location;
locationArray.push(location);
createMarker(map, markerTitle, location,icon);
} else {
alert('Geocode was not successful for the following reason: ' + status);
}
});
}

RobertJay
Posts: 0
Joined: Fri Jun 15, 2012 1:32 pm

Geocoding tutorial

Thank you Miguel - but I'm new at this and don't quite see how this ties in with my issue.

RobertJay
Posts: 0
Joined: Fri Jun 15, 2012 1:32 pm

Geocoding tutorial

Update- please ignore questions-I believe I am getting them resolved.

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Geocoding tutorial

Hello Robert,

Thank you for the update, glad it works!

Return to “Issues”