• Stars
    star
    423
  • Rank 102,544 (Top 3 %)
  • Language
    JavaScript
  • License
    BSD 2-Clause "Sim...
  • Created over 8 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A JavaScript API for beautiful 3D maps

wrld.js

WRLD

The WRLD JavaScript API allows you to easily embed beautiful 3D maps into any web page for any modern, WebGL supporting browser. For an example of our 3D maps in action, see these examples.

It is based on Leaflet.js, providing a familiar API for embedding 3D maps in a web page.

Examples

You can find feature-by-feature examples on our website.

API

A full API reference is also available on our website.

Getting Started

Before you begin, you will need to acquire an API key, which you can do by signing up for an account at wrld3d.com and selecting the Digital Twin plan - free trials are available!

You can easily embed a 3D map in any web page. The code below shows a simple example:

<!-- Create a map in an HTML element with wrld.js -->
<!DOCTYPE HTML>
<html>
  <head>
    <script src="https://unpkg.com/[email protected]"></script>
    <link href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.0.1/leaflet.css" rel="stylesheet" />
  </head>
  <body>
    <div id="map" style="width: 400px; height: 400px;"></div>
    <script type="text/javascript">
      const map = Wrld.map("map", "your_api_key_here");
    </script>
  </body>
</html>

Just replace your_api_key_here with an API key from wrld3d.com.

If you're using npm:

Install the wrld.js package:

npm install wrld.js 

And in your application:

import Wrld from "wrld.js";

const map = Wrld.map("map", "your_api_key_here");

Using React?

We have a component that wraps wrld.js: https://github.com/wrld3d/wrld-react.

Interested in the newest changes?

Bleeding edge build are available with the bleeding-edge tag. You can get them from unpkg with

<script src="http://unpkg.com/wrld.js@bleeding-edge"></script>

or from npm with

npm install wrld.js@bleeding-edge

Migration from 0.1.x to 1.0.x

Starting from version 1.0.0, the Wrld object now extends L from Leaflet, instead of acting like a plugin – this simplifies using wrld.js with TypeScript and improves interoperability with other Leaflet maps on the same page.

  • Replace L.Wrld.polygon with Wrld.native.polygon
  • Replace L.Wrld.polyline with Wrld.native.polyline
  • Replace all other L.Wrld.* calls to Wrld.*
  • Replace all L.* calls with Wrld.*

Support

If you have any questions, bug reports, or feature requests, feel free to submit to the issue tracker for wrld.js on GitHub.

Building the API

You may wish to build the API yourself. This is easy to do and only requires that you install node.js.

Requirements

  • Node.js (v12 or newer)
  • npm (installed with Node.js)

Building

Follow the steps below to build the API:

  1. Clone this repo: git clone https://github.com/wrld3d/wrld.js.git
  2. In the root of the repo, run npm install to install the development dependencies.
  3. Still in the root of the repo, run the command npm run build.

This will create the file cdn/wrld.js which is the bundled UMD package, and various outputs in the dist/ folder`.

You can also use the command npm run watch to build continuously, watching files for changes.

Testing

Before executing automated tests, make sure you have eeGeoWebGL.js downloaded in /tmp/sdk. This can be achieved by running ./download-sdk.sh.

  • npm run test will execute automated tests and lint the project.
  • npm run test:unit will only execute automated tests.
  • npm run test:watch will watch the source files and execute affected tests.

Contributing

If you wish to contribute to this repo, pull requests on GitHub are welcomed.

License

The WRLD 3D Maps JavaScript API is released under the Simplified BSD License. See LICENSE.md for details.

More Repositories

1

wrld-example-app

WRLD 3D Maps example app
C++
115
star
2

wrld-indoor-maps-api

Contains details of our indoor map format & API + a tutorial to help you get started.
91
star
3

wrld-sdk-samples

C++
30
star
4

unity-api

Issue tracking for the WRLD Unity SDK
28
star
5

wrld-unity-xr-samples

Samples demonstrating how to use the WRLD SDK to build basic XR experiences in Unity
C#
22
star
6

wrld-themes

Customises the look and feel of the environment (textures, lighting etc.) for WRLD SDK
Python
19
star
7

ios-api

iOS API for WRLD: Stunning, Interactive 3D Maps
Objective-C++
19
star
8

ios-api-example

Sample code to display interactive 3D maps with the WRLD iOS SDK
Objective-C
14
star
9

cardboard-vr-demo

Example demonstrating integration between the Google Cardboard VR SDK and the WRLD Maps SDK.
C++
13
star
10

android-api-samples

Example apps demonstrating the WRLD Android Java API to display stunning interactive 3D maps. https://www.wrld3d.com/developers/
Java
13
star
11

android-api

Java API to display high performance 3D maps on Android. https://www.wrld3d.com/developers/
Java
12
star
12

wrld-oculus-demo

Alpha Oculus VR support for WRLD SDK - Mapping for VR
C++
7
star
13

wrld-poi-api

WRLD POI API for managing POIs within wrld-example-app
7
star
14

wrld-routing-api

Get directions from WRLD's routing service
4
star
15

wrld-react

A React Component for wrld.js
TypeScript
3
star
16

wrld-mapscene-api

WRLD Map Scene API for managing Map Scene short links
2
star
17

wrld-icon-tools

Tools for creating icons for use with the WRLD Maps SDK.
Python
2
star
18

wrld.js-react-native-example

An example of how wrld.js could be used in a React Native app. React Native is not officially supported by wrld.js
JavaScript
2
star
19

wrld.js-react-example

An example of how wrld.js can be used in a React app.
HTML
1
star