Hundreds of features to explore
Games made in Construct
Your questions answered
Trusted by schools and universities worldwide
Free education resources to use in the classroom
Students do not need accounts with us
What we believe
We are in this together
World class complete documentation
Official and community submitted guides
Learn and share with other game developers
Upload and play games from the Construct community
Game development stories & opinions
Hi I like to know more about getting GeoLocation correctly for mobile app. Please let me know what to be careful of so I can get it correctly in mobile app because the browser preview is showing "0, 0" for Long and Lat
If you are testing it on a PC that would be expected behavior.
Some PCs can still get a very approximate location (e.g. identifying your city). Post a .capx so we can test ourselves. Don't forget you need to request the geolocation position or watch it before it returns anything other than 0.
Develop games in your browser. Powerful, performant & highly capable.
any sample tutorial to go with that?
Geolocation in the Manual
Looking at the geolocation actions you should first add an action to watch the location or request a location before it will return anything.
add an event:
System on start of layout
broprog - haven't you ever looked through the examples that come with Construct 2? There's a Geolocation one right there.
i know how to code in the geolocation stuff, just not working in preview. So i guess its something with the browser