Page 1 of 1

Map

Posted: Mon Mar 31, 2014 4:02 pm
by laura6372139

Hi:

I have two questions:

The first:

I'm making a list clickable and it works perfectly, but I also want to put a map with the location.

I created this database:

Image

But when I click everything is classified by its "id" except the map.

Image

I added the event succes:

var coordsArray = data;
var marker;
for (var i = 0, j = coordsArray.length; i < j; i++) {
marker = new google.maps.Marker({
position: new google.maps.LatLng( coordsArray.lat, coordsArray.long ),
map: Appery("map_1").gmap
});
}

This is my publick link:

http://appery.io/app/mobile-frame?src...

Could you help me?

The second question:

I want to open a button to open a window that gives me option to open the coordinates on Google maps, locations, etc..

eg:
window.location.href ="mailto:" + Appery('email').text();

but with map.

thanks.

Regards.


Map

Posted: Mon Mar 31, 2014 5:55 pm
by Maryna Brodina

Hello!

Code you have posted is incorrect. After mapping array to grid is done, you get a lot of maps and call preAppery("map_1")&#46;gmap/pre is wrong. If we understand correctly, every map is supposed to have one marker. It's better to add code in mapping. Please check these tutorials:

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

This post might also help https://getsatisfaction.com/apperyio/...


Map

Posted: Tue Apr 01, 2014 12:16 pm
by laura6372139

hi Maryna:

window.location.href ="geo:0,0?q=localStorage.getItem('latitude')','localStorage.getItem('longitude')";

But googlemaps not find the latitude and longitude. As I can read from the db?

Thanks


Map

Posted: Tue Apr 01, 2014 11:44 pm
by Igor

Hi.

You are using static value but it should be dynamic. Please replace your code

pre
code
window&#46;location&#46;href ="geo:0,0?q=localStorage&#46;getItem('latitude')','localStorage&#46;getItem('longitude')&quot
/code
/pre

with the following
pre
code
window&#46;location&#46;href = console&#46;log("geo:0,0?q=" + localStorage&#46;getItem('latitude') + "," + localStorage&#46;getItem('longitude'));
/code
/pre

According to this doc: http://en.wikipedia.org/wiki/Geo_URI you should use following code:

pre
code
window&#46;location&#46;href = console&#46;log("geo:" + localStorage&#46;getItem('latitude') + "," + localStorage&#46;getItem('longitude'));
/code
/pre


Map

Posted: Tue Jun 23, 2015 5:43 am
by Deon

Window.location..... does not seem to work anymore with native maps, tel, email?
You will have to use windows.open.....

Very annoying!!!!!!


Map

Posted: Tue Jun 23, 2015 7:00 am
by Serhii Kulibaba