Page 1 of 1

latitude and longudute from database

Posted: Sun Feb 16, 2014 9:28 pm
by Venkate Natesan

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....


latitude and longudute from database

Posted: Sun Feb 16, 2014 9:31 pm
by Igor

Hello,

Are there any errors in browser console?


latitude and longudute from database

Posted: Mon Feb 17, 2014 2:07 am
by Venkate Natesan

console says null


latitude and longudute from database

Posted: Mon Feb 17, 2014 2:08 am
by Venkate Natesan

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


latitude and longudute from database

Posted: Mon Feb 17, 2014 2:49 am
by Venkate Natesan

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


latitude and longudute from database

Posted: Mon Feb 17, 2014 3:10 am
by Illya Stepanov

Now it's working? Or still have errors?


latitude and longudute from database

Posted: Mon Feb 17, 2014 5:44 am
by Venkate Natesan

I fixed the issue ,thanks for your support


latitude and longudute from database

Posted: Mon Feb 17, 2014 5:47 am
by Illya Stepanov

Thanks for the update.