umama fakher
Posts: 0
Joined: Fri May 22, 2015 4:26 pm

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

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

umama fakher
Posts: 0
Joined: Fri May 22, 2015 4:26 pm

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

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!

umama fakher
Posts: 0
Joined: Fri May 22, 2015 4:26 pm

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

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 :)

umama fakher
Posts: 0
Joined: Fri May 22, 2015 4:26 pm

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

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

umama fakher
Posts: 0
Joined: Fri May 22, 2015 4:26 pm

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

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

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

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

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?

umama fakher
Posts: 0
Joined: Fri May 22, 2015 4:26 pm

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

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

Thanks for your reply :)

Return to “Issues”