Tag Info

Hot answers tagged

3

You need to change the css tag olControlAttribution in style.css or override it in a style tag in the <head> element. This tag looks like: .olControlAttribution { font-size: smaller; right: 3px; bottom: 4.5em; position: absolute; display: block; } so changing bottom: 4.5em to something like bottom: 1px ought to do it. The source of ...


3

Feature creation can be kind of tricky in OpenLayers 3. There aren't any official examples for ol.source.Vector layers, most of them are working with GeoJSON, or some other data exchange format. I have managed to create a working fiddle. Let me explain some of the key aspects of achieving your task. var layerLines = new ol.layer.Vector({ source: new ...


2

Can you try this (change GeoJSON to the format you want to load.): vector_format = new OpenLayers.Format.GeoJSON({ 'internalProjection': new OpenLayers.Projection("EPSG:31466"), 'externalProjection': new OpenLayers.Projection("EPSG:3857") }); result = vector_format.read(newFeatures); vectorLayer.addFeatures(result); This worked for me.


2

My first guess would be EPSG:4326 WGS84 lon/lat degrees. Similar to this question: Import Points with WKB format to QGIS I imported the data into QGIS using the QuickWKT plugin, and the point ends up in the Greek town of Volos: If you have a postgis database attached to QGIS, you can simply copy and paste the point into an existing Postgis table of type ...


2

