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
8
votes
3answers
4k views

Resizing point on zoom out [closed]

I've added a point on map like this but it is static in size. How to resize that point on zooming? Map on zoom out
8
votes
3answers
2k views

Why is using Bing Maps with QGIS free but not with ArcGIS?

Since the end of 2013 a free use of Bing Maps in ArcGIS is no longer possible. You have to obtain a Bing Maps key directly from Microsoft. In QGIS (with OpenLayers plugin) it is possible to use Bing ...
8
votes
1answer
9k views

How to convert a String to OpenLayers.Geometry.Polygon using javascript?

I'm using Javascript, jQuery, Java, GeoServer, OpenLayers and PostGIS. Using java class ResultSet I return this String: POLYGON((516000 2135000,515039.264020162 2125245.48389919,512193.976625564 ...
8
votes
1answer
9k views

getExtent() in OpenLayers returns strange values

I'm trying to get the bounding box of the map area displayed by OpenLayers. I tried to use map.getExtent() because it should be exactly what I need, but the returned values are "strange": For ...
8
votes
4answers
23k views

How can I remove default zoom in/out [+/-] buttons from openlayers to keep the navigation bar on?

I want to remove the default zoom +/- buttons from openlayers. Here is my code <script type="text/javascript"> var map, ia_wms; function init(){ map = new OpenLayers.Map('map', {...
8
votes
9answers
2k views

WMS with Access Control (ACL) for different users? Or solution for thousands of points on web map?

I have a set of sites in the thousands. Not all users see same the same Sites on the map - thus ACL. Data is stored in a non-GIS database (mssql, ora, etc) and right now is retrieved with a standard ...
8
votes
1answer
5k views

TMS vs WMTS vs WMS-C in OpenLayers

GeoWebCache is able to serve layers in the following three standards: TMS, WMTS and WMS-C. Is there any remarkable advantage in using any of them in particular within an OpenLayers framework?
8
votes
3answers
2k views

Create interactive map with no server

I have managed to build a great web mapping application using tiles created from GeoWebCache and a custom gridset, but I now need to add an overlay to the base maps. The only interactivity I need is a ...
8
votes
2answers
2k views

Resize polygon along one axis

Using the following example I'm able to resize by scale and origin. polygonFeature.geometry.resize(scale, origin); vectorLayer.redraw(); But does anyone have any suggestions or sample code ...
8
votes
1answer
4k views

Draw route direction overlay on Google Maps or OpenLayers

I'd like to display the route direction generated from GraphServer on either Google Map or OpenLayers. The result I want is basically identical to how Google Map shows route directions, by ...
8
votes
1answer
19k views

OpenLayers, zoom to vector layer extent

It seems quite simple thing to me, but I get an error. map declaration map = new OpenLayers.Map('map_element', {... projection : _projObj.mercator, displayProjection : _projObj.wgs84 } layer ...
8
votes
1answer
1k views

Recommended Eclipse Plugins for development with OpenLayers and GeoExt?

we plan to create an map oriented online application and muse about the 'best' / helpful plugins for Eclipse. The used technology is OpenLayers and GeoExt. For example is the Javascript development ...
8
votes
1answer
3k views

How to configure custom scale in Leaflet?

I have a custom WMS tileset generated using ESRI ArcGIS Server. I have successfully configured an OpenLayers page to display this basemap. The code is as follows: var map = new OpenLayers.Map('map',...
7
votes
4answers
14k views

OpenLayers: How to create a rectangle?

I want to use OpenLayers to draw a simple rectangle (based on 4 coordinates) on my map. I would also like to fill the rectangle with a color. For example (EPSG:4326): 13.40, 52.50 13.50, 52.50 13.50,...
7
votes
3answers
9k views

Understanding difference between GeoServer and OpenLayers? [closed]

I recently installed GeoServer and downloaded OpenLayers also. I am a bit lost about which one to use when it comes to add functionality in my web map. For example, I want to add layer switcher, ...
7
votes
2answers
7k views

Prevent OpenLayers WMS layer cache by browser

I am using OpenLayers (GeoExt) with google chrome browser. All WMS layer is for live database. I have refreshed the browser at certain interval using javascript but the data is cached in browser and ...
7
votes
2answers
17k views

How to change the WMS Background Color in OpenLayers?

I am using geoserver to serve up an image pyramid basemap. I want to have all areas outside of the data extent be black (instead of white). I have the map displayed inside of a div tag and changing ...
7
votes
2answers
9k views

How to get layer type in OpenLayers 3?

I would like to iterate through all of the added layers in an ol.Map instance and only select the vector layers. So far I could get the individual layers with the a property of the resulting object of ...
7
votes
4answers
22k views

Customizing Popups in Openlayers

Is it possible to customize the shape of popups in OpenLayers? For example, I am creating a pop-up using the following approach: var popup = new OpenLayers.Popup.FramedCloud( "popup", ...
7
votes
4answers
15k views

Cannot see OpenLayers under Plugin in QGIS?

Although I have installed the OpenLayers plugin in QGIS 2.4, I cannot see it in the list when I click on Plugins. Does anyone else have this issue?
7
votes
4answers
7k views

WMS GetFeatureInfo and CQL on Multiple Layers

I am having issues with querying CQL filtered layers with OpenLayers and GeoServer, using the GetFeatureInfo control. It is ignoring the CQL filter and just querying the entire layer (as evidenced by ...
7
votes
5answers
12k views

OpenLayers: ALL image layers are out of place on google maps v3 and OSM base layers

Summary: I have 2 different image layers that looked fine with my old mapstraction/google maps based system. Using the same coordinates as bounds in openlayers results in a shift to the north by like ...
7
votes
4answers
14k views

How to make a private OSM (Save personal information to) a map using OpenLayers or TileMill or mapbox

OSM (OpenStreetMap) is great for making a real time public map for general purposes but what if I want to add private info to a map such as the location and date of my first kiss or a note about every ...
7
votes
4answers
9k views

Plotting KML files onto a Google Map

I would like to show a map on my website. I have 2 different kinds of KML files that need to be plotted. One defines region boundaries. The other points within those boundaries. The region boundaries ...
7
votes
1answer
13k views

Layer name in OpenLayers 3.0

I'm looping through all the layers in my map using map.getLayers().forEach(function(layer, i) { ... }); I'd like to get the name of each layer but I haven't been able to find anything in the ...
7
votes
4answers
7k views

Best solution for printing Google Maps?

What is the best solution so far for printing Google Maps as a base layer of Vector layers in Geoserver/OpenLayers application ? I used to print WMS layers using GeoExt print page example, but when ...
7
votes
3answers
4k views

Determine if a polygon intersects itself in OpenLayers

I let the users draw polygons and then I try to save them out to the SQL Server 2008 SQLGeography field, but it is giving me an error: Error 24200: The specified input does not represent a valid ...
7
votes
1answer
4k views

Geodjango with Geoserver and Openlayers

I am trying to teach my self Django and its spatial extension geoDjango. There is one thing, which is still a bit foggy in my mind. When using the trio: Postgis, geoserver, openlayers is perfectly ...
7
votes
2answers
5k views

How to trigger registered events in Openlayers?

I am building a web application where I need to compare 2 different maps of the same area, I need for the events on one map to automatically be triggered on the other map. I have so far: map2.events....
7
votes
3answers
8k views

Creating Polyline Buffer in OpenLayers 2?

I was wondering if there was a way to create a buffer around a polyline feature in OpenLayers 2. I have created a tool that allows the user to draw a circle buffer zone of whatever size and style they ...
7
votes
3answers
2k views

How to close watermarks window in QGIS Openlayers plugin?

I'm using Quantum GIS Ver. 1.7.4. I have upgraded openlayers plugin 0.7 to 0.9. However when I open google satellite, a watermarks/copyright dialog box "Data Peta@2012 ..." appear in the middle of the ...
7
votes
4answers
28k views

Get single layer in OpenLayers 3

I am doing an upgrade from OpenLayers 2 to Openlayers 3 and it seems to me that in OL3 there is no direct way to get a layer from map by its id. In OL2 it was like: map.getLayer(id) If we look in ...
7
votes
3answers
11k views

Openlayers remove previously drawn polygon on starting to draw next one

Objective: At any point of time there SHOULD only be zero/one polygon(s) on a vector layer with a polygon control. I need the previous polygon to be removed as soon as user starts drawing the first ...
7
votes
2answers
2k views

"Poor" quality when zooming out a WMS-Layer based on GeoTiff data

i am having some issues when using the Geoserver Web Mapping Service to display GeoTIFF-Files. When zooming out (in an OpenLayers-Client or in the Geoserver Layer Preview for instance) the quality ...
7
votes
2answers
7k views

How to check map tiles are loaded in OpenLayers?

How to check if the map tiles are loaded? I need to know whether all map tiles are loaded on to the OpenLayers map as html contents.... Is there any method to find out or function in openlayers to ...
7
votes
1answer
28k views

Click a marker icon to open a pop-up, using OpenLayers

Background Looking to create a pop-up that performs an Ajax request when the user clicks a marker on an OpenLayers map. The markers, however, have different icons. The following is working code that ...
7
votes
5answers
7k views

Using OpenLayers Selectfeature get mouse position? [closed]

How do I get mouse coordinates after a SelectFeature, which returns the feature by itself?
7
votes
2answers
8k views

Search functionality in Openlayers/Geoserver

I am using Openlayers,Geoserver & Postgis.... My postgis tables are having columns as id, name, POINT/POLYGON/LINE. Each table corresponds to a layer that I am showing in layerswitcher in OL. I ...
7
votes
2answers
5k views

Displaying feature info in a popup

I was able to "combine my shapefile and CSV data have made a lot of progress on my project. Now I want to display the attribute data in a popup when I either click or hover over a country... I've ...
7
votes
3answers
3k views

Seeking API to return GeoJSON data for countries borders?

Is there a simple free REST API where I can send the name or code of a country and get in return geojson data which highlights it's borders ? I'm writing an application where I will have a changing ...
7
votes
2answers
4k views

Using OpenLayers (with OpenStreetMaps) and PostGIS for rendering data acquired from GPS tracking device

I am researching and planning to acquire data from GPS device and store them in PostGIS database, then use geodjango to process/work them out and finally chart them on a map with OpenLayers. Will ...
7
votes
1answer
16k views

Finding URL of GeoServer layer?

I'm a basic/novice user with GeoServer. I've installed it and have loaded a sample shapefile, which I can view using the Layer Preview option. Now I want to add this shapefile (as a WMS layer) to a ...
7
votes
1answer
5k views

Search layers with OpenLayers?

I have my map running over GeoServer and OpenLayers, but I want to add a search box to find places in it. Well not specifically places but directions. The map reads the layers directly over GeoServer ...
7
votes
2answers
9k views

Is it possible to display the length of each segment with the Openlayers measure control?

I am trying to make a OpenLayers measure tool that displays the length of each segment on top of each segment and the total length of the measurement as shown below: I have used this example http://...
7
votes
3answers
4k views

How to generate a thumbnail of an openlayers map?

I would like to allow the user to generate a thumbnail image of what the user is seeing in the OpenLayers map canvas so the user may print, save, share, email, or whatever. Any ideas of how i would ...
7
votes
1answer
5k views

How to add KML data but from variable - not from url?

I have a working map that retrieves KML from a url, but now I need to get the KML data from a local variable instead. Is there support for this, and if so what is the syntax. Searched the api and ...
7
votes
1answer
9k views

Trying to place a Point geometry on OSM map, unsuccessfully

I have a piece of code that takes a map layer and places a vector layer on top of that. Currently, I'm just trying to place a few points on top of the map, unsuccessfully. I managed to place 1 point ...
7
votes
2answers
10k views

Print library for OpenLayers?

I realize this is a bit of an open question but are there any known open JavaScript libraries which facilitate printing an OpenLayers map? I'm looking to produce the content on the client and ...
7
votes
1answer
7k views

How to create a movable point in OpenLayers?

I have the following code: function mapCreate(lon,lat){ map = new OpenLayers.Map("map1"); var osm = new OpenLayers.Layer.OSM(); vectors = new OpenLayers.Layer.Vector("Vector Layer"); ...
7
votes
2answers
4k views

How can I zoomToExtent and then zoom out?

I use openlayers 2.12 I use HTML5's geolocation API to get the coords and then I insert them in a layer as feature (point). After that, I zoom in , since the layer has no other feature. map....

1 2
3
4 5
66