[mapguide-users] lines over maps

GM_Mizar giampiero.massa at torino.miz.it
Thu Mar 1 12:47:33 EST 2007


I'm trying to draw lines over a map but I need help...

I've seen the redlining example in the developer guide sample, I've the need
to set up the style of dynamic lines not from code but using the MapGuide
Studio.

My idea:
1) define in MapGuide Studio a data source (with X-Y geometry)
2) define a layer that use this feature. Here I can define styles related to
feature parameters (thickness, color, ...) 
3) add lines to the feature at run-time

First of all, I get my layer:

MgLayerBase roadLayer = map.GetLayers().GetItem("ROADS"); // ROADS has been
defined using MapStudio

After, I need the class definition 

MgResourceIdentifier resourceIdentifier = new
MgResourceIdentifier(roadLayer.GetFeatureSourceId());
MgClassDefinition classDefinition =
featureService.GetClassDefinition(resourceIdentifier, "Default",
roadLayer.GetFeatureClassName()); // THIS DOESN'T WORK, RETURNS NULL

Having the class definition, I think I will modify it adding a geometry 

MgGeometricPropertyDefinition geometryProperty = new
MgGeometricPropertyDefinition("SHPGEOM");
geometryProperty.SetGeometryTypes(MgFeatureGeometricType.Surface);  
classDefinition.GetProperties().Add(geometryProperty); 

At the end, I'll add lines using the same code like the example.

Am I on a wrong way? How can I define a geometry for lines in an existing
layer/feature?

Thanks very much in advance for every reply.

GM



-- 
View this message in context: http://www.nabble.com/lines-over-maps-tf3328503s16610.html#a9254678
Sent from the MapGuide Users mailing list archive at Nabble.com.



More information about the mapguide-users mailing list