@@ -100,9 +100,9 @@ <h2 class='med-news'><a href="{{site.baseurl}}{{ post1-url }}"> {{ post1-title }
100100 < div class ='col3 margin2 pad8y prose '>
101101 < div class ='big '> code in your language</ div >
102102 < p class ='space-top1 '> mapnik's high-quality bindings let's you choose from Node.js, Python, and C++.</ p >
103- < div class ='col12 pill '> <!--
104- --> < a href ='http://mapnik.org/node-mapnik/documentation/ ' class ='button stroke light short col6 '> Node.js</ a > <!--
105- --> < a href ='http://mapnik.org/docs/v2.2.0/api/python/index.html ' class ='button light stroke short col6 '> Python</ a >
103+ < div class ='col12 pill '>
104+ < a href ='http://mapnik.org/node-mapnik/documentation/ ' class ='button stroke light short col6 '> Node.js</ a >
105+ < a href ='http://mapnik.org/docs/v2.2.0/api/python/index.html ' class ='button light stroke short col6 '> Python</ a >
106106 </ div >
107107 </ div >
108108
@@ -111,64 +111,64 @@ <h2 class='med-news'><a href="{{site.baseurl}}{{ post1-url }}"> {{ post1-title }
111111
112112 < div class ="container ">
113113 < ul class ='tabs '>
114- < li class ='tab-link current ' data-tab ='tab-1 '> Python</ a > </ li > <!--
115- --> < li class ='tab-link ' data-tab ='tab-2 '> Node</ a > <!--
116- --> < li class ='tab-link ' data-tab ='tab-3 '> C++</ a >
117- </ ul >
118- < div id ="tab-1 " class ="tab-content current ">
119- {% highlight python %}
120- import mapnik
121- m = mapnik.Map(256,256)
122- mapnik.load_map(m, 'path/to/file.xml')
123- m.zoom_all()
124- mapnik.render_to_file(m, 'the_image.png')
125- {% endhighlight %}
126- </ div >
127-
128- < div id ="tab-2 " class ="tab-content ">
129- {% highlight javascript %}
130- var mapnik = require('mapnik');
131- var fs = require('fs');
132- // register fonts and datasource plugins
133- mapnik.register_default_fonts();
134- mapnik.register_default_input_plugins();
135- var map = new mapnik.Map(256, 256);
136- map.load('./test/stylesheet.xml', function(err,map) {
137- if (err) throw err;
138- map.zoomAll();
139- var im = new mapnik.Image(256, 256);
140- map.render(im, function(err,im) {
141- if (err) throw err;
142- im.encode('png', function(err,buffer) {
143- if (err) throw err;
144- fs.writeFile('map.png',buffer, function(err) {
145- if (err) throw err;
146- console.log('saved map image to map.png');
147- });
148- });
149- });
150- });
151- {% endhighlight %}
152- </ div >
114+ < li class ='tab-link current ' data-tab ='tab-1 '> Python</ li >
115+ < li class ='tab-link ' data-tab ='tab-2 '> Node</ li >
116+ < li class ='tab-link ' data-tab ='tab-3 '> C++</ li >
117+ </ ul >
118+ < div id ="tab-1 " class ="tab-content current ">
119+ {% highlight python %}
120+ import mapnik
121+ m = mapnik.Map(256,256)
122+ mapnik.load_map(m, 'path/to/file.xml')
123+ m.zoom_all()
124+ mapnik.render_to_file(m, 'the_image.png')
125+ {% endhighlight %}
126+ </ div >
153127
154- < div id ="tab-3 " class ="tab-content ">
155- {% highlight python %}
156- #include < mapnik /map.hpp>
157- #include < mapnik /load_map.hpp>
158- #include < mapnik /agg_renderer.hpp>
159- #include < mapnik /image.hpp>
160- #include < mapnik /image_util.hpp>
161-
162- main() {
163- mapnik::Map m(256,256);
164- mapnik::load_map(m, 'path/to/file.xml');
165- m.zoom_all();
166- mapnik::image_rgba8 im(256,256);
167- mapnik::agg_renderer< mapnik::image _rgba8 > ren(m, im);
168- ren.apply();
169- mapnik::save_to_file(im, 'the_image.png');
170- }
171- {% endhighlight %}
128+ < div id ="tab-2 " class ="tab-content ">
129+ {% highlight js %}
130+ var mapnik = require('mapnik');
131+ var fs = require('fs');
132+ // register fonts and datasource plugins
133+ mapnik.register_default_fonts();
134+ mapnik.register_default_input_plugins();
135+ var map = new mapnik.Map(256, 256);
136+ map.load('./test/stylesheet.xml', function(err,map) {
137+ if (err) throw err;
138+ map.zoomAll();
139+ var im = new mapnik.Image(256, 256);
140+ map.render(im, function(err,im) {
141+ if (err) throw err;
142+ im.encode('png', function(err,buffer) {
143+ if (err) throw err;
144+ fs.writeFile('map.png',buffer, function(err) {
145+ if (err) throw err;
146+ console.log('saved map image to map.png');
147+ });
148+ });
149+ });
150+ });
151+ {% endhighlight %}
152+ </ div >
153+ < div id ="tab-3 " class ="tab-content ">
154+ {% highlight c++ %}
155+ #include < mapnik /map.hpp>
156+ #include < mapnik /load_map.hpp>
157+ #include < mapnik /agg_renderer.hpp>
158+ #include < mapnik /image.hpp>
159+ #include < mapnik /image_util.hpp>
160+
161+ main()
162+ {
163+ mapnik::Map m(256,256);
164+ mapnik::load_map(m, "path/to/file.xml");
165+ m.zoom_all();
166+ mapnik::image_rgba8 im(256,256);
167+ mapnik::agg_renderer< mapnik::image _rgba8 > ren(m, im);
168+ ren.apply();
169+ mapnik::save_to_file(im, "the_image.png");
170+ }
171+ {% endhighlight %}
172172</ div >
173173
174174</ div >
@@ -187,22 +187,23 @@ <h2 class='big'>style with a stylesheet</h2>
187187 </ div >
188188
189189 < div class ='col7 pad4x space-bottom4 '>
190- < div class ='fill-white '> {% highlight xml linenos %}
191- < Map background-color ="blue " srs ="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs ">
192- < Style name ="My Style ">
193- <Rule>
194- <PolygonSymbolizer fill= "#f2eff9" / >
195- <LineSymbolizer stroke= "rgb(50%,50%,50%)" stroke-width = "0.1" / >
196- </ Rule>
197- </ Style >
198- < Layer name ="world " srs ="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs ">
199- < StyleName > My Style</ StyleName >
200- < Datasource >
201- < Parameter name ="file "> path/to/shapefile.shp</ Parameter >
202- < Parameter name ="type "> shape</ Parameter >
203- </ Datasource >
204- </ Layer >
205- </ Map >
190+ < div class ='fill-white '>
191+ {% highlight xml%}
192+ < Map background-color ="blue " srs ="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs ">
193+ < Style name ="My Style ">
194+ <Rule>
195+ <PolygonSymbolizer fill= "#f2eff9" / >
196+ <LineSymbolizer stroke= "rgb(50%,50%,50%)" stroke-width = "0.1" / >
197+ </ Rule>
198+ </ Style >
199+ < Layer name ="world " srs ="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs ">
200+ < StyleName > My Style</ StyleName >
201+ < Datasource >
202+ < Parameter name ="file "> path/to/shapefile.shp</ Parameter >
203+ < Parameter name ="type "> shape</ Parameter >
204+ </ Datasource >
205+ </ Layer >
206+ </ Map >
206207 {% endhighlight %}</ div >
207208 </ div >
208209</ div >
0 commit comments