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