Library / SDK
mapsforge/mapsforge avatar
mapsforge/mapsforge

Mapsforge for offline vector maps on Android and Java desktop

Vector map library and writer - running on Android and Desktop.

1,416 stars403 forksJavaLGPL-3.0

At a glance

What is it?
Mapsforge is a Java library for rendering compact, offline OpenStreetMap data on Android and desktop. It suits developers who need local map files, XML render themes, POI search, or their own map compilation pipeline.
Who is it for?
Mapsforge is appropriate for Java developers building an offline Android or desktop map application, especially when map files must remain under their control. It is a poor fit for a hosted-map solution or teams that need a documented installer and a ready-made application interface.
Can I use it commercially?
Yes, with conditions. LGPL-3.0 is a weak copyleft licence: you can use it inside commercial and closed-source software, but if you distribute changes to its own files, you must publish those changes under the same licence.
Is it still maintained?
Yes. The repository last received commits 4 days ago.
What is it written in?
Mainly Java, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 22, 2026, and from our analysis. They are not legal advice.

Editorial analysis

Mapsforge's offline rendering scope

Mapsforge addresses a specific deployment problem: displaying OpenStreetMap-based vector maps when an application cannot depend on a remote map service for every view. It is aimed at developers creating Android applications in Java or standalone desktop applications. The project is a library and writer, not a complete consumer mapping application. That distinction matters because an adopter must still build the application layer around its rendering, interaction, and map-loading components.

The README states that Mapsforge supports Android 2.3.3, API level 10, and later. It also has desktop modules, including `mapsforge-map-awt`, plus Android and AWT sample directories. This makes it relevant to teams that want related offline map behavior across both platforms, provided they can work within a Java codebase.

The intended workload is local map inspection and navigation built around packaged map files. Mapsforge also supplies POI components and a writer, so the scope extends beyond drawing roads and boundaries. However, the README does not present routing, turn-by-turn guidance, traffic data, or online synchronization as built-in features. Those requirements should not be inferred from the project's map-rendering description.

Compact map files and the Mapsforge module flow

The central data format is Mapsforge's compact binary map file, documented in `docs/Specification-Binary-Map-File.md`. The README says this format is intended for "fast ad-hoc rendering of OpenStreetMap data." The repository layout indicates a pipeline divided into reading, writing, rendering, themes, and POI modules.

For an existing offline dataset, the map-reading side handles the binary map material, while the map modules expose it to Android or AWT applications. The platform-specific modules are `mapsforge-map-android` and `mapsforge-map-awt`. Presentation is separated into `mapsforge-themes`, and XML render-theme documentation lives in `docs/Rendertheme.md`. This separation lets an application choose platform integration and visual styling without suggesting that every renderer has identical dependencies.

For map production, `mapsforge-map-writer` is the relevant module. POI handling has parallel pieces in `mapsforge-poi`, `mapsforge-poi-android`, `mapsforge-poi-awt`, and `mapsforge-poi-writer`. This structure indicates separate concerns for reading, writing, rendering, and searching points of interest. The README does not document internal cache behavior, tile scheduling, or coordinate projection APIs, so those implementation details cannot be treated as guaranteed interface contracts.

Installing Mapsforge and preparing the first map

The repository does not provide a short installation command in the README, so there is no justified `gradle`, Maven, or JitPack invocation to reproduce here. The README points developers to `docs/Integration.md` for Android integration and `docs/Desktop.md` for standalone Java applications. Those documents are the correct places to verify module coordinates, build setup, and application wiring for a specific release.

The one explicit build prerequisite in the README is the Android SDK installation directory through `ANDROID_HOME`. Set that environment variable before building the Android side of the project. The repository includes `gradlew` and `gradlew.bat`, but the README does not state the exact task required to produce a distributable library or sample application. It would be unsafe to invent such a task.

A first real use can be planned without application code. Choose one map source, select one XML render theme, and confirm that both belong in the application package. The README offers precompiled maps at `https://download.mapsforge.org/`. If the bundled file or theme is unsuitable, follow `docs/Getting-Started-Map-Writer.md` and `docs/MapCreation.md` to compile an own map. Only after those inputs are identified should an integrator copy the Android or desktop setup from the corresponding guide. This ordering keeps application coding separate from the larger map-production task.

Android and desktop integration choices

The README offers different starting points for the two platform targets. Android developers are directed to `mapsforge-samples-android`, which contains boilerplate for applications that display OpenStreetMap-based maps and includes examples associated with rotation and hillshading. The sample directory is therefore the clearest repository entry point for understanding Android integration.

Desktop developers are directed to `docs/Desktop.md` and can use the `mapsforge-samples-awt` directory as the sample entry visible in the repository layout. AWT is the repository's documented desktop route. The README does not say whether the desktop samples expose exactly the same controls or visual behavior as Android, so feature parity should not be assumed.

