Tag Info

New answers tagged

0

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 ...


0

I solved it by using this way Change curl_setopt($ch, CURLOPT_PUT, true); to curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");


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 = ...


0

Ok, I found where was the problem. Of course, you have to specify which kind of protocol to use, so the correct syntax was: protocol: new OpenLayers.Protocol.HTTP({...})


0

Found what was the problem. Following that example, I thought that that syntax was referring to properties inside OpenLayers. Instead it wasn't. Where you have to indicate the style, you have to put the name of the namedLayer of your sld, like so: var format = new OpenLayers.Format.SLD(); OpenLayers.Request.GET({ url: 'style/roadsStyle.xml', ...


0

In order to render this as a polygon, you need to enclose the coordinates in an additional pair of square brackets: lr = new ol.geom.Polygon([[ [aoi.west, aoi.north], [aoi.east, aoi.north], [aoi.west, aoi.south], [aoi.east, aoi.south] ]]).transform("EPSG:4326", "EPSG:900913")


0

At OpenLayers Cookbook code examples (http://acanimal.github.io/Openlayers-Cookbook/) there is a working example, see "Chapter7 - Styling - Improving style using StyleMap and feature's attributes replacement". Create your style intent without using rules, really you are not using them because you are not setting any condition to filter. For example try ...


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/


0

The following is a modified version of what has been working for us. You'll need to supply your own logic for setting the specific style. In our situation, we base the style on the layer name using a series of if/else statements. import os from geoserver.catalog import Catalog """ geoserver_username - the username of the server geoserver_password - the ...


0

Well, took me a couple of hours but I found one way to do it. It requires you to use dojo.js, (which unfortunately I can't use for my project but thought I'd share for anybody else that's looking). Basically, as I understand it, dojo adds a custom wrapper to openlayers map which allows you to add Dojo GFX Shapes and Widgets - which includes Pie Charts! ...


0

Don't tested but try setting it as a new parameter on L.TileLayer.WMS. At least the code seems does not filters parameters (https://github.com/Leaflet/Leaflet/blob/master/src/layer/tile/TileLayer.WMS.js). On the other hand, it is also better you configure your WMS server to solve the problem at servir side. This way no matter of client you will not have ...


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

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 = ...


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:"", ...


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


0

my strategy (very resource intensive) is to listen to mousemove and constantly saving x and y values in global variables. var mouseLat, mouseLon; function init(){ ... map.events.register("mousemove", map, function(e) { var position = this.events.getMousePosition(e); var lonlat = map.getLonLatFromPixel(position); var lonlatTransf = ...


0

I was also looking at this trying to figure out how to make it work with the composer that comes standard with OpenGeoSuite. If you are in windows and aren't quite ready to create an app with the Boundless SDK, you can still change some of the configurations through the geoexplorer script. If you are in windows the default file location is: C:\Program ...


0

found the answer: the clustered feature (placemark) is "inside" the cluster feature, not the layer. SOLUTION 1 first way out (not most efficient): inside onFeatureSelectFeature(featureId) i loop thru cluster features as seen below: function onFeatureSelectFeature(featId) { var layerNow = map.getLayersByName('Paradas')[0]; var layerFeatCount = ...


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


0

it also works without needing GEvent google.maps.event.addListenerOnce(openlayersMap.baseLayer.mapObject, 'tilesloaded', function(){ alert("Map Loaded!"); } );


0

I would have added this as a comment but since I don't have the reputation I thought I'd put it as an answer. I believe that both simplification and some form of spacial indexing are used in OpenLayers 3 to improve vector performance. It may be worth giving it a try if you are currently using OL2. Source ...


0

Use the ModifyFeature control. Add your layer to the control, add the control to the map, activate the control and then call selectFeature() on the control and pass it your feature. The API makes it sound like you have to be in standalone mode but it works for me without being in standalone mode. I'm using OL 2.13.1.


0

this works for me: function onFeatureSelect(event) { var feature = event.feature; var layerName = event.feature.layer.name; var content = "unInitialized"; // alert ('selected this feature='+feature.id+ '<br/>Atributos: '+feature.attributes.description); if ( (feature.attributes.name > '') || (feature.attributes.description > ...


0

You are writing bad, it must be: xgis.map.prototype.zoom = function(action) { ... } Anyway, it is better you follow the Ol code conventions. To create subclasses you must create methods inside class definition, something like: xgis.map = OpenLayers.Class(OpenLayers.Map, { someAttribute: 'someValue'. someMethod: function() { ... } ...


0

Sometimes the solution is simple. It seems the Canvas and VML renders don't work well with holes. I switched back to SVG render and it works fine now. So the simple solution is to remove this line : renderers: ['Canvas', 'VML']


0

Problem is CORS which is not allowing the tiles to load from 192.168.1.127 I configured the proxy and now its working fine.


0

I solved it myself. To hide the icon: set the externalGraphic to null. To be able to show the correct icon again I had to assign a new attribute to the feature, with info of the original icon (in my case just a code word, retrieved from the checkbox ID). To show the icon again: check if it is null, and if so set the correct icon with the icon attribute. The ...


0

For the moment it is not possible with OpenLayers3. See: https://groups.google.com/forum/#!searchin/ol3-dev/tiles$20loading/ol3-dev/zktMTr2G4X4/uf4b3QBb-kwJ https://groups.google.com/forum/#!searchin/ol3-dev/tiles$20loading/ol3-dev/_w07WkrclsQ/nbuPvvcAQwkJ Vote for this issue at github project.


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

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 ...


0

I have just had a quick play using the developer tools in chrome to apply display:none to hide a feature, by changing it to display:inherit, the feature reappeared. I suggest you try using: var feature = pois.features; for (var i = 0; i < feature.length; i++) { if (feature[i].style.externalGraphic == "url to icon") { ...


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 ...


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 ...


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

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 ...


0

Ok, it seems the "icon" in my text file was not interpreted as an attribute at all, but as an externalGraphics link. Logical off course, I just didn't get it. So now I'm able to access my icons with: function hideFeatures() { var feature = pois.features; for( var i = 0; i < feature.length; i++ ) { if (feature[i].style.externalGraphic ...


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();


0

You are encapsulating your pois in a function using var, hence it's not possible to access it directly (search JavaScript scope on a search engine) You can always access at your demo page the pois features indirectly because map is global and layers are attached to map with map.layers[1].features Clearly, it's not safe to use an indice [1] as it may change ...


0

Could somebody please explain above the Problem of zooming to particular location on using onclick Function, as am also facing the same issue. @rob..could you please elaborate more on that.


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 ...


0

I used the templates at http://themapguyde.blogspot.co.uk/2014/08/bootstrap-map-viewer-templates.html to quickly produce a Bootstrap and OpenLayers 3 map. The source is on GitHub at https://github.com/jumpinjackie/bootstrap-viewer-template.


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 ...


0

Accordind to the doc you need to parse the event.features and build your text for the popup: info = new OpenLayers.Control.WMSGetFeatureInfo({ url: 'http://localhost:8080/geoserver/wms', title: 'Identify features by clicking', queryVisible: true, eventListeners: { getfeatureinfo: function(event) { var txt = ""; ...


-1

For my QGIS 2.4 this is located in: Web > OpenLayers plugin


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), ...


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 ...



Top 50 recent answers are included