dgburton


Hi,

Can anyone share some best-practice code on how to detect a click on a PushPin in 3D mode

I have code handling the OnClick of a the DIV that is the PushPin in 2D mode (http3A//www.viavirtualearth.com/wiki/ClickablePin.ashx) - but this doesn't work in 3D mode as the PushPin is part of the 3D scene.

Is there a best-practice way of doing this

Many thanks

dan





Re: PushPin click in 3D map (v4)

Duncan Lawler


There's no way to get a click event from the current control, just the mouse over event.




Re: PushPin click in 3D map (v4)

dgburton

Is there a suggested workaround to get this functionality - or whether it's on the roadmap for the next release of the control

many thanks

dan







Re: PushPin click in 3D map (v4)

Duncan Lawler

There's nothing you can do from script (you'd have to peek the message queue).
Addressing this is on our roadmap for a future release.




Re: PushPin click in 3D map (v4)

SoulSolutions

You got a list anywhere Duncan Be nice to have the scalebar in KM

John.






Re: PushPin click in 3D map (v4)

Duncan Lawler

The V4 map control already has:

VEMap.SetScaleBarDistanceUnit

Does this not work for you





Re: PushPin click in 3D map (v4)

SoulSolutions

No. It works for 2D but not for 3D - try this:

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Testing the draw circle function</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="
http://dev.virtualearth.net/mapcontrol/v4/mapcontrol.js"></script>
<script type="text/javascript">
var map = null;
function GetMap()
{
map = new VEMap('myMap');
map.LoadMap();
map.SetScaleBarDistanceUnit(VEDistanceUnit.Kilometers);
}
</script>
</head>
<body onload="GetMap();">
<div id='myMap' style="position:relative; width:800px; height:600px;"></div>
</body>
</html>

John.






Re: PushPin click in 3D map (v4)

Duncan Lawler

The Set scale unit works, but there's a bug that it doesn't persist across mode switches. Until it's fixed, you can work around it by setting it again every time you switch modes.