A C++ library enabling web maps in desktop applications (Windows, Linux, MacOS). A wxWebMap is a wxWindow that can be added to your wxWidgets application to show maps, add map objects and edit map objects.
The library is based on wxWidgets
and the web map is displayed using a wxWebView
window.
The map functionality is implemented using leafletjs
. Leafletjs javascript
snippets to e.g. add a marker to a map are executed by calling e.g. wxWebMap::AddMapObject
.
In examples/wxWebMapApplication there is a sample application with GUI. It is based on the wxWidgets wxWebView sample and opens a map in the web view.
To demonstrate the C++ binding to the map, you can add markers, polygons or images using Menu->Map->Add marker|polygons|images...
.
- Install vcpkg by following these instructions: https://vcpkg.io/en/getting-started.html
- Set environment variable CMAKE_TOOLCHAIN_FILE to [path to vcpkg]/scripts/buildsystems/vcpkg.cmake
- Install wxWidgets
Windows: $ .\vcpkg.exe install wxwidgets:x64-windows Linux: $ .\vcpkg.exe install wxwidgets:x64-linux
- Clone the wxWebMap repository from https://github.com/I-CONIC-Vision-AB/wxWebMap
Open the wxWebMap folder in Visual Studio. CMake configuration should start automatically. Choose your preset (debug/release) and build.
$ cmake -S . --preset=[preset name]
$ cmake --build out/build/[preset name]
Available presets are:
- linux-x64-debug
- linux-x64-release
- windows-x64-debug
- windows-x64-release
If you run into problems when compiling wxWidgets or even if compilation works but you get messages like "wx*.dll not found" when running sample applications. Replace the ./vcpkg/ports/wxwidgets/portfile.cmake
with the one in wxWebMap/cmake/portfile.cmake
and rebuild wxWidgets (vcpkg install wxwidgets:x64-windows
).