Page 1 of 1

Error loading map

Posted: Mon Aug 12, 2013 5:01 pm
by Willie Sims

codevar chicago = new google.maps.LatLng(41.850033, -87.6500523);

//map = new google.maps.Map(document.getElementById('map-canvas'),
map = new google.maps.Map(Appery("map").get(0), {
center: chicago,
zoom: 15,
mapTypeId: 'roadmap'
});

var layer = new google.maps.FusionTablesLayer({
query: {
select: 'geometry',
from: '1BtUFVysjCE7X6lmiWcPl0D5Pf5SJU4DJXJSp5Ic'
},
});
layer.setMap(map);/code

I keep getting an error
SCRIPT5007: Unable to get property 'offsetWidth' of undefined or null reference
main.js, line 28 character 2138

http://appery.io/app/mobile-frame?src...
Made Public
Its supposed to show our locations

A Question about this system also
Is the map element considered html5 or is it considered an device element, that is to say should I use the javascript references for html, or should I be using javascript and calls for the native device?

Also, as to the rest services api for google they have two different portals one for html and one for android which one should I use
I have this on an click event, but would really like it to load after the map loads without an even got any suggestions


Error loading map

Posted: Mon Aug 12, 2013 5:50 pm
by maxkatz

The map is loaded fine from the link I sent you. The error happens when you run the custom script. Check to make sure everything is correct there, specifically with layer API.

Google Maps is an HTML5 widget.

You should probably use the API for HTML.


Error loading map

Posted: Mon Aug 12, 2013 6:16 pm
by Kateryna Grynko

Hi Willie,

Just to add. Here is the possible solution.

Replace codeAppery("map").get(0)/codewithcode Appery("map").gmap/code
You use embedded Maps component, but attempting to recreate a map with the following code:codemap = new google.maps.Map(...);/code
This is a fully html component, the DIV with content. There is no separate html5 notation for Google Maps component. Appery.io application doesn't have an access to native device maps.

You can use Page Show event handler but your code should be called with a short delay:
codeSetTimeout (function () {...}, 1500);/code
We can not process time Maps ready to go, so one has to do tricks.