Page 1 of 2
Geolocation confustion
Posted: Mon Sep 16, 2013 6:22 pm
by Jen5411892
Hello,
I am trying to create a map with a single point that finds the user's address and navigates (or gives directions) to the point.
I followed the tutorial about creating a Google map with Geolocation. I tested it and it works fine. It locates the user and also allows the user to input an address. However, it does not provide any options for the user to navigate (or get directions) to the point I input. The point shows up on the map, but when I click it the point disappears.
Geolocation confustion
Posted: Mon Sep 16, 2013 7:17 pm
by Maryna Brodina
Geolocation confustion
Posted: Tue Sep 17, 2013 2:06 am
by Jen5411892
Thanks. Yes, it did help.
One problem: in the tutorial it says to drop a "panel component" in the grid next to the map to display the text directions. This looks like an older tutorial by the screenshots. I do not see a "panel component" in the current version. What can I substitute?
thank you.
Geolocation confustion
Posted: Tue Sep 17, 2013 6:29 am
by Illya Stepanov
Hi Jennifer,
you can use 'HTML' component, place it into the grid and in this component insert this:
code
<div data-role="panel" id="panel">
<!-- panel content goes here -->
</div>
/code
follow the tutorial - it should work.
Geolocation confustion
Posted: Tue Sep 17, 2013 7:41 pm
by Jen5411892
The map is functioning fine, but the directions are blank. I think adding the html snippet for panel into the mix is messing me up. Can you please take a look at it? It's already shared with Appery. It's called ketersalon.
thank you.
Geolocation confustion
Posted: Tue Sep 17, 2013 9:08 pm
by Maryna Brodina
Hello!
1) On click on submit_directionsMap change the last who lines:
codevar panel = Appery("directionsPanelhtml")[0];
displayDirections(sourceAddress, destinationAddress, map, panel);/code
2) Inside HTML component delete code<div data-role="panel" id="panel">
<!-- panel content goes here -->
</div>/code
Geolocation confustion
Posted: Tue Sep 17, 2013 11:28 pm
by Jen5411892
Yay!! That worked. Thank you so much!
Geolocation confustion
Posted: Tue Sep 17, 2013 11:34 pm
by Jen5411892
One more question. I'd like to add a "show my location" to this map - I'm sort of combining the two tutorials now. How can I add that? Now that my directions are working I don't want to mess it up. 
thank you
Geolocation confustion
Posted: Tue Sep 17, 2013 11:41 pm
by Alena Prykhodko
Before doing changes you can save project backup.
Follow this tutorial http://docs.appery.io/tutorials/build...
Geolocation confustion
Posted: Wed Sep 18, 2013 1:28 am
by Jen5411892
No luck. I followed the tutorial explicitly. The line that is throwing me off is just after #10: "In addition to updating the component, you also need to set the address to a blank value."
My map has a set end point, so I can't very well reset the address to a blank value.