[eluser]boony[/eluser]
Hi all,
I've got a small problem with a google map app that I'm working with and hope someone can help solve this issue.
Essentially, I've got a small app that places a marker on a map and then needs to save the lat and long of the position. The code supplied by GOOGLE (below) uses a JavaScript solution. The phpsqlinfo_addrow.php file gets the URI segments which pass the lat and long in the URL call.
Code:
function saveData() {
var name = escape(document.getElementById("name").value);
var address = escape(document.getElementById("address").value);
var type = document.getElementById("type").value;
var latlng = marker.getPosition();
var url = "phpsqlinfo_addrow.php?name=" + name + "&address;=" + address +
"&type;=" + type + "⪫=" + latlng.lat() + "&lng;=" + latlng.lng();
downloadUrl(url, function(data, responseCode) {
if (responseCode == 200 && data.length <= 1) {
infowindow.close();
document.getElementById("message")[removed] = "Location added.";
}
});
}
What I want to do is get the lat and long from the marker and pass it to my controller to store the lat and long into the appropriate table. In other words I want to rewrite the following
Code:
var url = "phpsqlinfo_addrow.php?name=" + name + "&address;=" + address +
"&type;=" + type + "⪫=" + latlng.lat() + "&lng;=" + latlng.lng();
into something that CI can handle.
Any advice (well not exactly any advice %-P ) greatly appreciated.
Regards