wboykinm

Adding labels to OL

Aug 24th, 2011
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 0.44 KB | None | 0 0
  1. //create a style object
  2. var style = new OpenLayers.Style();
  3. //rule used for all polygons
  4. var rule_acres = new OpenLayers.Rule({
  5. symbolizer: {
  6.     fillColor: "#ff9a9a",
  7.     fillOpacity: 0.5,
  8.     strokeColor: "#000000",
  9.     strokeWidth: 1,
  10.     strokeDashstyle: "dash",
  11.     label: "${acres}",
  12.     labelAlign: "cc",
  13.     fontColor: "#333333",
  14.     fontOpacity: 0.9,
  15.     fontFamily: "Arial",
  16.     fontSize: 14}
  17. });
  18. style.addRules([rule_acres]);
Advertisement
Add Comment
Please, Sign In to add comment