Skip to content

MapCoreGroup/map-bench

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

137 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ—บ๏ธ Map Bench

A React-based benchmarking application for comparing different 3D mapping libraries with Google Photorealistic 3D Tiles integration.

React Vite License

๐ŸŒŸ Overview

Map Bench allows you to compare the performance and rendering quality of four major mapping libraries, all displaying the same Google Photorealistic 3D Tiles. It also features a data layer system to visualize geospatial information like power lines and religious buildings on top of the 3D terrain.

Library Description
Mapbox GL JS Industry-leading WebGL map library with terrain support
MapLibre GL Open-source fork of Mapbox GL JS
ArcGIS (ESRI) Enterprise-grade 3D SceneView with IntegratedMesh3DTilesLayer
CesiumJS High-precision 3D globe for geospatial visualization
Leaflet Lightweight open-source JavaScript library for mobile-friendly interactive maps
MapCore Elbit's MapCore's JavaScript library for geospatial visualization

Want to add another map provider? Check out our guide on adding new map components.

โœจ Features

  • ๐Ÿ”„ Seamless Map Switching - Switch between mapping libraries while preserving camera position
  • ๐ŸŒ Google 3D Tiles - Photorealistic 3D buildings and terrain from Google Maps Platform
  • ๐Ÿ“š Data Layers - Toggleable overlays for geospatial data visualization
  • ๐ŸŽ›๏ธ 2D/3D Toggle - Switch between flat map view and 3D perspective
  • ๐Ÿ“ Location Selector - Pre-configured locations across 4 continents with quality ratings
  • ๐Ÿ“Š Tile Counter - Real-time display of loaded 3D tiles
  • ๐ŸŽจ Modern UI - Sleek dark theme with smooth animations

๐Ÿ—บ๏ธ Data Layers

The application includes a Layers Panel to visualize additional data sets:

Layer Icon Description Source
High Voltage Power Lines โšก Displayed at 15m height to visualize building clearance OpenStreetMap
Religious Buildings ๐Ÿ•Œ Points of interest including Synagogues, Churches, and Mosques OpenStreetMap
Flight Tracking โœˆ๏ธ Real-time aircraft positions with altitude and velocity OpenSky Network

๐Ÿ™๏ธ Pre-configured Locations

The app includes curated locations organized by continent:

๐ŸŒŽ North America

  • New York (Manhattan, Central Park)
  • San Francisco (Golden Gate Bridge, Alcatraz)
  • Las Vegas (The Strip)
  • Los Angeles (Hollywood, Santa Monica)

