如果有办法将CSS类.marker
绑定到图形图层中的ArcGIS SimpleMarkerSymbol
,是否可以告诉我?
我有SimpleMarkerSymbol
名为schoolMarker
,我使用ESRI的选项设置它,但我需要添加更多CSS样式,例如.marker
var schoolMarker = new SimpleMarkerSymbol();
schoolMarker.setStyle(SimpleMarkerSymbol.STYLE_CIRCLE);
schoolMarker.setSize(30);
schoolMarker.setOutline(null);
schoolMarker.setColor(new Color([255,116,0,0.25]));
这是CSS类:
.marker{
stroke-linecap: round;
stroke-linejoin: round;
stroke-opacity: 1.0;
fill-opacity: 1.0;
background-color: rgb(0, 89, 190);
stroke: rgb(0, 89, 190);
fill: rgb(0, 89, 190);
fill-opacity: 1;
stroke-width: 70pt;
stroke-opacity: 1;
opacity: 0.12;
}
答案 0 :(得分:0)
这是一本很好的入门指南
https://developers.arcgis.com/javascript/3/jshelp/inside_styling_svg.html
值得注意的是:
将要素图层的样式属性设置为false。这意味着您完全负责样式的功能。
设置(或找出它是什么)dataAttributes。在渲染的html中,它们看起来像这样
<path fill="none" fill-opacity="0" stroke="none" stroke-opacity="0" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="4" path="M 548,163 549,163 549,164 548,164 Z" d="M 548 163 549 163 549 164 548 164Z" transform="matrix(1.00000000,0.00000000,0.00000000,1.00000000,0.00000000,0.00000000)" data-unique-value="LIBRARY"></path>