Page 1 of 2

Is it possible to work on two maps, in same app, on different page? One Map is not Loading correctly .Please Help!

Posted: Fri Jun 12, 2015 6:10 pm
by umama fakher

I want to display two maps on different pages of my application.

First Map is displaying locations from db.
Second Map showing Current location.

Problem is that when I am initializing my both map using following javascript:
code
var map;
var directionsDisplay;

var bounds = new google.maps.LatLngBounds();

function initialize() {
console.log('Initializing...');

map = Appery("map1").gmap;
if (!map)
{
setDelay();
}
else
{
directionsDisplay = new google.maps.DirectionsRenderer();
}
}

function initialize() {
console.log('Initializing...');

map = Appery("map2").gmap;
if (!map)
{
setDelay();
}
else
{
directionsDisplay = new google.maps.DirectionsRenderer();
}
}

function setDelay()
{
setTimeout(initialize, 50);
}

/code

so only one map works perfectly other is not working i.e not displaying locations from my database. Note: The map which is not showing database location was showing locations before adding second map(For current Location).

Also the maps take so much time in loading. I want it to load as soon as it appears.

Please Help !!


Is it possible to work on two maps, in same app, on different page? One Map is not Loading correctly .Please Help!

Posted: Sat Jun 13, 2015 3:09 pm
by Evgene Karachevtsev

Hello Umama,

Please check are there any errors in console? This should help:
http://devcenter.appery.io/documentat...


Is it possible to work on two maps, in same app, on different page? One Map is not Loading correctly .Please Help!

Posted: Wed Jun 17, 2015 5:05 pm
by umama fakher

As you suggested for debugging the app. I debugged it for loading of locations on map.
I am experiencing it only with these locations loading from database. And I also checked console here are the step by step console errors I got on debugging.

Image

Image

Image

Image

Image

Image

This Uncaught Error goes on for 55 times(Not Every time it was found 55 times, it was found sometimes 33 sometimes 43) and then markers shows up but they are not centered(It is found while debugging only) , screen is down right of the map (Gulf of Guinea). And also every time it was putting marker on the map it was going to Gulf of Guinea and then come bak to the location i set to put another marker.

Image

Please help!


Is it possible to work on two maps, in same app, on different page? One Map is not Loading correctly .Please Help!

Posted: Wed Jun 17, 2015 5:40 pm
by Alena Prykhodko

Please clarify, are these threads related https://getsatisfaction.com/apperyio/... ?
Probably we can continue in one place?


Is it possible to work on two maps, in same app, on different page? One Map is not Loading correctly .Please Help!

Posted: Wed Jun 17, 2015 6:14 pm
by umama fakher

I actually asked this question here first then I also asked that question on that thread also and got a reply on that thread, but this was the actual thread so I posted on this thread too. I want to be answered on this thread.

Thankyou :)


Is it possible to work on two maps, in same app, on different page? One Map is not Loading correctly .Please Help!

Posted: Wed Jun 17, 2015 6:14 pm
by umama fakher

If you want I can delete that from that thread :)


Is it possible to work on two maps, in same app, on different page? One Map is not Loading correctly .Please Help!

Posted: Wed Jun 17, 2015 6:16 pm
by umama fakher

Or where ever you want to reply you can . I want my problem to be solved.


Is it possible to work on two maps, in same app, on different page? One Map is not Loading correctly .Please Help!

Posted: Wed Jun 17, 2015 7:01 pm
by umama fakher

Why it is saying " Cannot refresh , Map is not initialized." ?


Is it possible to work on two maps, in same app, on different page? One Map is not Loading correctly .Please Help!

Posted: Thu Jun 18, 2015 8:13 pm
by Serhii Kulibaba

Where do you use JS with map? You should use it on "page show" event

Cannot read property 'address_components' of undefined

Where do you use this variable? Could you show us screenshot?


Is it possible to work on two maps, in same app, on different page? One Map is not Loading correctly .Please Help!

Posted: Mon Jun 22, 2015 5:06 pm
by umama fakher

I am not using map component at this time in my app.

Thanks for your reply :)