<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
You would have to have a layer with labels.<br>
<br>
You do this by assigning an empty style for the point, and then set the
label style.<br>
This will place labels where the points are, but does not show the
points themselves.<br>
For the layer datasource, simply point to the datasource that contains
the label positions as points.<br>
<br>
Whenever you want to display labels, simply turn on the layer.<br>
You may want some logic to ensure that the label layer follows the
actual layer (the one with data).<br>
<br>
If your layer only stores polygons, and your datasource supports mixed
geometry, you can<br>
display the data and labels using a single layer.<br>
<br>
If your datasource is ODBC (which only supports points), you can simply
have the x,y values stored,<br>
and update them with SQL.<br>
<br>
Otherwise you have to use the MapGuide FDO wrapper, which has a bit
step learning curve (MgFeatureService).<br>
<br>
The problem would be the "select and move" part, as the AJAX viewer has
no support for that.<br>
<br>
You could turn on the point style, and make them selectable.<br>
The user can then select a point, click a "move" button, and click at
the new location.<br>
A bit crude, but it would work.<br>
<br>
As I mentioned, OpenLayers has a much more refined way of doing this:<br>
<a class="moz-txt-link-freetext" href="http://openlayers.org/dev/examples/drag-feature.html">http://openlayers.org/dev/examples/drag-feature.html</a><br>
and<br>
<a class="moz-txt-link-freetext" href="http://openlayers.org/dev/examples/modify-feature.html">http://openlayers.org/dev/examples/modify-feature.html</a><br>
<pre class="moz-signature" cols="72">Regards, Kenneth Skovhede, GEOGRAF A/S
</pre>
<br>
<br>
mighty_duck skrev:
<blockquote cite="mid:1250770790744-3478656.post@n2.nabble.com"
 type="cite">
  <pre wrap="">Hello, 

thanks for reply

so, does that mean , for example, that I can keep coordinates of label in
database and use them when I want to show labels on map? And if I would like
to be able to change position of those labels...I would need to implement my
own "labeling" depending on the coordinates from database???

Im using AJAX viewer.

regards



Kenneth Skovhede, GEOGRAF A/S wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">You have very little control over labels, they are automatically placed 
on top of the objects the label.
You have some offset and rotation, but it is difficult to use for 
absolute positioning.

I would recommend that you use points (in same datasource or seperate) 
and use those to
position the labels correctly.

There are no interactive editing of labels or features in the AJAX viewer.
If you use OpenLayers (or Fusion), you could extract the points
as a vector layer, which can then be manipulated and has mouse events.

Regards, Kenneth Skovhede, GEOGRAF A/S



mighty_duck skrev:
    </pre>
    <blockquote type="cite">
      <pre wrap="">Hello,

Does anyone know is it possible to work with labels im map viewer? I need
something like be able to move labels on the map with mouse moving(catch
label with mouse and change location of label)? Is is possible to do with
javascript?

thanks in advance

regards
  
      </pre>
    </blockquote>
    <pre wrap="">_______________________________________________
mapguide-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/mapguide-users">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a>


    </pre>
  </blockquote>
  <pre wrap=""><!---->
  </pre>
</blockquote>
</body>
</html>