00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef LAYER_HPP
00025 #define LAYER_HPP
00026
00027 #include <mapnik/feature.hpp>
00028 #include <mapnik/datasource.hpp>
00029
00030 #include <boost/shared_ptr.hpp>
00031
00032 #include <vector>
00033
00034 namespace mapnik
00035 {
00036 class MAPNIK_DECL Layer
00037 {
00038 public:
00039 explicit Layer(std::string const& name, std::string const& srs="+proj=latlong +datum=WGS84");
00040 Layer(Layer const& l);
00041 Layer& operator=(Layer const& l);
00042 bool operator==(Layer const& other) const;
00043 void set_name(std::string const& name);
00044 const std::string& name() const;
00045 void set_title(std::string const& title);
00046 const std::string& title() const;
00047 void set_abstract(std::string const& abstract);
00048 const std::string& abstract() const;
00049 void set_srs(std::string const& srs);
00050 std::string const& srs() const;
00051 void add_style(std::string const& stylename);
00052 std::vector<std::string> const& styles() const;
00053 std::vector<std::string>& styles();
00054 void setMinZoom(double minZoom);
00055 void setMaxZoom(double maxZoom);
00056 double getMinZoom() const;
00057 double getMaxZoom() const;
00058 void setActive(bool active);
00059 bool isActive() const;
00060 void setQueryable(bool queryable);
00061 bool isQueryable() const;
00062 bool isVisible(double scale) const;
00063 void set_clear_label_cache(bool clear_cache);
00064 bool clear_label_cache() const;
00065 void set_datasource(datasource_ptr const& ds);
00066 datasource_ptr datasource() const;
00067 Envelope<double> envelope() const;
00068 ~Layer();
00069 private:
00070 void swap(const Layer& other);
00071
00072 std::string name_;
00073 std::string title_;
00074 std::string abstract_;
00075 std::string srs_;
00076
00077 double minZoom_;
00078 double maxZoom_;
00079 bool active_;
00080 bool queryable_;
00081 bool clear_label_cache_;
00082 std::vector<std::string> styles_;
00083 datasource_ptr ds_;
00084 };
00085 }
00086
00087 #endif //LAYER_HPP