Toblerone
Posts: 0
Joined: Wed Aug 07, 2013 5:08 pm

Geolocation not working since update?

I am having some problems with a geolocation service since yesterday's update. I've even created a brand new app, done nothing but add a map to the page, then a new geolocation service. Then I mapped lon/lat to the lon/lat of the map and invoked service in load, nothing else on page.

Whenever i test (tried tester + browser, which does pass location details as it used to work fine before yesterday) now it just shows

Cannot refresh, map is not initialized! this happens in appery.js:2241

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Geolocation not working since update?

Hi Toby,

Geolocation service can only work on a real device or Android emulator. Its work in the device mobile tester depends on the device.

I don't know how this could affect update service, but work with Google Maps is always accompanied by the need to wait for the download. We usually use Page Show event and a timer delay:
codesetTimeout( function() {
// your code for google maps
}, 1000);/code

Toblerone
Posts: 0
Joined: Wed Aug 07, 2013 5:08 pm

Geolocation not working since update?

Hi Katya,

This is simply not the case, geolocation works fine in browsers as they pass location data, this has been working fine for weeks up until yesterday's update and now it's stopped working. And yes, I've tried on tester too and get the error from a very simple test page.

Toblerone
Posts: 0
Joined: Wed Aug 07, 2013 5:08 pm

Geolocation not working since update?

There is no code for google maps in a quick test, it's purely drag a map on, onload of page invoke geo service, and in that service map lon/lat to the long/lat of the map, nothing fancy, just a test that should, and did 100% used to work before update.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Geolocation not working since update?

Toby,

Please try using Page Show event and startup delay. Google Maps does not run instantly and does not report their ready status. On Load stage they are definitely not yet started. Depending on the connection speed they may still be uninitialized even on Page Show.

Toblerone
Posts: 0
Joined: Wed Aug 07, 2013 5:08 pm

Geolocation not working since update?

Katya,

I've even put the invoke service on a button on a page, so nothing happening in page load or page show, and still i get

Cannot refresh, map is not initialized! appery.js:2241

i even made a whole new product, dragged a map, dragged a button and created a geolocation service for this, nothing else. I put a console.log into the load and pagesohw events just so i could see it was actually running and that's it.

Try it yourself please

1.. Create new project
2.. open startscreen, drag a map component and a button
3.. create new geolocation service
4.. add instance of geolocation service to startscreen
5.. map lon/lat from service to lon/lat on map
6.. add invoke service to button click event

simple test, which should work and did before update, does not now. I know it's making the geolocation request to the browser as in ie i get the "Allow appery.io to use your location prompt" but that's as far as it gets. The map error happens before the request for geolocation so can only assume something in update broke the map component.

And no, it does not work in tester either :P

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Geolocation not working since update?

Did you try on device?

Toblerone
Posts: 0
Joined: Wed Aug 07, 2013 5:08 pm

Geolocation not working since update?

Yes Katya, as per my reply, i tried using the appery tester (on device). But again it used to work on browser just fine until your update yesterday, something has broken. Several other people I know are having same issue, this needs urgent attention please.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Geolocation not working since update?

You also need to refresh the map once you have a new location: http://docs.appery.io/tutorials/build...

Toblerone
Posts: 0
Joined: Wed Aug 07, 2013 5:08 pm

Geolocation not working since update?

Hi Max,

Whilst true i'd missed the step out in my simple example above, in the first app I had it was in there already, however it's all working now, I can only assume I was having some network issues which was preventing some map component loading.

Thank you for your support.

Return to “Issues”