create coordinate list var obj={}; obj.d=[]; obj.d[0] ={}; obj.d[0].vLongitude = 45; obj.d[0].vLatitude= 45; obj.d[1] ={}; obj.d[1].vLongitude = 55; obj.d[1].vLatitude= 55; create a markers layer var markers = new OpenLayers.Layer.Markers( "Markers" ); map.addLayer(markers); and add all markers on map for(var ...


2

Have you done the pgRouting workshop? The workshop should clarify the following: There are import tools for OSM data, so the network will contain the routing topology already after import. If you still want to use SHP files, then it explains how. Your bus stops have coordinates, so you just need to start from the nearest point in your road network. ...


2

The ArcGIS REST API hasn't been included in the OpenLayers 3 code yet. People are discussing its importance and it is expected to have an implementation in a later version. Until then, you can try to stack with an ArcGIS WMS server or use OpenLayers 2. OpenLayers 3 WMS example: http://jsfiddle.net/GFarkas/tr0s6uno/ Code: map = new ol.Map({ target: ...


2

With the fixed mapfile, it become clear to me, this is a client side problem. There is nothing wrong with the MapServer setup, the resolution limit has been set in the OpenLayers map object automatically. To override this limit, include a maxResolution parameter in your OpenLayers.Map constructor. var map = new OpenLayers.Map('map', { ...


2

It is mentioned here (at the very top of the page) that in OpenLayers 3, the functions you describe: "They have been removed and were "replaced” by style functions" They also provide a link to more information regarding those functions and how they can be used. Hope this helps.


2

Vector layers have a 'redraw' method, which can be executed after changing style. After that, only re-rendering will occur and layer data remains unchanged. For example: layer.styleMap.styles.default.defaultStyle.strokeColor = '#AAAAAA'; layer.styleMap.styles.default.defaultStyle.fillColor = '#ABCDEF'; layer.redraw();


2

You don't say how you are opening your JS script in FireFox. I believe this layer type is using Ajax calls. You cannot open the file with file://myfirstmap.html. You have to use a web server to view the map. The problem that you will face with OpenLayers is that some formats like the text/tab/csv format does not use Ajax calls. So you start with these ...


2

http://localhost/ will be interpreted by the WMS server as its own host, but the SLD you want to use is on your app's host (let's say http://myapp.com/. So yo will have to change your SLD URL to the app's public URL (using its FQDN), e.g. http://myapp.com/style/point.xml: { layers: "PGS:geopoint", transparent:true, style:"", ...


2

Trying to find a solution, I've changed OpenLayers.js file, provided by plugin authors (which had 'Release 2.11' version in his body and was placed at ~/.qgis2/python/plugins/openlayers_plugin/weblayers/html folder in my system) to last 2.13.1 version from official OpenLayers site (pay attention, 2.+ version!). Just download the archive, extract to ...


2

This is currently the case, see: https://github.com/openlayers/ol3/issues/2907 for the relevant discussion


1

Selections with multiple polygons are kind of tricky in OpenLayers 2. You have to check for every markers if they're within every selected polygon. With more markers, this can slow down the application drastically. There might be an easier way to do this, however this is my solution for your problem: function updateFeatureTable(featureList) { var wkt = ...


1

Avoid using capitalised letter within textAlign and textBaseline, the values must be in lowercase. Next example, fixing that issue, works fine: http://jsfiddle.net/dL3h58a9/8/


1

You could get the geometry by joining your query result's id2/edge with your layers's geometry ID (gid): SELECT s.seq, s.node, s.edge, s.cost, b.gid, b.geom FROM ( SELECT seq, id1 AS node, id2 AS edge, cost FROM pgr_dijkstra(' SELECT gid AS id, source::integer, target::integer, ...


1

Following the 2nd example from ST_MakeLine, you could join the nodes from your routing output, to nodes representing a Postgis point, and use this to create a line, something like: SELECT ST_MakeLine(gm.the_geom ORDER BY rt.seq) As route_geom FROM route rt inner join geometry gm on rt.node = gm.node ; where route is the output from pgRouting and geometry ...


1

Why do you want to use WMTS? The GBIF website is based on Leaflet. The built-in tiles layer are not using WMTS grid at all but the OSM default grid. Normally with both OpenLayers 2 and 3, you just have to change the URL parameters when tiles are base_url/z/x/y.png but the GBIF url do not work the usual way: it requires more changes as the url uses ...


1

When inspecting your sample url, I see that tiles called are coming from https://pregeoegl.msp.gouv.qc.ca/cgi-wms/mapcache.fcgi/tms/1.0.0/carte_gouv_qc_public@EPSG_3857/4/13/28.png. I should be able to make a getCapabilities request (see http://mapserver.org/mapcache/services.html to understand how I deduced it) with ...


1

a. For WFS, I already done an answer somewhere else. If OpenLayers 2, use strategy please. b. For WMS slow, it's not about GeoServer "slowness" than the fact you use so much layers and it acts on network >> See this twitter reaction to make some calculations. #webgis please stop publishing maps with many active tiled layers: 20 layers X 20 tiles per ...


1

You have a couple of issues. 1). Those bounds do not look correct. If you look at spatial ref.org for that projection, you will see that the projected bounds are: 2490547.1867, 5440321.7879, 2609576.6008, 5958700.0208. Your input, 363273 is way outside of these bounds. Using Postgis, select st_astext(st_transform(st_setsrid(st_makepoint(363273, 5770864), ...


1

Internally OL3 uses Google Closure XhrIo to load data in vector layers. OL3 philosophy has changed, now is a more concrete library, mainly oriented for gis mapping, instead a general purpose library like OL2. OL3 leave to the user tasks like AJAX request. You can make them using XMLHttpRequest or through any other library like jQuery or Google Closure.


1

One thing you can do if you have base layers with different resolutions is to detect for the layer in the changebaselayer callback and then reset the map's resolutions array, and redraw the panzoombar control, so it can only zoom to the new base layer's resolutions. map.events.register("changebaselayer", this, function (obj) { if (obj.layer.name == ...


1

After searching a little deeper, I just remembered that vector layer in OL is drawn on canvas. So it's easier to work with since HTML5 canvas has the 'color-blend' property called globalCompositeOperation. //First get the DOM Element of the layer var div = document.getElementById(buffer_layer.id); //Then get the canvas element; //it returns an array, so ...


1

You can't turn the layers in a layer group on and off independently. If your client needs to turn layers off then you need to request them separately in OpenLayers.


1

You have two choices Solution 1: You can change the reference to proj4js. OpenLayers 2.x default support is with Proj4js 1.1 whereas you use 2.x. <!doctype html> <html lang="en"> <head> <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/proj4js/1.1.0/proj4js-compressed.min.js"></script> <script ...


1

Here is a post I have written regarding how to achieve this, I have covered many things including web-sockets here. http://yasassriratnayake.blogspot.com/2014/09/developping-web-bases-realtime-updating.html


1

Late response, but here is a talk demoing how to use vert-x, Leaflet and websockets for a real-time bus position tracker http://vimeo.com/106234599


1

had the same problem and found no tools that would give me the solution, so what i did was take the LineString (which is not the feature, but the feature's geometry => feature.geometry), get its vertices and store them in an array (points) function onFeatureSelectLineString(event) { var feature = event.feature; var points = ...



Only top voted, non community-wiki answers of a minimum length are eligible