How to manage visitor's path inside Google current position?

  1. How to manage visitor’s path inside Google map and the current position as sensor is TRUE?
  2. How to manage height and width with the CSS file not px but 100% width.Example:
    mapcanvas.style.height = ‘850px’;
  3. How to pull out value like coords inside variables into PHP?
    Example:
<input type="hidden" data-geo="current_location" type="text" name="currentloc" readonly />

[PHP]

function success(position) {
 var mapcanvas = document.createElement('div');
 mapcanvas.id = 'mapcontainer';
 mapcanvas.style.height = '850px';
mapcanvas.style.width = '550px';

 document.querySelector('article').appendChild(mapcanvas);

 var coords = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);

 var options = {
 zoom: 15,
 center: coords,
 mapTypeControl: false,
 navigationControlOptions: {
  style: google.maps.NavigationControlStyle.SMALL
  },
 mapTypeId: google.maps.MapTypeId.ROADMAP
 };
 var map = new google.maps.Map(document.getElementById("mapcontainer"), options);

 var image = 'https://developers.google.com/maps/documentation/javascript/examples/full/images/beachflag.png';

 var marker = new google.maps.Marker(
  {
  position: coords,
  map: map,
  title: "Your favourite location",
  icon: image
  }
 );

}  

[/PHP]

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.