mapnik/demo/c++
Blake Thompson badb0c9a97 This is a complete removal of code that utilizes image_32 in the library. It is a sweeping change that does some of the following:
* Changes all agg_renderers to use a image_data_any variant (only image_data_rgba8 is implemented currently)
* Changes the marker and marker_cache to use image_data_any images
* Changes the symbolizers so that they must be aware of the source data type they are attempting to render and the render type that is expected to be rendered into.
* Moves many utilities into image_utils, that were previously in image_32.

The kicker is that this still isn't working perfectly yet, but I am commiting so I don't have tears in case everything is lost on my computer.

Ref #2633
2015-01-20 18:30:10 -06:00
..
build.py scons: support MAPNIK_NAME option to customize libmapnik name for custom packaging 2014-06-09 13:55:56 -07:00
common.gypi add details for how to build rundemo.cpp standalone on windows with gyp 2013-05-22 23:23:11 -07:00
Makefile add details for how to build rundemo.cpp standalone on windows with gyp 2013-05-22 23:23:11 -07:00
README.md Fix example of building vs files with gyp on windows 2013-05-24 14:29:11 -06:00
rundemo.cpp This is a complete removal of code that utilizes image_32 in the library. It is a sweeping change that does some of the following: 2015-01-20 18:30:10 -06:00
rundemo.gyp rundemo.gyp now working on windows 2013-05-23 00:46:55 -07:00

rundemo.cpp

This directory contains a simple c++ program demonstrating the Mapnik C++ API. It mimics the python 'rundemo.py' example with a couple exceptions.

If building on unix you can have this program automatically build by configuring Mapnik like:

./configure DEMO=True

However, this example code also should be able to be built standalone.

The following notes describe how to do that on various operating systems.

Depends

  • Mapnik library development headers
  • mapnik-config on unix and mapnik-config.bat on windows

Unix

On OS X and Linux you also need make.

Windows

On windows, additional dependencies to build are:

mapnik-config.bat should come with your Mapnik installation.

First confirm it is on your path:

mapnik-config # should give usage

To install gyp, which is pure python do:

svn checkout http://gyp.googlecode.com/svn/trunk/ gyp
cd gyp
python setup.py install

If you do not have svn installed you can grab gyp from:

https://github.com/TooTallNate/node-gyp/archive/master.zip
# unzip and extract the 'gyp' subfolder then do
cd gyp
python setup.py install

Building the demo

Unix

Simply type:

make

Then to run do:

./rundemo mapnik-config --prefix

On OS X you can also create an xcode project:

gyp rundemo.gyp --depth=. -f xcode --generator-output=./build/
xcodebuild -project ./build/rundemo.xcodeproj
./build/out/Release/rundemo `mapnik-config --prefix`

Windows

First you need to build the visual studio solution with gyp:

C:\Python27\python.exe c:\Python27\Scripts\gyp rundemo.gyp --depth=. -f msvs -G msvs_version=2010

Then you can compile with msbuild:

msbuild rundemo.sln /p:Configuration="Release" /p:Platform=Win32

Then run it!

for /f %i in ('mapnik-config --prefix') do set MAPNIK_PREFIX=%i
Release\rundemo.exe %MAPNIK_PREFIX%