Skip to content
JavaScript Other
Branch: master
Clone or download
ahocevar Merge pull request #10380 from mike-000/patch-5
Adjust examples for layer canvas pixel ratio and rotation
Latest commit 5f6ea98 Dec 7, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci Revert "Try downgrading Node for JSDoc" May 6, 2019
.dependabot Add config file for dependabot Oct 28, 2019
.github Keep issues assigned to a milestone from going stale Oct 26, 2019
changelog Changelog for v6.1.1 Nov 4, 2019
config Merge pull request #10204 from tschaub/doc-layout Oct 27, 2019
doc Bring back vector render mode for vector tile layers Nov 18, 2019
examples Adjust for layer canvas rotation Dec 4, 2019
rendering Bring back vector render mode for vector tile layers Nov 18, 2019
src/ol Merge pull request #10384 from mike-000/patch-4 Dec 6, 2019
tasks Update changelog script to recognize dependabot instead of greenkeeper Oct 28, 2019
test Merge pull request #10309 from ahocevar/vectortile-rendermode-vector Nov 29, 2019
types Remove 'moz' prefix for the Full Screen API Feb 15, 2019
.editorconfig Remove Makefile entry in editorconfig Nov 19, 2018
.eslintignore Clean lint from jsdoc config Apr 19, 2018
.gitignore Scripts for generating the package and legacy build Jul 17, 2018
CONTRIBUTING.md Change travis references to circleci in doc Nov 19, 2018
DEVELOPING.md Change travis references to circleci in doc Nov 19, 2018
LICENSE.md Add title to license to clarify that it is BSD 2-Clause Mar 12, 2019
README.md Add title to license to clarify that it is BSD 2-Clause Mar 12, 2019
package-lock.json Merge pull request #10365 from openlayers/dependabot/npm_and_yarn/bab… Dec 2, 2019
package.json Bump coveralls from 3.0.7 to 3.0.9 Dec 2, 2019
tsconfig.json reduced typecasts in layerrenderer Sep 25, 2019

README.md

OpenLayers

OpenLayers is a high-performance, feature-packed library for creating interactive maps on the web. It can display map tiles, vector data and markers loaded from any source on any web page. OpenLayers has been developed to further the use of geographic information of all kinds. It is completely free, Open Source JavaScript, released under the BSD 2-Clause License.

Getting Started

Install the ol package:

npm install ol

Import just what you need for your application:

import Map from 'ol/Map';
import View from 'ol/View';
import TileLayer from 'ol/layer/Tile';
import XYZ from 'ol/source/XYZ';

new Map({
  target: 'map',
  layers: [
    new TileLayer({
      source: new XYZ({
        url: 'https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png'
      })
    })
  ],
  view: new View({
    center: [0, 0],
    zoom: 2
  })
});

See the following examples for more detail on bundling OpenLayers with your application:

IntelliSense support and type checking for VS Code

The ol package contains a src/ folder with JSDoc annotated sources. TypeScript can get type definitions from these sources with a jsconfig.json config file in the project root:

{
  "compilerOptions": {
    "checkJs": true,
    // Point to the JSDoc typed sources when using modules from the ol package
    "baseUrl": "./",
    "paths": {
      "ol": ["node_modules/ol/src"],
      "ol/*": ["node_modules/ol/src/*"]
    }
  },
  "include": [
    "**/*.js",
    "node_modules/ol/**/*.js"
  ]
}

Project template with this configuration: https://gist.github.com/9a7253cb4712e8bf38d75d8ac898e36c.

Note that the above only works when authoring in plain JavaScript. For similar configurations with a tsconfig.json in TypeScript projects, your mileage may vary.

Supported Browsers

OpenLayers runs on all modern browsers that support HTML5 and ECMAScript 5. This includes Chrome, Firefox, Safari and Edge. For older browsers and platforms like Internet Explorer (down to version 9) and Android 4.x, polyfills for requestAnimationFrame and Element.prototype.classList are required, and using the KML format requires a polyfill for URL.

Documentation

Check out the hosted examples, the workshop or the API documentation.

Bugs

Please use the GitHub issue tracker for all bugs and feature requests. Before creating a new issue, do a quick search to see if the problem has been reported already.

Contributing

Please see our guide on contributing if you're interested in getting involved.

Community

CircleCI

You can’t perform that action at this time.