Hy,
I refine my question with more accurately.
I'm trying to get the GPS location of my machine in processing passing through the google API on an html page.
In this page, there is a javascript function that runs when the page is loading.
But these data are dynamic so I can't recover them using a library like pro HTML.
So in the example below, processing returns me only "<div id="#latitude"></div>" without the content loading dynamically.
I refine my question with more accurately.
I'm trying to get the GPS location of my machine in processing passing through the google API on an html page.
In this page, there is a javascript function that runs when the page is loading.
But these data are dynamic so I can't recover them using a library like pro HTML.
So in the example below, processing returns me only "<div id="#latitude"></div>" without the content loading dynamically.
- <head>
- // ... html spec
- <script type="text/javascript">
- var previousPosition = null;
- function initialize() {
- // google maps api
- // ...
- }
- if (navigator.geolocation)
- // ...
- function successCallback(position){
- map.panTo(new google.maps.LatLng(position.coords.latitude, position.coords.longitude));
- // ...
- });
- var coorLatitude = position.coords.latitude;
- var coorLongitude = position.coords.longitude;
- var stringLatitude = coorLatitude.toString();
- var stringLongitude = coorLongitude.toString();
- document.getElementById('latitude').innerHTML = stringLatitude;
- document.getElementById('longitude').innerHTML = stringLongitude;
- };
- </script>
- </head>
- <body onload="initialize()">
- <div id="#latitude"></div>
- <div id="#longitude"></div>
- </body>
1