Displaying Latitude-Longitude Coordinates Not run in master.page

5/30/2012 2:10:18 PM
Total Posts 50

Displaying Latitude-Longitude Coordinates Not run in master.page

Hi,

I have tried to make web with master.page. but Javascript 'Displaying Latitude-Longitude Coordinates' unable shown in it. event i have tried to make Form inside content placeholder.

How to solve this?

do you plan to create another function for displaying lat-long in another method without javascript?or fix the problem if javascript able run inside form?

 

My code like this :

<

 

asp:ContentID="BodyContent"ContentPlaceHolderID="MainContent"runat

="server">

<scripttype="text/javascript"src="Scripts/SideMenusGIS.js"></script

>

<metaname="GENERATOR"Content

="Microsoft Visual Studio .NET 7.1">

<metaname="CODE_LANGUAGE"content

="VB">

<metaname="vs_defaultClientScript"content

="JavaScript">

<metaname="vs_targetSchema"content

="http://schemas.microsoft.com/intellisense/ie5">

<scriptsrc="Scripts/jquery-1.5.2.min.js"type="text/javascript"></script

>

<linkrel="stylesheet"type="text/css"href="Style/SidemenuGIS.css"

/>

<linkrel="stylesheet"type="text/css"href="Style/Gisweb.css"

/>

<formid="Form1"runat="server"method="post">

<asp:ScriptManagerID="ScriptManager1"runat="server"></asp:ScriptManager

>

 

<divID="wrapper"

>

<divid

="leftcolumn">

</div

>

<divid="content"

>

<divid="toolsmap"

>

<asp:ImageButtonID="zoomFull"runat="server"BorderColor="White"

BorderStyle="Outset"BorderWidth="1px"ImageUrl="tools/zoomfull.gif"

ToolTip="Zoom All"

/>

<aspmap:MapToolButtonID="zoomInTool"runat="server"

ImageUrl="tools/zoomin.gif"Map="map"ToolTip="Zoom In"

/>

<aspmap:MapToolButtonID="zoomOutTool"runat="server"

ImageUrl="tools/zoomout.gif"Map="map"MapTool="ZoomOut"ToolTip="Zoom Out"

/>

<aspmap:MapToolButtonID="panTool"runat="server"ImageUrl="tools/pan.gif"

Map="map"MapTool="Pan"ToolTip="Pan"

/>

<aspmap:MapToolButtonID="centerTool"runat="server"

ImageUrl="tools/center.gif"Map="map"MapTool="Center"ToolTip="Center"

/>

<aspmap:MapToolButtonID="distanceTool"runat="server"

ImageUrl="TOOLS/distance.gif"Map="map"MapTool="Distance"

ToolTip="Measure Distance"/>&nbsp;&nbsp;&nbsp;&nbsp;

Find Public Facility :

&nbsp;

<asp:TextBoxID="TextLandmark"runat="server"

ToolTip="Input Latitude"Width="200px"></asp:TextBox>

&nbsp;

<asp:ButtonID="GoLandmark"runat="server"Text="Find"

/>

</div

>

<divid

="mapform">

<asp:UpdatePanelID="UpdatePanel1"runat

="server">

<ContentTemplate

>

<aspmap:Mapid="map"runat="server"Width="855px"BackColor="#A5BFDD"

ImageFormat="Gif"SmoothingMode

="AntiAlias"

FontQuality="ClearType"Cursor=""Height="500px"MapTool="Pan"BorderStyle="Solid"

BorderColor="#006699"

>

</aspmap:Map

>

</ContentTemplate

>

</asp:UpdatePanel

>

</div

>

<divclass

="clear">

</div

>

<divalign="center"

style="font-family: Arial, Helvetica, sans-serif; font-size: medium; font-weight: bold; color: #66FFFF; width: 850px; background-color: #336699; font-style

: italic;">

</div

>

</div

>

<divid

="rightcolumn">

<asp:LabelID="status"runat="server">tess</asp:Label

>

</div

>

</div

>

</form

>

<SCRIPTlanguage="javascript"type

="text/javascript">

function mouseMoveHandler(sender, e /* MouseEventArgs */

) {

var label = document.getElementById("status"

);

if

(e.isInside)

label.innerHTML =

"Latitude: " + formatCoord(e.latitude, "lat") + " | Longitude: " + formatCoord(e.longitude, "long"

);

else

label.innerHTML =

" "

;

}

function

formatCoord(coord, type) {

var

dec = Math.abs(coord);

var

deg = Math.floor(dec);

var

min = Math.floor((dec - deg) * 60);

var

sec = Math.floor((dec - deg - (min / 60)) * 3600);

var suff = (coord > 0 ? "E" : "W"); if (type == "lat") suff = (coord > 0 ? "N" : "S"

);

return deg + "° " + min + "' " + sec + '" '

+ suff;

}

var map = AspMap.find('<%=map.ClientID%>'

);

map.add_mouseMove(mouseMoveHandler);

</

 

SCRIPT>

<aspmap:ZoomBarID="zoomBar1"runat="server"Map="map"Position=TopLeft/>

</

 

asp:Content

>

 

 

 

5/30/2012 3:04:10 PM
MVP
Total Posts 323

Re: Displaying Latitude-Longitude Coordinates Not run in master.page

Replace    document.getElementById("status");

with     document.getElementById('<%=status.ClientID%>');

5/30/2012 3:17:46 PM
Total Posts 50

Re: Displaying Latitude-Longitude Coordinates Not run in master.page

Very Nice,

Now it's working with display.

 

Thanks.