Questions tagged [openlayers-2]

Use this tag when you are using the DEPRECATED version 2.x of the OpenLayers JavaScript client toolkit.

Filter by
Sorted by
Tagged with
0
votes
1answer
17 views

OpenLayers: Wrap data around the globe

With my current implementation if I create a point it is visible only on the first map view. If I move around e.g. move to the right the new view without point is shown. Is there any posibility to add ...
0
votes
0answers
20 views

Can OpenLayers detect "Map data not available"

With my current implementation I check if my map is on the zoom level where its data is not available, if yes than I switch to another map. But I wonder if there is some option e.g. event listener in ...
0
votes
1answer
21 views

OpenLayers print Logo

I added a logo image for the map in this way: <div id="map" class="map sidebar-map"> <div class="logo"> <img src="assets/img/logo.png" ...
0
votes
1answer
23 views

OpenLayers: Export from / Import to KML - keeping the layer structure

I have following structure before export: LayerGroup LayerGroup Layer Feature Is there any posibility to keep this structure when export/import KML? I noticed in the KML file after I export ...
2
votes
1answer
42 views

OpenLayers problem with adding features to custom drawings

I would like to export the features drawn on my OpenLayers map in GeoJSON format. So far everything is working apart from the properties section, which keeps coming with nothing, as you see below. I ...
0
votes
1answer
54 views

Clicking on newly created Vector layer in unit testing (Jasmine)

I've created a component that attaches a new vector layer on the click of a polygon. I've used custom interactions of openlayers to do so (using ol/pointer). I need to click on a particular coordinate ...
0
votes
0answers
44 views

Why are points from a MySQL WMS layer, displayed on a OpenLayers 2 map, reading out a lat/long location that is off by 500 meters,

I have a MySQL table containing MySQL point geometries (MySQL 5.7). I have configured a GeoServer WMS layer using this data. I cannot set the native srs (not enabled in config dialog), declared srs is ...
0
votes
0answers
58 views

vue.js base wont load in while loading OpenLayers map

While using OpenLayers library in vue.js the map won't load. It isn't showing any error but only zoom in, zoom out and OSM atrribution is showing. <template> <div ref="map-root"&...
0
votes
0answers
41 views

OpenLayers fit to extent doesn't work

I have the following example: <script src="http://www.openlayers.org/api/OpenLayers.js"></script> <div id="mapdiv"></div> <script> map = new ...
0
votes
1answer
111 views

Viewing Google Satellite on my web map