Rotation and offline hill shading are documented capabilities, but they do not imply that every application receives them by default. Render-theme behavior must be checked in `docs/Rendertheme.md`, while the Android sample gives the concrete reference for the featured map viewer. There is also no documented command for packaging a finished desktop executable in the README. An adopter should treat Mapsforge as source-level integration unless the referenced desktop guide supplies otherwise.

Map creation versus downloadable map files

Mapsforge documents two distinct ways to obtain compatible offline data. The first is to download a precompiled map from `https://download.mapsforge.org/`. This avoids implementing a local map compilation workflow in the adopting application, although the README does not state the update interval, coverage guarantees, or licensing terms for each downloadable map. Those details must be checked against the relevant map source.

The second path is to compile an own map with the Mapsforge writer. The README points to `docs/Getting-Started-Map-Writer.md` for introductory instructions and `docs/MapCreation.md` for detailed instructions. This path gives the adopter control over the input data and map-production process, but it adds storage, toolchain, and map-update responsibilities. The repository does not quantify the time, memory, or disk requirements of a map job, so capacity planning cannot be based on a generic estimate.

Compared with a deployment that only consumes an existing packaged map, map creation requires maintaining the writer and its inputs. Compared with a service-backed map application, both Mapsforge paths require packaging map data with the application or distributing it separately. The decisive choice is therefore whether offline map distribution and local rendering matter enough to accept those responsibilities.

POI search and XML render-theme responsibilities

POI search is a separate Mapsforge capability rather than an incidental annotation feature. The README identifies a tools and library entry in `docs/POI.md` and also points to precompiled POI data at the same download host. The repository contains reader, writer, Android, and AWT-related POI modules, which supports separate preparation and platform integration.

A product team should treat the map file, POI file, and render theme as compatible deployment inputs. The README does not say that any precompiled POI file automatically matches every precompiled map, nor does it specify a synchronization protocol. If both datasets must describe the same places, the project documentation does not establish how they are paired. That check belongs before designing search behavior around POI results.

Map appearance is controlled through XML style files described in `docs/Rendertheme.md`. This is more explicit than hard-coding every visual rule in application code, and it separates map data from theme configuration. It also creates a configuration dependency: an application needs a valid theme that matches the map content. The repository does not define a theme validator command or fallback behavior for missing styles, so those points remain undocumented.

License, maintenance, and adoption constraints

Mapsforge is released under LGPL-3.0. The README describes an important simplification: the constraints in LGPL v3 sections 4(d) and 4(e) are waived. It states that an application may be conveyed as a Combined Work without providing a way to recombine or relink it and without a shared-library mechanism. The README also says an Android application can include Mapsforge without being made open source. This is a repository-specific summary of the license terms, not legal advice, so downstream distribution should still be reviewed against `COPYING` and `COPYING.LESSER`.

Maintenance has a concrete recent signal. The repository is not archived, its last push was on 2026-10-13, and releases `0.29.0` and `0.30.0` were published in July and August 2026. That supports considering current development rather than treating the project as abandoned. The repository does not publish a support policy, migration guide for each release, or compatibility matrix for historical Mapsforge map files.

Upgrade cost comes from coordinating library code, binary maps, POI data, render themes, and platform integrations. A library upgrade alone does not establish that existing map files remain compatible. Because the README does not document rollback or file compatibility by release, adopters should first compare the release-specific integration guidance and map-writing instructions before replacing a working dependency set.

Editorial conclusion

Mapsforge is appropriate for Java developers building an offline Android or desktop map application, especially when map files must remain under their control. It is a poor fit for a hosted-map solution or teams that need a documented installer and a ready-made application interface. Before adoption, inspect `docs/Desktop.md` and `docs/Integration.md`, obtain a compatible map or follow `docs/MapCreation.md`, then confirm that the selected XML render theme and POI data match the intended offline experience. The last repository push was on 2026-10-13, and release `0.30.0` was published on 2026-08-20.

Frequently asked questions

Does Mapsforge work on both Android and desktop?

Yes. The repository provides Android, AWT desktop, and sample modules for both platforms.

Does Mapsforge require an internet connection to display maps?

The project is designed for rendering locally stored OpenStreetMap data through its compact binary map format. The README does not document an online fallback or synchronization feature.

Can I use Mapsforge without compiling my own map?

Yes. The README links to precompiled maps and precompiled POI downloads, while separate documentation covers compiling maps and POI data with Mapsforge tools.

Does Mapsforge support hill shading and map rotation?

The README identifies rotation and offline high-resolution hill shading as supported sample capabilities.

Official sources

  1. Issues
  2. License: LGPL-3.0
  3. mapsforge/mapsforge on GitHub
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/mapsforge-mapsforge.svg)](https://hysenlabs.com/projects/mapsforge-mapsforge)