Hi Experts,
I have been trying to learn something very trivial but have not been able to as yet; so I now revert to your assistance.
I have this
<div id="mapDiv" runat="server" style="....."</div>
and I've been trying to pass to it a map.setView(....) command through a linkbutton from the same page.
map = new Microsoft.Maps.Map(document.getElementById("mapDiv"))
Can you please indicate how to do this?
The closest guess from my side so far has been
<asp:LinkButton ID="LinkButton1" Text="Change Location" OnClick="javascript:Loc1();" runat="server"
and
Loc1 = function(){map.setView(........)}
I know this is not right but don't get the wrong impression, I'm just very green at this :(
Thanks a lot,
Justin
EDIT: the code lies hereunder
<table class="style1">
<tr>
<td>
<h1>Geolocation demo</h1>
<div id="mapDiv" style="position: relati..........);">
</div>
</td>
<td>
<div id="accordion">
<h3><a href="#">North Region</a></h3>
<div>
<asp:LinkButton ID="LinkButton1" Text="Location 1" OnClientClick="javascript:NT1();" runat="server"/>
<p>Location 2</p>
<p>Location 3</p>
</div>
</div>
</td>
</tr>
</table>
<script type="text/javascript" src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0"></script>
<script type="text/javascript">
var map = null;
window.onload = function ()
{
var cred = "YOUR_BING_MAPS_KEY";
map = new Microsoft.Maps.Map(document.getElementById("mapDiv"),
{ credentials: cred, showDashboard: false });
:
:
:
:
NT1 = function ()
{
map.setView({ zoom: 5, center: new Microsoft.Maps.Location(35.96592, 14.344196) })
}
</script>