arcgis for js 沿线标注


// create a text symbol to define the style of labels
var statesColor = new Color("#1C8E03");
var statesLabel = new TextSymbol().setColor(statesColor);
statesLabel.font.setSize("9pt");
statesLabel.font.setFamily("微软雅黑");

//this is the very least of what should be set within the JSON
var json = {
"labelExpressionInfo": {"value": "{NAME}"},
"labelPlacement": "above-along"
};
//Polyline/Line: "above-after", "above-along", "above-before", "above-start", "above-end", "below-after", "below-along", "below-before", "below-start", "below-end", "center-after", "center-along", "center-before", "center-start", "center-end"
//create instance of LabelClass (note: multiple LabelClasses can be passed in as an array)
var labelClass = new LabelClass(json);
labelClass.symbol = statesLabel; // symbol also can be set in LabelClass' json
labelClass.minScale = 150000;
featureLayer.setLabelingInfo([ labelClass ]);


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM