문제
나 웹 앱을 개발하는 것을 보여주의 위치에서 프로젝트 맵입니다.저는 이 기능을 추가 데이터를 보여주고 싶은 지도층이다.
protected void AgregarPunto(DataTable result)
{
layerObj thislayer = util.MSMap.getLayerByName("poi");
foreach (DataRow dr in result.Rows)
{
shapeObj shp = new shapeObj(mapscript.MS_SHP_POINTM);
shp = shapeObj.fromWKT(dr["the_geom"].ToString());
thislayer.addFeature(shp);
}
}
이 recomendation 에서 사람들에#맵 서버 IRC Channel.하지만 그것은 작동하지 않는다!할 수 있는 누군가가 도움이 이유를 알아의 포인트는 보이지 않???
해결책
당신은 당신을 만들 classObj 및 styleObj 에 대한 당신의 계층?
여기에는 나의 코드 예제:
myLayer.type = OSGeo.MapServer.MS_LAYER_TYPE.MS_LAYER_LINE;
myLayer.status = 1;
myLayer.symbolscaledenom = 1;
// Create a mapping class
OSGeo.MapServer.classObj myClass = new OSGeo.MapServer.classObj(myLayer);
// Create a style
OSGeo.MapServer.styleObj style = new OSGeo.MapServer.styleObj(myClass);
// unitColor = new Color(12, 34, 56);
int red = Convert.ToInt32(unitColor.R);
int green = Convert.ToInt32(unitColor.G);
int blue = Convert.ToInt32(unitColor.B);
style.color.setRGB(red, green, blue);
style.outlinecolor.setRGB(255, 255, 255);
//style.symbol = _map.symbolset.index("circle"); // Here '_map' is an instance of mapObj, this line is not strictly necessary
style.size = 10;
style.minsize = 3; // Change this to your needs
제휴하지 않습니다 StackOverflow