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.

5064 questions
14
votes
2 answers

Firefox window.controllers is deprecated. Do not use it for UA detection

My website works in Chrome, IE, and Safari, but when I load it in Firefox, Firefox complains saying "window.controllers is deprecated. Do not use it for UA detection." This code is in the OpenLayers API (OpenLayers 2, latest version), so I can't…
user3148225
  • 426
  • 1
  • 6
  • 17
14
votes
1 answer

TypeError: float() argument must be a string or a number in Django distance

I tried to get the value from my template which is kmdistance but it returns an error when I view the page. Here's the views.py def display_maps(request): #bases for city proper pnt =…
Sachi Tekina
  • 1,800
  • 5
  • 28
  • 50
14
votes
2 answers

Multiple Leaflet maps on same page with same options

I'm pretty new to leaflet.js and I'm trying to figure out how to assign the same map with the same set of options and layers to a different HTML container instead of having to remove and add a new one every time? I used to deal with Open layers 2.13…
Dmitry
  • 161
  • 1
  • 1
  • 5
14
votes
4 answers

How do Bounds work in OpenLayers 3?

Does the concept of OpenLayers.Bounds from OpenLayers 2.x still exist in OpenLayers 3? How has it changed, and what is its new name?
colllin
  • 9,442
  • 9
  • 49
  • 65
14
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,634
  • 15
  • 45
  • 68
13
votes
1 answer

How to select a feature programmatically on a vector layer in OpenLayers?

I'm currently searching for a solution to select (or highlight) a vector in a OpenLayers.Layer.Vector. I've build a simple gridtable where a user can pick a vector (given as WKT formatted string) which should highlight the corresponding vector on…
Patrick Hillert
  • 2,309
  • 4
  • 22
  • 37
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,737
  • 7
  • 44
  • 56
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
  • 8,002
  • 5
  • 42
  • 51
13
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
  • 307
  • 1
  • 3
  • 16
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
  • 42,176
  • 24
  • 124
  • 155
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,497
  • 2
  • 22
  • 43
12
votes
4 answers

How can i convert my CAD(DWG) file to GeoJSON?

I'm working on openlayers and need to change the format of dwg to GeoJSON with ArcGIS. how can i do this?
Mahdi Nazari Ashani
  • 372
  • 1
  • 5
  • 22
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,948
  • 3
  • 40
  • 54
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,988
  • 5
  • 50
  • 85
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
  • 389
  • 3
  • 19