Skip to content

An example of using OpenStreetMap and Haxe to generate a simple html based map of the world for local projects

License

Notifications You must be signed in to change notification settings

guerillamos/osm-haxe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Haxe + OpenStreetMap Example

This project demonstrates how to use Haxe to create an interactive map using the OpenStreetMap and Leaflet library.

Project Structure

  • src/ - Haxe source code folder
    • Main.hx - Main Haxe file
    • Leaflet.hx - Leaflet extern definitions
  • index.html - HTML file to display the interactive map
  • build.hxml - Haxe build configuration file

Setup

  1. Install Haxe (https://haxe.org/download/)
  2. Pull this repo down and cd into the folder
  3. Run haxe build.hxml in the terminal/command prompt to compile the project
  4. Open index.html in a web browser to view the interactive map

How It Works

This example uses Haxe to create a simple web application that displays an interactive OpenStreetMap using the Leaflet library. The Leaflet.hx file contains extern definitions for Leaflet's API, allowing you to use the library in Haxe code. The Main.hx file initializes the map and adds a tile layer to display the map data.

When you compile the project with haxe build.hxml, it generates a JavaScript file (main.js) that can be included in the index.html file. The index.html file loads the Leaflet library and its stylesheet from a CDN, sets up the container for the map, and includes the generated main.js file to display the interactive map in the browser.

About

An example of using OpenStreetMap and Haxe to generate a simple html based map of the world for local projects

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published