geolocation dont work online and works if run from construct

Discussion and feedback on Construct 2

Post » Sat Jul 15, 2017 10:34 am

geolocation dont work on web (online) and works if i run it from construct.
There are ideas???
B
13
S
2
Posts: 95
Reputation: 861

Post » Sat Jul 15, 2017 9:32 pm

I had a similar issue some time ago, posted a thread about it.
The issue seems to be on Google's side.

Assuming, that you are using the Geolocation object correctly and it still fails, here is a workaround:
  1. Add an AJAX object to your project
  2. When you need the geolocation, use the AJAX action "Request URL" with this url:
    "https://maps.googleapis.com/maps/api/browserlocation/json?browser=chromium&sensor=true"
  3. When that request completes, AJAX.LastData will return a JSON file looking approx. like this:
Image

You should be able to go from here.

For me, this currently only works when previewing or exporting to NW.js.
Don't know about you though.
"We can't solve problems by using the same kind of thinking we used when we created them."
- Albert Einstein
B
27
S
11
G
8
Posts: 528
Reputation: 7,091


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 7 guests