Hi Lorenzo,
here the Layer definition:
#### begin ###
<LayerDefinition xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="
http://www.w3.org/2001/XMLSchema" xsi:noNamespaceSchemaLocation="LayerDefinition-1.1.0.xsd" version="1.1.0">
<VectorLayerDefinition>
<ResourceId>Library://sqlservertest2/db1.FeatureSource</ResourceId>
<FeatureName>dbo:geom</FeatureName>
<FeatureNameType>FeatureClass</FeatureNameType>
<Filter />
<PropertyMapping>
<Name>id</Name>
<Value>id</Value>
</PropertyMapping>
<PropertyMapping>
<Name>name</Name>
<Value>name</Value>
</PropertyMapping>
<Geometry>graphik</Geometry>
<Url />
<ToolTip />
<VectorScaleRange>
<PointTypeStyle>
<DisplayAsText>false</DisplayAsText>
<AllowOverpost>false</AllowOverpost>
<PointRule>
<LegendLabel />
<Label>
<Unit>Points</Unit>
<SizeContext>DeviceUnits</SizeContext>
<SizeX>10</SizeX>
<SizeY>10</SizeY>
<Rotation>0</Rotation>
<MaintainAspect>true</MaintainAspect>
<Text>name</Text>
<FontName>Arial</FontName>
<ForegroundColor>000000</ForegroundColor>
<BackgroundColor>ffffff</BackgroundColor>
<BackgroundStyle>Transparent</BackgroundStyle>
<HorizontalAlignment>'Center'</HorizontalAlignment>
<VerticalAlignment>'Baseline'</VerticalAlignment>
<Bold>false</Bold>
<Italic>false</Italic>
<Underlined>false</Underlined>
</Label>
<PointSymbolization2D>
<Mark>
<Unit>Points</Unit>
<SizeContext>DeviceUnits</SizeContext>
<SizeX>10</SizeX>
<SizeY>10</SizeY>
<Rotation>0</Rotation>
<MaintainAspect>true</MaintainAspect>
<InsertionPointX>0</InsertionPointX>
<InsertionPointY>0</InsertionPointY>
<Shape>Circle</Shape>
<Fill>
<FillPattern>Solid</FillPattern>
<ForegroundColor>ff000000</ForegroundColor>
<BackgroundColor>ffffffff</BackgroundColor>
</Fill>
</Mark>
</PointSymbolization2D>
</PointRule>
</PointTypeStyle>
<LineTypeStyle>
<LineRule>
<LegendLabel />
<LineSymbolization2D>
<LineStyle>Solid</LineStyle>
<Thickness>1</Thickness>
<Color>000000</Color>
<Unit>Points</Unit>
<SizeContext>DeviceUnits</SizeContext>
</LineSymbolization2D>
</LineRule>
</LineTypeStyle>
</VectorScaleRange>
</VectorLayerDefinition>
</LayerDefinition>
#### end ###
I'm only working with GEOMETRY type in MSSQL.
My table "geom" have 3 columns:
ID (primary key, autoincrment)
name (nchar)
graphik (geometry, with index)
Have you set a primary key column?
In the database I use mixed mode for login. From MG maestro I'm using Specified credentials to make the connection to mssql server.
Sorry, I din't tell you, that I'm using MGOS 2.1 beta with PHP on XP.
With MGOS 2.0.2 (and the beta provider) I got an other problem: If there are more the 7323 lines (I have only tested line objects) in the database, it was impossible to make a selection. So I was trying 2.1.
LFELLI wrote:
Hi Peter,
thx for the tip, but unfortunatly doesn't solve my problem.
My table is called "Streets" so i write
<FeatureName>dbo:Streets</FeatureName>. I added the layer to the map but i still have no layer on the client side.
Just for a test, in the map editor, i push the "Set view to current layers extent" using the Sql Server layer and i receive the following error message: "Failed to get layer extent: No spatial data found in layer"
I notice that no Geometry is set in the XML, is this correct?
May i ask you to post your layer configuration in XML?
Opening the WebGis client, i'm able to see the other layer loaded with FDO SHP but no evidence for the sql one.
No error reports on Error.log file.
All my SHP layers has SRID 4326. I loaded the Streets layer in SqlServer using SqlSpatialTools from www.sharpgis.net using SRID 4326.
Lorenzo