๐Ÿ‡ฎ๐Ÿ‡ฑ Israel

  • Tel Aviv (Azrieli Towers)
  • Jerusalem (Old City, Western Wall)
  • Haifa (Bahรก'รญ Gardens)
  • Netanya (Beach, Marina)

๐ŸŒ Europe

  • London (Big Ben, Tower Bridge)
  • Paris (Eiffel Tower, Champs-ร‰lysรฉes)
  • Rome (Colosseum, Vatican)
  • Barcelona (Sagrada Famรญlia)

๐ŸŒ Asia

  • Tokyo (Shinjuku, Tokyo Tower)
  • Dubai (Burj Khalifa, Palm)
  • Singapore (Marina Bay Sands)
  • Hong Kong (Victoria Harbour)

๐Ÿš€ Getting Started

Prerequisites

  • Node.js 18+
  • npm or yarn
  • API keys (see below)

Installation

  1. Clone the repository

    git clone https://github.com/moshew/map-bench.git
    cd map-bench
  2. Install dependencies

    npm install
  3. Configure API keys

    Copy the example environment file:

    cp .env.example .env

    Edit .env and add your API keys:

    VITE_MAPBOX_TOKEN=your_mapbox_token_here
    VITE_GOOGLE_API_KEY=your_google_api_key_here
    VITE_CESIUM_TOKEN=your_cesium_token_here
    VITE_MAPTILER_KEY=your_maptiler_k
    VITE_MAPCORE_SERVER_URL=development (http://localhost:5173) or production mapcore server's file
    VITE_GOOGLE_3D_TILES_URL=https://tile.googleapis.com/v1/3dtiles/root.json
    VITE_WAYBACK_MAPTILES_WMTS_URL=https://wayback.maptiles.arcgis.com/arcgis/rest/services/world_imagery/mapserver/wmts/1.0.0/wmtscapabilities.xml
  4. Run the development server

    npm run dev
  5. Open in browser

    Navigate to http://localhost:5173

๐Ÿ”‘ API Keys

Service Required Get Your Key
Mapbox โœ… Yes account.mapbox.com
Google Maps โœ… Yes console.cloud.google.com
Cesium Ion Optional cesium.com/ion/tokens
MapTiler Optional maptiler.com/cloud

Google Maps API Setup

To use Google Photorealistic 3D Tiles, enable these APIs in Google Cloud Console:

  • Map Tiles API
  • Maps JavaScript API

๐Ÿ—๏ธ Project Structure

map-bench/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ App.jsx                 # Main application component
โ”‚   โ”œโ”€โ”€ main.jsx                # React entry point
โ”‚   โ”œโ”€โ”€ index.css               # Global styles
โ”‚   โ”œโ”€โ”€ components/
โ”‚   โ”‚   โ”œโ”€โ”€ LayersPanel.jsx     # Data layers control panel
โ”‚   โ”‚   โ”œโ”€โ”€ LocationSelector.jsx # Location selection sidebar
โ”‚   โ”‚   โ”œโ”€โ”€ MapToggle.jsx       # Map library switcher
โ”‚   โ”‚   โ”œโ”€โ”€ StatusBar.jsx       # Status bar (tile count, etc.)
โ”‚   โ”‚   โ””โ”€โ”€ ViewModeToggle.jsx  # 2D/3D toggle
โ”‚   โ”œโ”€โ”€ dynamic-layers/         
โ”‚   |   โ””โ”€โ”€ flightTracker.js    # Flight tracking dynamic layer
โ”‚   โ”œโ”€โ”€ lib/mapcore
|   |   โ”œโ”€โ”€ mc-api.tsx          # MapCore's base component plugin for JavaScript/TypeScript
|   |   โ”œโ”€โ”€ mc-callbacks.ts     # MapCore's base asynchronous plugin
|   |   โ”œโ”€โ”€ MyEditModeCallback.ts # MapCore's Object world editor logic
|   |   โ””โ”€โ”€ utils.ts            # MapCore's additional utility functions
โ”‚   โ”œโ”€โ”€ maps/
โ”‚   โ”‚   โ”œโ”€โ”€ MapBox.jsx          # Mapbox GL JS implementation
โ”‚   โ”‚   โ”œโ”€โ”€ MapLibre.jsx        # MapLibre GL implementation
โ”‚   โ”‚   โ”œโ”€โ”€ MapESRI.jsx         # ArcGIS/ESRI implementation
โ”‚   โ”‚   โ”œโ”€โ”€ MapLeaflet.jsx      # Leaflet implementation
โ”‚   โ”‚   โ”œโ”€โ”€ MapCore.jsx         # MapCore implementation
โ”‚   โ”‚   โ””โ”€โ”€ MapCesium.jsx       # CesiumJS implementation
|   โ”œโ”€โ”€ types/
|   |   โ””โ”€โ”€ MapCore.d.ts        # MapCore's API typescript interfaces
โ”‚   โ””โ”€โ”€ utils/
โ”‚       โ”œโ”€โ”€ esriStyleConverter.js # Utilities for ESRI styles
โ”‚       โ””โ”€โ”€ mapStyleConfig.js   # Map style configurations
โ”œโ”€โ”€ public/
โ”‚   โ”œโ”€โ”€ data/                   # GeoJSON data files
โ”‚   โ”œโ”€โ”€ package/                
โ”‚   |   โ”œโ”€โ”€ MapCore.js          # MapCore API JavaScrip library
|   |   โ”œโ”€โ”€ MapCore.wasm        # MapCore API Web Assembly
|   |   โ”œโ”€โ”€ MapCore.js.symbols  # MapCore API Symbols
|   |   โ”œโ”€โ”€ MapCore.wasm.map    # MapCore API Symbol Mapper
|   |   โ””โ”€โ”€ MapCoreSymbology*.zip # Uses for NATO 2525 and US DOD App6D Symbyology standards
โ”‚   โ”œโ”€โ”€ sprites/                # Map sprites
โ”‚   โ”œโ”€โ”€ map-style.json          # Custom map style definition
โ”‚   โ””โ”€โ”€ favicon.svg
โ”œโ”€โ”€ scripts/
โ”‚   โ”œโ”€โ”€ fetch-power-lines.js    # Script to fetch power lines data
โ”‚   โ””โ”€โ”€ fetch-religious-buildings.js # Script to fetch religious buildings data
โ”œโ”€โ”€ index.html
โ”œโ”€โ”€ package.json
โ”œโ”€โ”€ vite.config.js
โ”œโ”€โ”€ .env.example                # Environment variables template
โ””โ”€โ”€ .gitignore

๐Ÿ› ๏ธ Tech Stack

Core

  • React 18 - UI framework
  • Vite 6 - Build tool and dev server

Mapping Libraries

  • Mapbox GL JS 3.8 - WebGL maps
  • MapLibre GL 4.7 - Open-source WebGL maps
  • ArcGIS JS SDK 4.34 - ESRI mapping platform
  • CesiumJS 1.129 - 3D globe visualization
  • MapCore 4.12.0-MapBench-beta2 - MapCore API version

3D Tiles

  • deck.gl 9.1 - Large-scale data visualization
  • loaders.gl 4.3 - 3D Tiles and glTF loading

๐Ÿ“ Scripts

npm run dev      # Start development server
npm run build    # Build for production
npm run preview  # Preview production build

๐ŸŽฎ Usage

  1. Select a map library using the toggle bar at the top center
  2. Choose 2D or 3D mode with the button in the top-left corner
  3. Pick a location from the sidebar on the right
  4. Navigate the map using mouse/touch controls:
    • Left-click + drag: Pan/Rotate
    • Right-click + drag: Tilt (pitch)
    • Scroll wheel: Zoom
    • Shift - Accelerate x10 (In MapCore)

๐Ÿ”ง Camera Synchronization

When switching between map libraries, the camera position is preserved:

  • Center coordinates (longitude, latitude)
  • Zoom level
  • Pitch (tilt angle)
  • Bearing (rotation)

This allows for direct visual comparison between renderers.

๐Ÿ“„ License

MIT License - feel free to use this project for learning and benchmarking purposes.

๐Ÿค Contributing

Contributions are welcome! Feel free to:

  • Report bugs
  • Suggest new features
  • Add new locations
  • Improve performance

๐Ÿ“ง Contact

Created by @moshew


Note: This project is for benchmarking and educational purposes. Make sure to comply with the terms of service of each mapping provider.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • JavaScript 57.6%
  • TypeScript 41.1%
  • Batchfile 0.4%
  • Dockerfile 0.4%
  • Shell 0.2%
  • CSS 0.2%
  • HTML 0.1%