VDS Technologies

 

Hide custom distance mesure label

12/4/2014 12:38:27 AM
Total Posts 28

Hide custom distance mesure label

is there any way to hide distance measure label after double mouse click on distance tool when use custom measure label ?

When use default its ok.

 

function onDistanceTool(sender, e /* DistanceToolEventArgs */) {
var label = document.getElementById("labelDiv");
label.innerHTML = "Miles: " + e.miles + " Kilometers: " + e.kilometers;
}

12/11/2014 7:54:19 AM
MVP
Total Posts 323

Re: Hide custom distance mesure label

AspMap 4.8.4 has been updated to allow you to clear the labels. Please download the update from the Customer Portal.

A new isFinished field has been added to the DistanceToolEventArgs class:

function onDistanceTool(sender, e /* DistanceToolEventArgs */) {

var label = document.getElementById("labelDiv");

if (!e.isFinished)

        label.innerHTML = "Miles: " + e.miles + " Kilometers: " + e.kilometers;

else

        label.innerHTML = "";

}

 

12/13/2014 1:20:26 PM
Total Posts 28

Re: Hide custom distance mesure label

After downloaded the update from the Customer Portal but steel hide custom distance not working

 

Code:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register TagPrefix="aspmap" Namespace="AspMap.Web" Assembly="AspMapNET" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
<aspmap:map id="map" runat="server" width="575px" enablescrollwheelzoom="true" backcolor="#F0F8FF"
smoothingmode="AntiAlias" fontquality="ClearType"
imageformat="Png" borderstyle="Solid" bordercolor="#8080FF" borderwidth="1px"
maptool="Distance" height="600px" enablesession="True" clientscript="StandardScript"
mapunit="Meter"></aspmap:map>
</ContentTemplate>
</asp:UpdatePanel>

</div>
<script type="text/javascript">
var map = AspMap.getMap('<% =map.ClientID %>');
map.add_distanceTool(onDistanceTool);
function onDistanceTool(sender, e /* DistanceToolEventArgs */) {
var label = document.getElementById('<% =Label1.ClientID %>');
if (!e.isFinished) {
label.innerHTML = "<b>" + e.kilometers.toFixed(2) + "</b> km<br /><b>" + e.miles.toFixed(2) + "</b> mi";
}
else {
label.innerHTML = "";
}

}
</script>
</form>
</body>
</html>

12/15/2014 6:22:19 PM
MVP
Total Posts 323

Re: Hide custom distance mesure label

Seems as the old release was restored from the backup.

Please re-download it again, sorry for the inconvenience.

12/16/2014 1:00:27 PM
Total Posts 1

Re: Hide custom distance mesure label

thats are working. thanks