Giter Site home page Giter Site logo

i-conic-vision-ab / wxwebmap Goto Github PK

View Code? Open in Web Editor NEW
11.0 3.0 5.0 4.14 MB

A C++ library enabling web maps in desktop applications (Windows, Linux, MacOS).

License: Other

CMake 38.73% HTML 6.13% C++ 52.22% JavaScript 2.92%
wxwidgets leaflet maps geographical-information-system cpp webview win linux

wxwebmap's Introduction

wxWebMap

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.

wxWidgets

The library is based on wxWidgets and the web map is displayed using a wxWebView window.

leafletjs

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.

Sample application

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....

wxWebMapApp

Build instructions

Install required packages

  1. Install vcpkg by following these instructions: https://vcpkg.io/en/getting-started.html
  2. Set environment variable CMAKE_TOOLCHAIN_FILE to [path to vcpkg]/scripts/buildsystems/vcpkg.cmake
  3. Install wxWidgets
    Windows: $ .\vcpkg.exe install wxwidgets:x64-windows
    Linux:   $ .\vcpkg.exe install wxwidgets:x64-linux
    
  4. Clone the wxWebMap repository from https://github.com/I-CONIC-Vision-AB/wxWebMap

Build with Visual Studio

Open the wxWebMap folder in Visual Studio. CMake configuration should start automatically. Choose your preset (debug/release) and build.

Build with CMake command

$ 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

Known issues

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).

wxwebmap's People

Contributors

alexanderskalski avatar andvra avatar deadvard avatar hwiman-iconic avatar nolanderc avatar ollenassen avatar sardnas avatar zaina-ram avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

wxwebmap's Issues

error: cast from ‘wxMapMarker*’ to ‘int’ loses precision

raphy@raohy:~/wxWidgets/wxWebMap$ cmake --build builddir
-- Configuring done (0.1s)
-- Generating done (0.0s)
-- Build files have been written to: /home/raphy/wxWidgets/wxWebMap/builddir
[  7%] Building CXX object src/CMakeFiles/IconicWebMap.dir/wxMapMarker.cpp.o
/home/raphy/wxWidgets/wxWebMap/src/wxMapMarker.cpp: In constructor ‘wxMapMarker::wxMapMarker(double, double, bool)’:
/home/raphy/wxWidgets/wxWebMap/src/wxMapMarker.cpp:13:18: error: cast from ‘wxMapMarker*’ to ‘int’ loses precision [-fpermissive]
   13 |     cLeafletId = (int)this;
      |                  ^~~~~~~~~
gmake[2]: *** [src/CMakeFiles/IconicWebMap.dir/build.make:104: src/CMakeFiles/IconicWebMap.dir/wxMapMarker.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:131: src/CMakeFiles/IconicWebMap.dir/all] Error 2
gmake: *** [Makefile:136: all] Error 2

OS: Ubuntu 23.10

The URL can't be shown

In CMakeLists.txt I added the -fpemissive flag:

set(GCC_WARNING_OPTIONS_FLAGS "-fpermissive")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_WARNING_OPTIONS_FLAGS}")

and then compiled and built:

raphy@raohy:~/wxWidgets/wxWebMap$ cmake --build builddir/
[  7%] Building CXX object src/CMakeFiles/IconicWebMap.dir/wxMapHtml.cpp.o
[ 15%] Building CXX object src/CMakeFiles/IconicWebMap.dir/wxMapImage.cpp.o
[ 23%] Building CXX object src/CMakeFiles/IconicWebMap.dir/wxMapMarker.cpp.o
/home/raphy/wxWidgets/wxWebMap/src/wxMapMarker.cpp: In constructor ‘wxMapMarker::wxMapMarker(double, double, bool)’:
/home/raphy/wxWidgets/wxWebMap/src/wxMapMarker.cpp:13:18: warning: cast from ‘wxMapMarker*’ to ‘int’ loses precision [-fpermissive]
   13 |     cLeafletId = (int)this;
      |                  ^~~~~~~~~
[ 30%] Building CXX object src/CMakeFiles/IconicWebMap.dir/wxMapObject.cpp.o
[ 38%] Building CXX object src/CMakeFiles/IconicWebMap.dir/wxMapPolygon.cpp.o
[ 46%] Building CXX object src/CMakeFiles/IconicWebMap.dir/wxWebMap.cpp.o
[ 53%] Linking CXX shared library ../lib/libIconicWebMap.so
[ 53%] Built target IconicWebMap
[ 61%] Building CXX object examples/wxWebMapApp/CMakeFiles/wxWebMapApp.dir/wxWebMapApp.cpp.o
[ 69%] Building CXX object examples/wxWebMapApp/CMakeFiles/wxWebMapApp.dir/wxWebMapFrame.cpp.o
[ 76%] Building CXX object examples/wxWebMapApp/CMakeFiles/wxWebMapApp.dir/SourceViewDialog.cpp.o
[ 84%] Building CXX object examples/wxWebMapApp/CMakeFiles/wxWebMapApp.dir/PolygonReader.cpp.o
[ 92%] Building CXX object examples/wxWebMapApp/CMakeFiles/wxWebMapApp.dir/ImageReader.cpp.o
[100%] Linking CXX executable ../../bin/wxWebMapApp
[100%] Built target wxWebMapApp

But I get : The URL can't be shown

image

OS: Ubuntu 23.10

Is it possible to build this project under mingw(msys2)

Hi, this is a great project.

For me, I'm using the msys2/mingw64 gcc under Windows, so is it possible to build this project under GCC? the wx library can be install by the pacman command.

Another issue is I see there is a git log message said: remove the boost dependency, but I see in the github homepage, it is still mention the boost library.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.