JSPM

ol

6.1.1-dev.1578904305867
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 174579
  • Score
    100M100P100Q160934F
  • License BSD-2-Clause

OpenLayers mapping library

Package Exports

  • ol
  • ol/AssertionError
  • ol/Collection
  • ol/CollectionEventType
  • ol/CollectionEventType.js
  • ol/Disposable
  • ol/Feature
  • ol/Feature.js
  • ol/Geolocation
  • ol/Image
  • ol/ImageState.js
  • ol/ImageTile
  • ol/Kinetic
  • ol/Map
  • ol/Map.js
  • ol/MapBrowserEvent
  • ol/MapBrowserEventType
  • ol/MapBrowserEventType.js
  • ol/MapBrowserPointerEvent
  • ol/MapEvent
  • ol/MapEvent.js
  • ol/MapEventType
  • ol/Object
  • ol/Object.js
  • ol/ObjectEventType
  • ol/Observable
  • ol/Observable.js
  • ol/Overlay
  • ol/Overlay.js
  • ol/OverlayPositioning
  • ol/OverlayPositioning.js
  • ol/PluggableMap
  • ol/PluggableMap.js
  • ol/Tile
  • ol/TileState
  • ol/TileState.js
  • ol/View
  • ol/View.js
  • ol/ViewHint
  • ol/array
  • ol/array.js
  • ol/asserts
  • ol/asserts.js
  • ol/centerconstraint
  • ol/color
  • ol/color.js
  • ol/colorlike
  • ol/control
  • ol/control.js
  • ol/control/Attribution
  • ol/control/Control
  • ol/control/FullScreen
  • ol/control/MousePosition
  • ol/control/MousePosition.js
  • ol/control/OverviewMap
  • ol/control/OverviewMap.js
  • ol/control/Rotate
  • ol/control/ScaleLine
  • ol/control/Zoom
  • ol/control/ZoomSlider
  • ol/control/ZoomSlider.js
  • ol/control/ZoomToExtent
  • ol/coordinate
  • ol/coordinate.js
  • ol/css
  • ol/dom
  • ol/dom.js
  • ol/easing
  • ol/easing.js
  • ol/events
  • ol/events.js
  • ol/events/Event
  • ol/events/Event.js
  • ol/events/EventType
  • ol/events/EventType.js
  • ol/events/Target
  • ol/events/condition
  • ol/events/condition.js
  • ol/extent
  • ol/extent.js
  • ol/featureloader
  • ol/format
  • ol/format.js
  • ol/format/EsriJSON
  • ol/format/EsriJSON.js
  • ol/format/Feature
  • ol/format/FormatType
  • ol/format/GML
  • ol/format/GML2
  • ol/format/GML3
  • ol/format/GML32
  • ol/format/GPX
  • ol/format/GeoJSON
  • ol/format/GeoJSON.js
  • ol/format/IGC
  • ol/format/JSONFeature
  • ol/format/KML
  • ol/format/MVT
  • ol/format/MVT.js
  • ol/format/OSMXML
  • ol/format/Polyline
  • ol/format/Polyline.js
  • ol/format/TopoJSON
  • ol/format/WFS
  • ol/format/WKT
  • ol/format/WKT.js
  • ol/format/WMSCapabilities
  • ol/format/WMSGetFeatureInfo
  • ol/format/WMTSCapabilities
  • ol/format/WMTSCapabilities.js
  • ol/format/filter
  • ol/format/filter.js
  • ol/format/filter/Bbox
  • ol/format/filter/Contains
  • ol/format/filter/During
  • ol/format/filter/EqualTo
  • ol/format/filter/GreaterThan
  • ol/format/filter/GreaterThanOrEqualTo
  • ol/format/filter/Intersects
  • ol/format/filter/IsBetween
  • ol/format/filter/IsLike
  • ol/format/filter/IsNull
  • ol/format/filter/LessThan
  • ol/format/filter/LessThanOrEqualTo
  • ol/format/filter/Not
  • ol/format/filter/NotEqualTo
  • ol/format/filter/Or
  • ol/format/filter/Within
  • ol/functions.js
  • ol/geom
  • ol/geom.js
  • ol/geom/Circle
  • ol/geom/Circle.js
  • ol/geom/Geometry
  • ol/geom/Geometry.js
  • ol/geom/GeometryCollection
  • ol/geom/GeometryLayout
  • ol/geom/GeometryType
  • ol/geom/GeometryType.js
  • ol/geom/LineString
  • ol/geom/LineString.js
  • ol/geom/LinearRing
  • ol/geom/MultiLineString
  • ol/geom/MultiLineString.js
  • ol/geom/MultiPoint
  • ol/geom/MultiPoint.js
  • ol/geom/MultiPolygon
  • ol/geom/MultiPolygon.js
  • ol/geom/Point
  • ol/geom/Point.js
  • ol/geom/Polygon
  • ol/geom/Polygon.js
  • ol/geom/SimpleGeometry
  • ol/geom/SimpleGeometry.js
  • ol/has
  • ol/index
  • ol/index.js
  • ol/interaction
  • ol/interaction.js
  • ol/interaction/DoubleClickZoom
  • ol/interaction/DragAndDrop
  • ol/interaction/DragBox
  • ol/interaction/DragPan
  • ol/interaction/DragPan.js
  • ol/interaction/DragRotate
  • ol/interaction/DragRotateAndZoom
  • ol/interaction/DragZoom
  • ol/interaction/Draw
  • ol/interaction/Draw.js
  • ol/interaction/Extent
  • ol/interaction/Interaction
  • ol/interaction/Interaction.js
  • ol/interaction/KeyboardPan
  • ol/interaction/KeyboardZoom
  • ol/interaction/Modify
  • ol/interaction/MouseWheelZoom
  • ol/interaction/PinchRotate
  • ol/interaction/PinchZoom
  • ol/interaction/Pointer
  • ol/interaction/Pointer.js
  • ol/interaction/Select
  • ol/interaction/Select.js
  • ol/interaction/Snap
  • ol/interaction/Translate
  • ol/layer
  • ol/layer.js
  • ol/layer/Base
  • ol/layer/BaseImage.js
  • ol/layer/BaseTile
  • ol/layer/BaseVector
  • ol/layer/Graticule
  • ol/layer/Group
  • ol/layer/Group.js
  • ol/layer/Heatmap
  • ol/layer/Image
  • ol/layer/Image.js
  • ol/layer/Layer
  • ol/layer/Layer.js
  • ol/layer/Property
  • ol/layer/Tile
  • ol/layer/Tile.js
  • ol/layer/Vector
  • ol/layer/Vector.js
  • ol/layer/VectorImage
  • ol/layer/VectorTile
  • ol/layer/VectorTile.js
  • ol/loadingstrategy
  • ol/loadingstrategy.js
  • ol/math
  • ol/math.js
  • ol/obj
  • ol/obj.js
  • ol/ol.css
  • ol/pointer/EventType
  • ol/proj
  • ol/proj.js
  • ol/proj/Projection
  • ol/proj/Units
  • ol/proj/Units.js
  • ol/proj/epsg3857.js
  • ol/proj/proj4
  • ol/proj/proj4.js
  • ol/proj/transforms
  • ol/render
  • ol/render.js
  • ol/render/Event
  • ol/render/Feature
  • ol/render/VectorContext
  • ol/render/canvas
  • ol/render/canvas/Immediate
  • ol/renderer/Composite
  • ol/renderer/Composite.js
  • ol/renderer/canvas/ImageLayer
  • ol/renderer/canvas/ImageLayer.js
  • ol/renderer/canvas/Layer
  • ol/renderer/canvas/Layer.js
  • ol/renderer/canvas/TileLayer
  • ol/renderer/canvas/TileLayer.js
  • ol/renderer/canvas/VectorLayer
  • ol/renderer/canvas/VectorTileLayer
  • ol/renderer/vector
  • ol/size
  • ol/size.js
  • ol/source
  • ol/source.js
  • ol/source/BingMaps
  • ol/source/BingMaps.js
  • ol/source/CartoDB
  • ol/source/Cluster
  • ol/source/Cluster.js
  • ol/source/Image
  • ol/source/Image.js
  • ol/source/ImageArcGISRest
  • ol/source/ImageCanvas
  • ol/source/ImageMapGuide
  • ol/source/ImageStatic
  • ol/source/ImageStatic.js
  • ol/source/ImageWMS
  • ol/source/ImageWMS.js
  • ol/source/OSM
  • ol/source/OSM.js
  • ol/source/Raster
  • ol/source/Source
  • ol/source/Stamen
  • ol/source/State
  • ol/source/Tile
  • ol/source/TileArcGISRest
  • ol/source/TileDebug
  • ol/source/TileImage
  • ol/source/TileImage.js
  • ol/source/TileJSON
  • ol/source/TileJSON.js
  • ol/source/TileWMS
  • ol/source/TileWMS.js
  • ol/source/UTFGrid
  • ol/source/UrlTile
  • ol/source/Vector
  • ol/source/Vector.js
  • ol/source/VectorEventType
  • ol/source/VectorTile
  • ol/source/VectorTile.js
  • ol/source/WMSServerType
  • ol/source/WMTS
  • ol/source/WMTS.js
  • ol/source/XYZ
  • ol/source/XYZ.js
  • ol/source/Zoomify
  • ol/sphere
  • ol/sphere.js
  • ol/src/ol.css
  • ol/style
  • ol/style.js
  • ol/style/Circle
  • ol/style/Circle.js
  • ol/style/Fill
  • ol/style/Fill.js
  • ol/style/Icon
  • ol/style/Icon.js
  • ol/style/IconAnchorUnits
  • ol/style/IconAnchorUnits.js
  • ol/style/IconImage
  • ol/style/IconImage.js
  • ol/style/IconImageCache
  • ol/style/IconOrigin
  • ol/style/IconOrigin.js
  • ol/style/Image
  • ol/style/Image.js
  • ol/style/RegularShape
  • ol/style/RegularShape.js
  • ol/style/Stroke
  • ol/style/Stroke.js
  • ol/style/Style
  • ol/style/Style.js
  • ol/style/Text
  • ol/style/Text.js
  • ol/style/TextPlacement
  • ol/tilegrid
  • ol/tilegrid.js
  • ol/tilegrid/TileGrid
  • ol/tilegrid/WMTS
  • ol/tilegrid/WMTS.js
  • ol/tileurlfunction
  • ol/transform
  • ol/transform.js
  • ol/uri
  • ol/util
  • ol/util.js
  • ol/xml

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ol) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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