Page 2 of 2

Geolocation confustion

Posted: Wed Sep 18, 2013 10:11 am
by Kateryna Grynko

Hi Jennifer,

You can use a marker - don't clean the address line. Simply pass the coordinates from Geolocation service to a marker, not directly to map. You can find the marker directly in the Google Maps component mapping.


Geolocation confustion

Posted: Wed Sep 18, 2013 11:23 am
by Jen5411892

Hi Katya. I did exactly that. The directions still function, however the "show my location" does not. Image


Geolocation confustion

Posted: Wed Sep 18, 2013 3:27 pm
by Maryna Brodina

Hello! Please add on geolocation service Success event the following code:
prevar lat = data.coords.latitude, lon = data.coords.longitude;
var myOptions = {
zoom :8,
center: new google.maps.LatLng(lat, lon),
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map($('div[dsid="directionsMap"]').get(0), myOptions);
var sfLatlng = new google.maps.LatLng(lat, lon);
var marker = new google.maps.Marker({
position: sfLatlng,
map: map
});/pre

http://docs.appery.io/tutorials/addin...


Geolocation confustion

Posted: Wed Sep 18, 2013 6:09 pm
by Jen5411892

Hi Katya,
The "show my location" now works. However, when I test and click "show my location" and then "get directions", I get this error:
Image


Geolocation confustion

Posted: Wed Sep 18, 2013 6:41 pm
by Maryna Brodina

Please fill in start address.


Geolocation confustion

Posted: Wed Sep 18, 2013 7:05 pm
by Jen5411892

I'm sorry. I guess I wasn't very clear. I'd like two options for "get directions":

  1. from my location

  2. from defined address

    Image


Geolocation confustion

Posted: Wed Sep 18, 2013 8:27 pm
by Maryna Brodina

On button "get directions" you retrieve source address from Input source :
prevar sourceAddress = Appery("inputSource").val();/pre and when you click on "show my location" this field isn't filled in. You need to get address using coordinates and fill in with this address inputSource. This should help https://getsatisfaction.com/apperyio/...


Geolocation confustion

Posted: Wed Sep 18, 2013 10:08 pm
by Jen5411892

Is there a tutorial on reverse geolocating? I'm am so lost looking at all of those posts from the link you just sent me. :(


Geolocation confustion

Posted: Thu Sep 19, 2013 6:00 am
by Kateryna Grynko

Hi Jennifer,

Unfortunately we do not have such tutorial. You can find all you need on the link above.