According to the script in document , the only part related to the backend is to provide dots.
function getPoints() { return [ new google.maps.LatLng(37.782551, -122.445368), new google.maps.LatLng(37.782745, -122.444586), new google.maps.LatLng(37.782842, -122.443688), new google.maps.LatLng(37.782919, -122.442815), new google.maps.LatLng(37.782992, -122.442112), new google.maps.LatLng(37.783100, -122.441461), new google.maps.LatLng(37.783206, -122.440829), new google.maps.LatLng(37.783273, -122.440324), new google.maps.LatLng(37.783316, -122.440023), new google.maps.LatLng(37.783357, -122.439794), new google.maps.LatLng(37.783371, -122.439687), ...
This way you can either echo in php like
<?php //... echo "new google.maps.LatLng($lat, $lng),\n" //...
where $ lat and $ lng should be set in php as iteration through dots or return an AJAX response in the getPoints method.
Emrah Izci
source share