- mode 0644
- if @overlay
- path "/srv/imagery/overlays/#{site}/#{layer}.yml"
- else
- path "/srv/imagery/layers/#{site}/#{layer}.yml"
- end
- content YAML.dump(:name => layer,
- :url => "http://#{site}/layer/#{layer}/{z}/{x}/{y}.png",
- :attribution => copyright,
- :maxZoom => max_zoom)
- end
-
- file "remove old layer yaml" do
- if @overlay
- path "/srv/imagery/layers/#{site}/#{layer}.yml" # remove layer if overlay
- else
- path "/srv/imagery/overlays/#{site}/#{layer}.yml" # remove overlay if layer
- end
- action :delete
+ mode 0o644
+ content YAML.dump(:name => new_resource.layer,
+ :title => new_resource.title || new_resource.layer,
+ :url => "//{s}.#{new_resource.site}/layer/#{new_resource.layer}/{z}/{x}/{y}.png",
+ :attribution => new_resource.copyright,
+ :default => new_resource.default_layer,
+ :maxZoom => new_resource.max_zoom,
+ :overlay => new_resource.overlay)