Advertisement
Guest User

Untitled

a guest
Jan 21st, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. //
  2. // -------- Defining default style settings ----------
  3. //
  4. var fill = new ol.style.Fill({
  5. color: 'rgba(255,255,255,0.4)'
  6. });
  7. var stroke = new ol.style.Stroke({
  8. color: '#3399CC',
  9. width: 1.25
  10. });
  11. var text = new ol.style.Text({
  12. text: "",
  13. font: "16px Calibri,sans-serif",
  14. fill: new ol.style.Fill({
  15. color: [255, 255, 255, 1]
  16. }),
  17. stroke: new ol.style.Stroke({
  18. color: [0, 0, 0, 1],
  19. width: 2.5
  20. })
  21. });
  22.  
  23. var image = new ol.style.Circle({
  24. fill: fill,
  25. stroke: stroke,
  26. radius: 5
  27. });
  28.  
  29. var icon = new ol.style.Icon({
  30. anchor: [0.5, 0.5],
  31. size: [52, 52],
  32. offset: [52, 0],
  33. opacity: 0.5,
  34. scale: 1.0,
  35. src: "./img/mmOrange.png"
  36. });
  37.  
  38. var style = new ol.style.Style({
  39. image: image, // this works, but when I use image: icon, nothing is displayed
  40. fill: fill,
  41. stroke: stroke,
  42. text: text
  43. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement