Hi,
I am building an application that is using Ajax (.Net) but I have issues around the client scripting... I have a button linked with an Ajax
call to the server. and it is working just fine. when I return from tne server i want to be able to generate an action on the client side but I do not feel confortable with the API (openLayer / Javascript) could you give me an idea on how to for instance update a specific layer or overlay based on what the server is sending back to the client..
<head id="Head1" runat="server">
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta http-equiv="X-UA-Compatible" content="IE=9">
<link href="~/Styles/MyStyle.css" rel="stylesheet" type="text/css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript" language="javascript">
var OnMapCreating = function (map) {
}
var OnMapCreated = function (map) {
}
function AjaxCall(arg) {
var context = Map1;
WebForm_DoCallback('__Page', arg, AjaxResult, Map1, null, false);
}
function AjaxResult(result, context) {
if (result = "REDRAW_LAYEROVERLAY") {
var map = Map1.GetOpenLayersMap();
map.getLayer("layerOverlay").redraw(true);
}
else {
var map = Map1.GetOpenLayersMap();
map.addLayer(format.read(new OpenLayers.Format.WKT()));
}
}
</script>
</head>
<body>
<img src="theme/default/img/loading.gif" alt="loading..." hidden="hidden" />
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="CmdArearadius" runat="server" UpdateMode="Conditional">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Button1" />
<ContentTemplate>
<fieldset>
<legend>CenterScreen</legend>
<asp:Button ID="Button1" runat="server" Text="Location" OnClientClick="AjaxCall('LOCATION')"
CommandArgument="LOCATION" CommandName="SET" />
<legend>Get Active Customers</legend>
<asp:Button ID="Button2" runat="server" Text="Customers" OnClientClick="AjaxCall('ACTIVE_CUSTOMERS')"
CommandArgument="ACTIVE_CUSTOMERS" CommandName="GET" />
</fieldset>
</ContentTemplate>
</asp:UpdatePanel>
<cc1:Map ID="Map1" runat="server" OnClick="Map1_Click" Height="800px" Width="800px"
MapUnit="DecimalDegree" OnClientDoubleClick="getLocation">
</cc1:Map>
</form>
</body>
</html>