style.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. let globalStyle = {
  2. cityLand(gridcode) {
  3. let fillColor = ["#6E7F8580","#7B9CFB80","#979B4980","#E9920980","#182F1380","#30791380","#0D53AF80"];
  4. return new ol.style.Style({
  5. fill: new ol.style.Fill({
  6. color: fillColor[gridcode],
  7. })
  8. });
  9. },
  10. pointStyle(f){
  11. let colors = ['rgb(7,31,250)','rgb(7,31,250)','rgb(250,189,7)','rgb(7,250,11)']
  12. return new ol.style.Style({
  13. text:new ol.style.Text({
  14. text:f.getId(),
  15. stroke: new ol.style.Stroke({
  16. color: 'rgba(239,236,236)',
  17. width: 1,
  18. }),
  19. fill: new ol.style.Fill({
  20. color: 'rgba(239,236,236)',
  21. }),
  22. font:"16px sans-serif"
  23. }),
  24. image: new ol.style.RegularShape({
  25. stroke: new ol.style.Stroke({
  26. color: colors[f.get('status')],
  27. width: 2,
  28. }),
  29. fill: new ol.style.Fill({
  30. color: colors[f.get('status')],
  31. }),
  32. radius: 15,
  33. points:20,
  34. angle: 0
  35. })
  36. });
  37. }
  38. }