OpenLayers is a JavaScript library for creating dynamic map widgets for web sites.

learn more… | top users | synonyms

0
votes
0answers
29 views

How to use openlayers 3 and Mapserver (WMS

I'm not able to centralize my map in OpenLayers / MapServer , it appears at the top . The " center " do not work . Below my code to better analyze . I did not post the mapfile why I did an experiment ...
1
vote
0answers
8 views

OL2: Zoom specific WMS [duplicate]

I'm desperately looking for a way to use multiple WMS on my application. If a user zooms in/out another baselayer is supposed to be selected. As for now, I've come across the following: ...
0
votes
0answers
11 views

Retrieve Extent of Map in specific projection [duplicate]

Geoserver WMS Layer and WFS Layers that I display with OpenLayers. MaxExtent of the map is hard-coded. map = new OpenLayers.Map({ div : "map", projection : 'EPSG:31466', units : "m", ...
0
votes
1answer
19 views

OpenLayers getCentroid problem

I have a polygon from a select feature event. I can see the polygon using firebug but I'm getting an error saying Type Error: getCentroid is not a function. Can anyone help please? var poly = ...
1
vote
1answer
25 views

How do I catch PostgreSQL/ PostGIS RAISE messages in OpenLayers?

Is it possible to catch Raise Warning, Raise Notice and Raise Exception in OpenLayers while using a WFS-T-Layer (stored in a PostGIS-Database) to save edits? Example: A trigger is used to check values ...
0
votes
0answers
31 views

OpenLayers ZoomToExtent doesn´t seem to work properly with WFS layer

My website has a list of routes and a map. When I click on each route it appears its associated information and the WFS layer is selected. As a base layer I have all the routes obtained with WMS. ...
0
votes
0answers
29 views

OpenLayers/GeoServer layer zooms in and then out again - I Added VIDEO OF PROBLEM

I have a strange ZOOM behavior. I am using GeoServer 2.6.1/OpenLayers 2.13.1. I have a layer I created from a MrSid file and am serving as a wms layer. Lets call it the "problematic" layer. When I ...
0
votes
1answer
41 views

XML Parsing Error: error in WFS request with Openlayers

I have written a script using OpenLayers library to get some layers from Geoserver and display them on the map. I use both WMS and WFS layers. Everything worked fine in my localhost (MAMP) in windows ...
0
votes
1answer
14 views

custom button in OpenLayers

I am trying to use a custom button in Openlayers but is does not work. what am i doing wrong? var custom_button = new Openlayers.Control.Button({ displayClass: 'olControlCustomButton', ...
2
votes
1answer
59 views

How to re-project shapefile to be compatible with Openlayers satellite imagery

The goal: Visualize a map using google's satellite (and projection) using my collected points. Right now I have a shapefile of my collected points from surveying. I created it by adding my csv file. ...
0
votes
0answers
17 views

OpenLayers Scale calculation

I'm trying to modify the scale calculation in OpenLayers. Looking at the code, I couldn't understand what is going in this piece of code: scale = (this.map.getGeodesicPixelSize().w || 0.000001) * ...
1
vote
1answer
40 views

how to change the mouse cursor into pan when i select the pan icon in openLayers?

I want to change the mouse cursor into a hand icon when I select to pan. I have tried this code: map.addControl(new OpenLayers.Control.PanZoomBar()); map.addControl(new ...
2
votes
3answers
79 views

How to get the latitude & longitude of the 4 corners of the Map being displayed.

I am working on Open Layer (ol3) and I want to get the Latitude, Longitude of the Corners of the map being shown at at point. I tried using map.getView().getProjection().getExtent() and converting the ...
0
votes
0answers
28 views

Improve GeoServer WMS tile loading delay

I'm using OpenLayers 2.13 and GeoServer 2.3.5 for my development. Following code is I'm using for loading map tiles.. map.addLayer(new OpenLayers.Layer.WMS( "LoadedLayers", url, { ...
0
votes
1answer
77 views

Which method is better for display terrain in OpenLayers?

I want to display terrain in OpenLayers. So, I tried to use dem(.img) and convert it to dem(.jpg) on QGIS. But, the effect is very bad. My expected effect is (This picture is captured from google ...
0
votes
2answers
53 views

Intersection between line and polygon

I have 2 layers in openlayers: first is parcel layer (polygons) and second is railway layer (lines). They are already drawn and all i need to do is when i click on some line, to get intersection of ...
1
vote
1answer
49 views

OpenLayers - URL hyperlink in GetFeatureInfo table?

I am serving numerous WMS layers through GeoServer, many of which have URLs leading to extended data for any particular feature embedded in their attribute table. The URL, if present, is always ...
1
vote
1answer
28 views

OpenLayers 2.11 wms layer in custom projection

I am using OpenLayers 2.11 from here http://cdnjs.com/libraries/openlayers and trying to display WMS layer. It is in 3301 projection so projection is defined as follows: ...
0
votes
0answers
46 views

Connection to Shapefiles and PostGIS

I have this HTML (see below) code, I want to connect to PostGIS to the Shapefiles I have loaded, but I can't find where and how to accomplish that. I want my map to display this Shapefiles when the ...
1
vote
1answer
42 views

Openlayer 2 to highlight city

This is the code to highlight and pop up a country area on mouse click - window.onload = function () { map = new OpenLayers.Map('map', {sphericalMercator: true}); var osm = new ...
0
votes
1answer
33 views

Does an event get fired after a Layer has finished rendering in Openlayers 3?

I am rendering about 27000 Markers in different layers on a mapview. Everything works fine on fast devices. I have a problem on older devices (like the iPad3). When i hide one layer and set another ...
0
votes
0answers
25 views

Creating WMS Tile images on server Programatically

I am using WMS services on client side applications, OpenLeyers. I am adding Tile service for base map, WMS service for road ways, cities etc. Javascript app is creating a view of services. Can I ...
0
votes
1answer
66 views

How to add image(.jpg) to OpenLayers?

This is my website for test: http://www.cv.nctu.edu.tw/shapefile-js-openlayers/ol_simple.html My dem data is (.jpg). var inProj = new OpenLayers.Projection('EPSG:3826'); var outProj = ...
1
vote
1answer
35 views

How to toggle selected features by clicking on them in OpenLayers?

This is my website for test: http://www.cv.nctu.edu.tw/shapefile-js-openlayers/ol_simple.html This is my expected result:http://www.cv.nctu.edu.tw/shapefile-js-openlayers/test.html I want to try ...
1
vote
2answers
138 views

Openlayer 3: geoJSON feature clustering

Ive been trying to use the basic example from openlayer website to create a simple clustering map for my geoJSON data. However, Im not getting any luck to generate any clusters. Below is my code, many ...
1
vote
1answer
43 views

How to change color of a layer in openlayers?

http://www.cv.nctu.edu.tw/shapefile-js-openlayers/ol_simple.html this is my website for test. I add two layers in openlayers. And I want to change color in one of two layers. var myStyle = new ...
1
vote
1answer
66 views

Get Center of Geometry in OpenLayers 3

Given a Geometry object in OpenLayers 3. How would one go about getting its center? Older versions of OpenLayers provided a getCentroid method. There was also a getBounds workaround. But these appear ...
1
vote
1answer
32 views

OpenLayers map with Nominatim lookup function not working

I am trying to create a simple map with a search function, my minimal example is here: http://jsfiddle.net/TimLucas/vbaupe30/4/ For some reason the coords transformation after the script has received ...
2
votes
1answer
78 views

Why my Shapefile is not loaded into OpenLayers?

This is my website for test: http://www.cv.nctu.edu.tw/tonywang/shapefile-js-openlayers/ol_simple.html I want to put my Shapefile in OpenLayers. I found an example at ...
0
votes
1answer
35 views

Problems with a wms layer in Openlayers 3

First of all sorry if my english isn't good. I'm trying to add a layer into an Openlayers 3 map. This one is which I want to insert: new ol.layer.Image({ name: 'cartografia', style: 'cartografia', ...
1
vote
1answer
103 views

Relationship between scale, ppi, and map resolution

Wanting to know the screen resolution (pixels per inch) of my device, I displayed my map resolution and scale using this openlayers code: console.log("resolution: " + map.getResolution()); ...
0
votes
1answer
27 views

How to hide country and city label?

Now I'm using Openlayers to integrate Openstreetmap into my web. Besides, I want to hide/remove all the labels on map(country,city,road,lake....). How can I do that without establishing my own ...
1
vote
0answers
15 views

How to rotate a feature in openalyers 3

I cannot find any api to rotate a feature / geometry in openlayers 3. How do I rotate a polygon in openlayers 3?
0
votes
2answers
35 views

Openlayers Marker z-index

I have multiple marker in one layer OpenLayers.Layer.Marker and some times the marker overlap the other marker. My question is how do I bring the marker in front when its click? is there a setZ-index ...
0
votes
0answers
40 views

Can I use Google's Geocoding with OpenLayers provided the base map is Google Streets?

Not strictly a GIS question but I am hoping someone might have some experience in this area... Understanding the 10.1.1a clause in the Google Maps/Google Earth APIs Terms of Service: (a) No ...
0
votes
1answer
22 views

Strange behavior when zooming with “Tiled:True” in a WMS layer

I activate the TILED parameter to True in a WMS Layer and I get the following strange behavior as shown in the images: This happens only for a couple zoom levels. If I zoom out/in more the features ...
1
vote
1answer
43 views

'setExtent' on vector layer not working?

As pre my requirement I want to set layer extent after drawing all the features. May some feature not visible after applying setExtent() function(this is my requirement). But it's not working. It's ...
1
vote
1answer
62 views

Openlayers: select a feature programmatically from GeoJson

I am working on a project that uses openlayers (version2.14)to display a Bing layer(GeoJSON format), I have no problem reading the GeoJSON and display features, but I want to select a feature ...
2
votes
2answers
61 views

Print view or export to PDF

I am using OpenLayers Tile layer fot my map application. I have WMS layers on map like this: Parcels, Streets, Buildings, Gas Pipes, I zoom to somewhere on map that all layers are visible. I want ...
0
votes
1answer
60 views

OpenLayers 3: Query individual features of Tile WMS

I have several tile wms layer with about 5000 earthquakes and I want to query their features by clicking (as in this example: http://openlayers.org/en/v3.1.1/examples/getfeatureinfo-tile.html). That ...
0
votes
1answer
21 views

Photogallery for OpenLayers

me and my collegue are making a web map application for my town for tourism purpose. The map itself is pretty done, actually, so we were wondering whether add some photos of the town, or that shows ...
1
vote
2answers
31 views

Including js file in openlayer.js file

I have this code for showing markers on map: function addUserLayerCSV(){ layer1 = new OpenLayers.Layer.Vector("CSV", { projection: epsg6316, strategies: [new ...
0
votes
1answer
23 views

unit of point radius in OpenLayers.js

What is the unit of measurement for pointRadius in the code bellow? var dotStyle = new OpenLayers.StyleMap({ pointRadius: 5, }); I mean what does 5 represent? 5pixels or 5mm? or ...
3
votes
3answers
66 views

Ways to deal with thousands of features of vector layer in OpenLayers

I am building a webgis portal too show a big number of polylines (road network) and points (villages, cities etc.). All my data are stored in a POSTGIS and throuh geoserver and Openlayers I display ...
1
vote
1answer
53 views

GetLegendGraphic request string is too long

I am setting the SLD Body of a WMS layer on the client side. I set the style in JSON and I have some functions that convert the JSON to SLD (OpenLayers functions). It works fine for displaying the ...
5
votes
3answers
134 views

Alternative to OpenLayers plugin for QGIS?

Are there any alternatives to OpenLayers plugin to have Google / Bing maps for QGIS projects? I need an high quality cartography (both aerial and street view) but OpenLayer plugin do not allow to ...
1
vote
2answers
50 views

Showing csv file on map

Does OpenLayers support the uploading and rendering of CSV files? If it does, how? I used this code and it didn't help. var curLayer = new OpenLayers.Layer.Vector("layer", { protocol: new ...
1
vote
1answer
37 views

OpenLayers popup not closing on mobile device

I am developing an app that should also work on mobile devices. I would like to close all open popups when clicking on the map (in this case only one can be open at any point, as opening a new one ...
0
votes
2answers
92 views

OL3 check if point is inside a polygon

When I am adding a point to my web map I want to give it a latter that represent the area where the point is, so I need to know in what area is the point. In OpenLayers 2 I did it like this: ...
1
vote
1answer
43 views

How to get coordinates by click on map and send coordinate to MySQL?

I'm building my own web map. Now I want to get the coordinates by click on the map and send the coordinates to MySQL. I tried OpenLayers to get the coordinates from Openstreetmap,but I didn't know ...