This project is read-only.

Coord Control

May 21, 2009 at 12:54 PM

Hi

I have a map control with the following XAML declaration:

 

 

 

 

 

<font size="2" color="#a31515"><font size="2" color="#a31515">

<DeepEarth

</font></font><font size="2" color="#a31515">

 

</font>

:Map x:Name="map" Width="694" Height="410" Canvas.Left="19" Canvas.Top="0" ZoomLevel="15" Visibility="Visible">

<font size="2" color="#a31515"><font size="2" color="#a31515">

 

</font></font>
<font size="2" color="#a31515">

 

</font>

 

      <DeepControls:NavControl><font size="2" color="#a31515"><font size="2" color="#a31515">

 

</font></font>
<font size="2" color="#a31515">

 

</font>

 

            <local:MapSourceControl x:Name="mapSourceControl"/><font size="2" color="#a31515"><font size="2" color="#a31515">

 

</font></font>
<font size="2" color="#a31515">

 

</font>

 

      </DeepControls:NavControl><font size="2" color="#a31515"><font size="2" color="#a31515">

 

</font></font>
<font size="2" color="#a31515">

 

</font>

 

</DeepEarth:Map>

I need create a CoordControl in code behind, in the CS file I Have:

 

 

 

 

 

 

 

<font size="2">

 

</font>

 

public PageMapa()

{

      InitializeComponent();

 

<font size="2">

 

</font>

 

<font size="2">

      map.Events.MapLoaded +=

</font>

this.Events_MapLoaded;<font size="2">

 

</font>

 

<font size="2">

      _OsmOsmarendTileLayer = 

</font>

new OsmTileSource(OsmMapModes.Osmarend);<font size="2">

 

</font>

 

<font size="2">

      SetMapSource(

</font>

OsmMapModes.Osmarend);

 

 

 

<font size="2">

 

</font>

 

      CoordControl coordenadas = new CoordControl(map);<font size="2">

      coordenadas.VerticalAlignment =

</font>

VerticalAlignment.Bottom;<font size="2">

      coordenadas.HorizontalAlignment =

</font>

HorizontalAlignment.Right;<font size="2">

      coordenadas.Visibility =

</font>

Visibility.Visible;

}

When I run the program the coordcontrol is no visible. What are I doing bad? (Posibly all)

Regards.

Alejandro

May 22, 2009 at 1:14 AM

 

 

 

<font size="2">

 

</font>

 

 

I'm found a solution:

CoordControl coordenadas = new CoordControl();<font size="2">

coordenadas.VerticalAlignment =

</font>

VerticalAlignment.Bottom;<font size="2">

coordenadas.HorizontalAlignment =

</font>

HorizontalAlignment.Right;<font size="2">

coordenadas.Visibility =

</font>

Visibility.Visible;

map.Layers.Add(coordenadas)

Regards.

Aleajndro