Questions tagged [openlayers]

OpenLayers is an open source Javascript web mapping library for creating web map applications.

OpenLayers is a JavaScript library which implements an API for developing dynamic map widgets on the web. The library provides tools for presenting and editing geographic information using pure JavaScript with no server-side dependencies.

OpenLayers supports several different access methods for geographic data, including the OpenGIS Web Mapping Service (WMS) and Web Feature Service (WFS) protocols from the Open Geospatial Consortium. Other supported geographic data sources include OpenStreetMap, Bing Maps, and ArcGIS Server. See the OpenLayers live examples page or the documentation for more comprehensive details.

OpenLayers is a project of the Open Source Geospatial Foundation (OSGeo) and is released under a BSD-style license (also known as the BSD-2-clause).

Books

OpenLayers Cookbook

Tag Usage

When asking a question with the tag, please mention the OpenLayers version you are using - especially for coding related questions.

4405 questions
13
votes
2 answers

Adding custom markers dynamically to map using OpenLayers

I would like to let users add custom markers on a map with a description for each marker. Any tips, links to any tutorials would be really useful.
Shreyas
  • 8,447
  • 7
  • 40
  • 55
13
votes
4 answers

Display Map like OpenStreetMap

I like the way OpenStreetMap display its map. It almost looks like Google Map. I have already installed GeoServer and PostGis on my notebook. I also got this cloudmade osm file for my country, Indonesia. I downloaded indonesia.osm.bz2. I…
deerawan
  • 6,027
  • 4
  • 25
  • 40
13
votes
2 answers

node.js and geoserver CORS

I have node.js server 0.10.12 and express.js 4.8.5. Node.js is the web server, includes openlayers 3.9.0. Geoserver 2.1.3 serves the WMS layer. Later, I will implement vector layers. There is only one route (for the index page) var routes =…
slevin
  • 3,640
  • 16
  • 58
  • 106
13
votes
3 answers

OpenLayers display all markers on screen

How do I get all the markers on the map so the users can see all of them? I have got some amount of markers. I am displaying them on the map. The center LonLat I get from taking the average of the highest and the lowest numbers of the lon and lat of…
Klaasvaak
  • 5,430
  • 12
  • 43
  • 67
12
votes
2 answers

How to get the current viewport of the map out of OpenLayers as geometry, bounding box or wkt?

I'm trying to find some hints where I should search for this topic but I've nothing found - and I spent many hours on this. I'm also trying to get the current coordinates out of the current displayed viewport from the OpenLayers map to add only…
Patrick Hillert
  • 1,849
  • 3
  • 20
  • 34
12
votes
5 answers

How to display data using openlayers with OpenStreetMap in geodjango?

I've got geodjango running using openlayers and OpenStreetMaps with the admin app. Now I want to write some views to display the data. Basically, I just want to add a list of points (seen in the admin) to the map. Geodjango appears to use a special…
monkut
  • 36,357
  • 21
  • 109
  • 140
12
votes
2 answers

Forcing an OpenLayers Markers layer to draw on top, and having selectable layers beneath

I have an OpenLayers map with a raster base layer, a vector layer and a markers layer in that order. They display fine, in the correct order with the markers on top of the vectors, great. But when I add a SelectFeature Control and point it to the…
Niklas Wulff
  • 3,405
  • 2
  • 21
  • 43
12
votes
3 answers

How can I remove standard controls in an OpenLayers-Map?

I use OpenLayers and want to create another navigation-control in the upper-left side. I know how to add Controls, but this navigation is added at default while creating the OpenLayers-Map. So I want to remove that Control, to add an own. I know…
Mnementh
  • 47,129
  • 42
  • 140
  • 198
12
votes
2 answers

Is there a way to disable rotation in OpenLayers 3?

I am currently upgrading my OpenLayers 2 Mapview to OpenLayers 3. I really like the new OpenLayers client, but i wanted to deactivate the ability to rotate the map on mobile devices (rotating with 2 fingers). But I can't find any settings for this.…
Franziskus Karsunke
  • 4,470
  • 1
  • 36
  • 52
12
votes
6 answers

Google's crawler won't understand own maps. How to workaround?

I found strange words, (have, here, imagery, sorry) that were supposed not to be on my site, being taken as keywords by the crawler from Google It seems like Google is having errors when crawling pages that use Google maps, so it is taking the…
jperelli
  • 6,382
  • 4
  • 43
  • 82
12
votes
1 answer

How would I get OpenLayers feature selection and Javascript drag and drop working together?

I am writing an application that uses OpenLayers to enable users to drag and drop files on to a pre-defined set of features that get sent to a server with AJAX. The files themselves are raw data from geophysics equipment that will be rendered as a…
MerseyViking
  • 325
  • 3
  • 17
11
votes
2 answers

OpenLayers: get Map, View, TileLayer and OSM from server

I am new using OpenLayers (an open-source JavaScript library for displaying map data in web browsers as slippy maps). I am using it with Thymeleaf (a Java XML/XHTML/HTML5 template engine that can work both in web and non-web environments). I am…
Nunyet de Can Calçada
  • 3,615
  • 32
  • 127
  • 219
11
votes
1 answer

Openlayers: Vector Features instead of Markers

I want to place a symbol o a Map. E.g. So far I have used OpenLayers with OpenLayers.Layer.Markers. The code looks like this: map = new OpenLayers.Map('map'); layer = new OpenLayers.Layer.OSM( "Simple OSM Map"); map.addLayer(layer); …
max
  • 26,552
  • 10
  • 48
  • 72
11
votes
2 answers

Upgrade to Google Maps version 3, or go to OpenLayers?

I manage the development of some academic web mapping software for authoring collections of geographic data. It's a fairly simple interface for creating historic maps. The project is based on Google Maps v.2, and because v.2 is going to be…
Dave Shepard
  • 487
  • 2
  • 11
11
votes
1 answer

openlayers vector feature get pixel position

What is the fastest way to get the pixel coordinates of a OpenLayers.Feature.Vector? I mean, I want to get the pixel (top,left) position relative to map container of a already drawn feature, if possible without calculations because performance…
Rafael
  • 153
  • 1
  • 1
  • 11