Please help me add "Google Satellite" to my web map by following the code below: Ext.onReady(function() { Ext.QuickTips.init(); var bounds = new OpenLayers.Bounds( ...
0
votes
1answer
16 views

OpenLayers 2 - Capture failure of WFS HttpRequest

I have a WFS Layer whose HTTP Request might fail from time to time. How do I capture the failure? var opt = { url: widget.options.wfs.url, params: { ...
2
votes
1answer
196 views

Drawing new features with QGIS2web plugin

I would like to draw shapes with QGIS2web plugin According to the query here: Add OpenLayers3 controls to qgis2web project I should be able to develop the qgis2web.js file further behind the ol.Map ...
1
vote
1answer
54 views

QGIS2web label doesn't want to come out

I would like to have label visible for both cryterias in my layer. One case works fine whereas the other one doesn't. In the code everything is exactly the same... function ...
0
votes
0answers
67 views

QGIS2web struggling with labelling

I want to offset my label appearing in the interactive map generated by QGIS2web plugin. Unfortunately the variables offsetX and offsetY don't work... var size = 0; var placement = 'point'; var ...
1
vote
0answers
31 views

Search for the syntax to display an HTML link in an OpenLayers popup

I use a code found on the site : http://www.untourenvelo.ch/Carte_Plein_Ecran.html . It uses the Api Openlayers 2.13.1 . In the development of this website it is possible to display GPX data that are ...
0
votes
0answers
27 views

Unable to get output for WMSGetFeatureInfo in OpenLayers

Can anyone please help me on using the WMSGetFeatureInfo in OpenLayers. I am able to add WMS Layers on top of OpenStreetMap. But while using the FeatureInfo functionality I am not getting the results. ...
0
votes
0answers
38 views

OpenLayers: given the same number of Features, is it better to have one big Layer or several small ones?

Given a certain amount of features that sometimes don't fit all together inside the current window, is it better to use one single/few big layer/s or it it better to split the features among more ...
0
votes
0answers
56 views

OpenLayer2 Tween animation callback not working when the browser tab is inactive

I have data dumping in my db after some interval from resources.The geometry from the data then calling by JS interval function after every ten seconds.using this function to animate my feature http://...
1
vote
1answer
119 views

OpenLayers styling lines between points

I drew a line between two points and would like to change the line styles but currently is not working as expected. Tried to add the style into the features. Am i missing something? var ...
0
votes
0answers
124 views

Points disappeared after changing CRS [duplicate]

I'm having a problem with CRS and layers in QGIS & on Geoserver What I'm trying to accomplish to change CRS of layers in importing. I'm importing 'test.geojson' file in QGIS, and when I open ...
1
vote
0answers
19 views

Retrieving new data in the layer [closed]

I am solving the way of writing data to KML file using OpenLayers in map application. I want to ask if OpenLayers can insert new coordinates into a layer after 2 seconds, for example. So far I have ...
0
votes
0answers
48 views

Is project more Leaflet or OpenLayers or Map Server friendly? [duplicate]

I have several tables in a database on PostGIS. I want to create a website where the users can log-in, show the layers they want and filter the elements of the layers based on the fields of the ...
1
vote
1answer
508 views

OpenLayers select.on event listener fires multiple times (renders multiple)

I am using hook React. How to render event only once instead multiple times useless? When I am selecting a feature, it renders multiple times var select = new ol.interaction.Select(); const translate =...
2
votes
1answer
590 views

Resizing Map width and height (avoid distortion)

I am working with OpenLayers library on React My first question is how to avoid distortion while resizing map width and height, The second issue is when I am changing with/height each time it ...
1
vote
0answers
32 views

OpenLayers zoom selected feature

In our OpenLayer.js we first call the maximum extent of the map: "maxExtent: new OpenLayers.Bounds (X1, Y1, X2, Y2),". After the layer definition follows "map.addLayers ([lyr1, layer3, layer4]);" ...
2
votes
1answer
94 views

Getting strange exception since switching to GeoServer 2.16 from 2.8 with WFS queries in OpenLayers 2

Here is the error in the GeoServer log (as it is returned to the caller): 2019-10-28 17:03:59,021 INFO [geoserver.wfs] - Request: getServiceInfo 2019-10-28 17:03:59,053 ERROR [geoserver.ows] - ...
1
vote
0answers
80 views

Migration from ol2 to ol6 fixed strategy missing

I try to migrate from ol2 to ol6. My ol2 uses OpenLayers.Strategy abstract class with Fixed() and BBOX members: var strategy = layerData.Strategy == "fixed" ? new OpenLayers.Strategy.Fixed() : new ...
0
votes
0answers
299 views

How to add map.addControl, WMSLegend in OpenLayers 2

I am trying to get the categorized symbology for a single WMS layer in the layer switcher. See my code below (I am getting error OpenLayers.Control.WMSLegend is not a constructor) My OpenLayers ...
0
votes
0answers
763 views

Unable to preventDefault inside passive event listener due to target being treated as passive: Openlayers 2

I am getting the following error messages: How do I define add control and prevent passive event listener? Below is the code: <!DOCTYPE html> <html lang='en'> <head> <meta ...
1
vote
0answers
305 views

No GetFeatureInfo response when clicking on a map in OpenLayers 2

I have the code below, however no response when clicking on the map. <!DOCTYPE html> <html lang='en'> <head> <meta charset='utf-8' /> <title>My OpenLayers Map</...
1
vote
0answers
2k views

Uncaught Reference Error: init is not defined

I am getting the above error on my HTML file @ line number 22. I tried several attempts and was unable to resolve it. Here is the HTML code: <!DOCTYPE html> <html lang="en"> <head&...
-1
votes
1answer
341 views

Uncaught Reference Error: OSM is not defined Openlayers 2

I am trying to get the get feature info and popup to function. Currently, I face the above error. Not sure how to define OSM because all layers were loading fine before I added the getfeature part of ...
0
votes
0answers
40 views

Attribute query OpenLayers server

As part of the MapServer polygons (district boundaries) are shown on the OpenLayers map. The script is in JavaScript. The polygons contain attributes. Currently, a second window opens with the ...
0
votes
1answer
45 views

Drag Vertices - ol2 Modify Control vs. ol3+ Modify Interaction

In OpenLayers 2, clicking a geometry with an active modify control running, created a drag vertice on every edge of the geometry which could be used to modify the geometry by dragging. In OpenLayers ...
-2
votes
1answer
89 views

Local coordinates in NoSql database

Is there any nosql database which supports the below 1) Should support local coordinates (spatial data which holds the coordinatesof door, Infra, etc.) 2)Integration with Geoserver.
2
votes
0answers
190 views

Shapefile or GeoJSON? [closed]

I'm interested in understanding the relative merits of using GeoJSON or shapefile formats for handling geo-spatial data, particularly in an open-source, Python (CKAN project), web-development context. ...
1
vote
0answers
29 views

Zoom to a selected feature with Openlayers 2

var cen = new OpenLayers.LonLat(lng,lat) .transform(proj, map.getProjectionObject()); map.setCenter(cen,30); I need to zoom into the feature selected.
0
votes
0answers
58 views

OpenLayers 2.13.1 WMSGetFeatureInfo not working on mobile

I'm using OpenLayers in version 2.13.1. On desktops everything is OK, alert is showing when I click on route. But on mobiles it is not working, probably touch event is not triggered. var infoControl =...
0
votes
0answers
2k views

How to render values onClick() event in componentDidMount()

I am using OpenLayer library and I need change values in ComponentDidMount() but when I am clicking it does not affect. I have used forceUpdate(). handleDisable = () => { this.setState({ ...
0
votes
1answer
256 views

How to change tileSize in XYZ from default([256,256]) to something else for openlayers?

I am trying to change the tile size and I have not been able. Below is the code. var projection = get('EPSG:4326'); local_url = 'assets/tile/{z}/{x}/{y}.png'; map = new Map({ target: 'map', ...
0
votes
0answers
156 views

Conversion from DXF to SVG

I want to convert a file from DXF to SVG and for that I am writing a python script. However, While converting from DXF to SVG there are certain features that are different such as xOffset, yOffset, ...
1
vote
2answers
64 views

zoom set to 4 but on get zoom shows zero ,OpenLayers

var map1 = new OpenLayers.Map('firstmap'); var wms1; var state1="<%=state%>"; var cql_filter1="st_nm='"+state1+ "'"; wms1 = new OpenLayers.Layer.WMS( "OpenLayers WMS", "http://localhost:...
0
votes
0answers
147 views

Set center and zoom after CQL filter

I need to display map on the submenu li click with CQL filter which works for me but map displayed is as shown in screenshot. I am unable to adjust its center and zoom. var map = new OpenLayers.Map('...
0
votes
0answers
102 views

Get xy coordinates from latitude and longitude in OpenLayers 2

I'm trying to get the XY on layer but the values are wrong; the lat lon values are correct. I need to convert lat/lon to xy values with OpenLayers 2.
0
votes
0answers
98 views

How to get the color of pixel openlayes 2?

I'm trying to get the color of the pixel from the map in Openlayers 2. Or is there is a function to get xyz values from rgb?
0
votes
1answer
270 views

Style OpenLayers.Feature.Vector in OpenLayers.Strategy.Cluster()

I'm using the clustering feature in my project. I collect list of points like so: cluster_features.push(new OpenLayers.Feature.Vector( new OpenLayers.Geometry.Point(lon,lat), {heading:deg} )...
0
votes
1answer
312 views

Loading a GPX file using OpenLayers 2

I am trying to read a gpx file and add it as a layer to Open Layers. Here is my code snippet osMap = new OpenLayers.Map({ div: "map", maxExtent: extent, resolutions: ...
2
votes
3answers
398 views

Using Proj4js with OpenLayers to transform lat lng from 4326 to 27700 but coming out unchanged

Using Proj4js to transform lat lng from 4326 to 27700 but coming out unchanged. I am using OpenLayers 2.12 (OS API Leisure map) EPSG 27700, Proj4js (CDN) I have added the definition to proj4 ...
0
votes
0answers
195 views

How to import a GeoJSON file from GeoServer using OpenLayers

I have been trying to import the layer that I created in GeoServer. I need to use OpenLayers. This is what I have so far. <!-- language: js --> <script type="text/javascript"> var ...
0
votes
0answers
84 views

OpenLayers 2 increase timeout for WPS call

I am calling a WPS process with OpenLayers 2 (I know it is deprecated). I use the function OpenLayers.Request.POST and post an XML file. This works fine for "normal" requests. But I also need to call ...

1
2 3 4 5
66