Greetings
I added a click event for the map to get lat and long and store them in text boxes the issue i’m facing is that when i click on the map and the lat and long are registered in the text boxes the map disappears and i don’t know why any ideas?
Thanks in advance.
Map_click event
Hi Saddam,
As below is my test code, it looks I haven’t reproduced your problem.
Could you please try it and let me know your code if it don’t works for you.
<%@ Page Language=“C#” AutoEventWireup=“true” CodeBehind=“DisplayASimpleMap.aspx.cs”
Inherits=“CSSamples.Samples.DisplayASimpleMap” %>
<%@ Register Assembly=“WebEdition” Namespace=“ThinkGeo.MapSuite.WebEdition” TagPrefix=“cc1” %>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=“w3.org/1999/xhtml”>
<head runat=“server”>
<link href="~/theme/default/samplepic/style.css" rel=“stylesheet” type=“text/css” />
<title>Display a Simple Map</title>
<script type=“text/javascript”>
OnMapCreated = function (map) {
map.events.register(“click”, this, function (e) {
var currentlatlon = map.getLonLatFromPixel(new OpenLayers.Pixel(e.clientX, e.clientY));
var location = document.getElementById(“location”);
location.innerHTML = currentlatlon;
})
}
</script>
</head>
<body>
<form id=“form1” runat=“server”>
<asp:ScriptManager ID=“ScriptManager1” runat=“server”>
</asp:ScriptManager>
<cc1:Map ID=“Map1” runat=“server” Width=“100%” Height=“100%”>
</cc1:Map>
<Description:DescriptionPanel ID=“DescPanel” runat=“server”>
<label id=“location”></label>
</Description:DescriptionPanel>
</form>
</body>
</html>
Regards,
Don