I code made this code in Delphi
procedure TForm10.Button1Click(Sender: TObject);
var
Response: TStringStream;
Params: TStringList;
begin
Params := TStringList.Create;
try
Params.Add('long=' + edit1.Text);
Params.Add('lat=' + edit2.Text);
Response := TStringStream.Create('');
try
IdHTTP1.Post('http://localhost:1645/default', Params, Response);
memo1.Text := Response.DataString;
except
on E: Exception do
begin
showmessage('Error: ' + E.Message);
end;
end;
finally
Params.Free;
Response.Free;
end;
end;
to send parameters to a website in asp.net (googlemaps which takes long and lat as parameters )
here is the asp code
c#
public partial class YourFirstGoogleMap : System.Web.UI.Page
{
public string v;
public string c;
protected void Page_Load(object sender, EventArgs e)
{
v = Request.QueryString["long"];
if (v != null)
{
Response.Write("param is ");
Response.Write(v);
}
c = Request.QueryString["lat"];
if (c != null)
{
Response.Write("param is ");
Response.Write(c);
}
}
}
and javascript
<script type ="text/javascript">
function InitializeMap()
{
var latlng = new google.maps.LatLng(<%=v%>, <%=c%>);
var myOptions = {
zoom: 3,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map"), myOptions);
}
window.onload = InitializeMap;
</script>
Any help?
What I have tried:
I run it in IIS localhost, when I manually type long and lat asp google maps Works, but when I post from delphi application doesn't happend anything.