Load Google map API in monaca and
Obtain the current location and view the map.
Use navigator.geolocation.getCurrentPosition() to get your current location.
I'm using it.
on your PC browser or monaca debugger
If it works, it can be displayed without any problems.
I did an AdHoc build for iOS to verify the actual machine, and when I tried it on my iPhone,
The map cannot be displayed due to an error in retrieving the current location.
Also, the following scripts are loaded at startup:
<script src="http://maps.googleapis.com/maps/api/js"></script>
<script src="components/loader.js"></script>
<script src="js/ncmb-1.2.6.min.js">/script>
<script src="js/zepto.min.js"></script>
ncmb-1.2.6.min.js version is not 2.0.n because it uses a file store.
I use zepto.min.js instead of jQuery.
Is there something missing?
I'll be waiting for your professor.
Resolved.
Monaca Cloud IDE→ File→Manage Cordova Plug-in→After enabling the Geolocation plug-in, you can get your current location on the actual machine.
I hope it will be helpful for those who are also in trouble.
© 2024 OneMinuteCode. All rights reserved.