Venkate Natesan
Posts: 0
Joined: Thu Oct 24, 2013 5:09 am

latitude and longudute from database

I created Page Map with name pointLocation ,onpageshow event I invoke service to get the lat and long from database as follows

[
{
"longitude":"-122.2647787775173",
"latitude":"37.55734701646847",
"address":"Renukunda"
},
{
"longitude":"-122.2649596907653",
"latitude":"37.55655186484956",
"address":"Namakkal"
},
{
"longitude":"-122.2647776734692",
"latitude":"37.55734765189495",
"address":"Namakkal"
},
{
"longitude":"-122.2647463812355",
"latitude":"37.5574136147385",
"address":"Namakkal"
},
{
"longitude":"-122.2648969228191",
"latitude":"37.55725434545304",
"address":"Namakkal"
},
{
"longitude":"-122.2648391338808",
"latitude":"37.55727267875164",
"address":"Namakkal"
},
{
"longitude":"-122.2590955993949",
"latitude":"37.56078604175209",
"address":"Renukunda"
},
{
"longitude":"-122.2645645631482",
"latitude":"37.55715390840967",
"address":"Rangapattanam"
},
{
"longitude":"-122.2647573635601",
"latitude":"37.55723796459216",
"address":"Mysore"
},
{
"longitude":"-122.2648168601335",
"latitude":"37.55737274453138",
"address":"Ramachamuddu"
}
]

I stored response into location variable

i used your code on service success event as

var coordsArray = JSON.parse( localStorage.getItem('location') ),
marker = [];
console.log(coordsArray);
for (var i = 0; i < coordsArray.length; i++) {
marker.push(new google.maps.Marker({
position: new google.maps.LatLng(coordsArray.latitude, coordsArray.longitude),
map: Appery("pointLocation").gmap
}));
}

but its not working ,please help me to resolve this issue....

Igor
Posts: 0
Joined: Tue Apr 02, 2013 12:05 pm

latitude and longudute from database

Hello,

Are there any errors in browser console?

Venkate Natesan
Posts: 0
Joined: Thu Oct 24, 2013 5:09 am

latitude and longudute from database

console says null

Venkate Natesan
Posts: 0
Joined: Thu Oct 24, 2013 5:09 am

latitude and longudute from database

i am using my own service ,when i use test it returning array of lat and lang

Venkate Natesan
Posts: 0
Joined: Thu Oct 24, 2013 5:09 am

latitude and longudute from database

seems to be array of response was not assigned to local variable

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

latitude and longudute from database

Now it's working? Or still have errors?

Venkate Natesan
Posts: 0
Joined: Thu Oct 24, 2013 5:09 am

latitude and longudute from database

I fixed the issue ,thanks for your support

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

latitude and longudute from database

Thanks for the update.

Return to “Issues”