Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_geolocalization.gsp: JSON.stringify not serialize html5 position object #8

Open
gcsis opened this issue Feb 29, 2012 · 1 comment
Open

Comments

@gcsis
Copy link

gcsis commented Feb 29, 2012

Same times JSON.stringify not serialize html5 position object (in same environments).
One way to overcome this problem is changing in plugin the view/template/_geolocalization.gsp with:

// tested Ok on FFox 10, IE 9, GCrome 17, Saf 5.1, Dorphin/Android - @jcolombo_

<script type="text/javascript"> function foundLocation(position) { var objx = {timestamp:position.timestamp,coords:{latitude:position.coords.latitude,longitude:position.coords.longitude,accuracy:position.coords.accuracy,speed:position.coords.speed}}; var jsonPos = JSON.stringify(objx); ${remoteFunction(controller: 'geolocation',action:'setGeoPosition',params:'\'val=\' + jsonPos')} } navigator.geolocation.getCurrentPosition(foundLocation); </script>
@gcsis
Copy link
Author

gcsis commented Mar 2, 2012

IMPORTANT: I think that the problems identified in the other open issues (# 1 and # 6) correspond to this error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant