Tag Info

New answers tagged

3

Polygon layers by default do not stay the same size when zooming further out because they represent an area. The only aspect that you will see for smaller polygons when zoomed out is just the outline. If you still want to represent the feature when zoomed far out one option would be to add a <PointSymbolizer> within the sld that will turn on at x ...


0

I guess you are using GeoExt as you are talking about a "LayerTree", right? If yes, just use a OverLay-Layer-Container: http://geoext.org/lib/GeoExt/widgets/tree/OverlayLayerContainer.html var layerList = [ { nodeType: "gx_overlaylayercontainer", text: "Overlay Layers", expanded: true }]; var tree = new Ext.tree.TreePanel({ title: "Layer", loader: new ...


0

If you want to set the height of the map-div to 100% you should use percentage for the parent Elements, too: Just try to add this to your style-section: html, body { height: 100%; } More info: http://webdesign.about.com/od/csstutorials/f/set-css-height-100-percent.htm Edit1: Just tested your javascript with my own WMS-Service and it works fine. ...


0

You can use turf.js in client side (as Devdatta said) but also on the server. It requires nodejs and spatial data in geojson format, the perfect format if you like to render it on a leaflet map. You can install just the modules that you need: Buffer: turf-buffer Merge: turf-merge Overlap: turf-overlaps Here is an example with node


1

The answer to your question is yes. You might like to clarify what kind of server-side software you have. You can use GeoServer to do WPS requests. You could use a Python library like Shapely. Or a C# library, or a Java library, or a JavaScript library. Or the QGIS API, or the ArcGIS API or the database, be that SQL Server, PostGIS or Oracle. So, to ...


0

I really didn't look in the OpenLayers 2 API but you just need to know JavaScript to make it better. Just use array manipulation functions at Mozilla Developer Network documentation (MDN) var towns = ['Paris', 'London', 'Lisbon']; var inFilters = towns.map(function(el) { return new OpenLayers.Filter.Comparison({ property: 'city', type: ...


-1

I'm interested in the response of this because i had the same problem. I solved it(but it's not really a good solution) publishing several Vectors using the same entring data and giving them a different style.


0

You can add a layer without workspace so you will not be obliged to use a workspace prefix. The wokspace is very usefull when you have layers which will not interact between them. An when you have to name them with the same suffix.


1

To test you can add OpenLayers.Control.PanZoomBar() yourself by code then remove it and re add it by code putting in a javascript event : var control_pan = new OpenLayers.Control.PanZoomBar(); map.addControl(control_pan); map.removeControl(control_pan); But the simplest thing would be a public link to your page.


2

No, you don't need separate vector files for each zoom level. Of course they could speed things a little bit up but will also require much more storage space than using a single database for a specific area. However do note that PBF files are not suited for on-demand rendering. They are designed for efficiently storing OSM data, not for running queries on ...


0

According to the api ol.Map.html#forEachFeatureAtPixel If you put a return statement that should return only one object. In your case: var firstFeatureFound = map.forEachFeatureAtPixel(pixel, function(feature) { return feature; }); el.innerHTML += firstFeatureFound.get('Proj_Client') + '<br>';


0

If you accessing the geoserver url you can try setting up a wms layers in qgis as http://localhost:8080/geoserver/wms? Which gives you access to all wms request in your geoserver config. Setting it to use http://localhost:8080/geoserver/GIS/wms will give you access to wms layers in your. Work space. Save your project with these two layers and open the qgis ...


0

The URL reads the value you entered as the "URI" when you created the workspace in GeoServer (You are accessing your workspace). Depending on the URI you gave to the workspace,the URL changes. The GIS in "GIS:pipelines" is the name of the Store where your layer is contained.Also the Pipelines is the name of the layer. The structure of accessing data in ...


0

You can use a window function over your data : select distinct (ST_Extent(geom) over ())::geometry box from tableName category='airport'; Also since you tagged openlayers take a look at ST_AsGeoJSON you might find it helpful


2

Just use ST_Extent for the sub-query that selects your airports. The only trick is that in PostgreSQL you must use an alias for the subquery. Look at "a" in the following example which gives the aggregated extent of the 5 first geometries of the table. select ST_AsText(ST_Extent(a.geom)) from (select geom from tableName limit 5) as a;


2

You could use St_Envelope on all your airports docs ! ST_Envelope — Returns a geometry representing the bounding box of the supplied geometry.


0

Yes, everything is possible. You have to override the OpenLayers.Filter.Comparison.prototype.evaluate function in a way, that it will test whether this.value is an array and if yes, test whether got contains exp (for the IN case). To make it more clean, you should add your own OpenLayers.Filter.Comparison.IN comparator to the enumerable. See the original ...


0

The label is a SVG text element. I suggest you to make an override for OpenLayers.Renderer.SVG.prototype.drawText function. Open your OpenLayers install package and find it here: lib\OpenLayers\Renderer\SVG.js:649 Take the function and override it in your own code like this: // My drawText override OpenLayers.Renderer.SVG.prototype.drawText = function ...


1

You can easily recreate the functionality with ol.interaction.DragBox. The interaction has a boxend event, which propagates an object with a getGeometry() function. The geometry can be added to a new feature, which can be added to the vector source. The geometry can be logged directly from the boxend event handler, but the source object also has an ...


1

I use Bootstrap (and you can try the excellent BootLeaf template) to build a webpage with a nearly full-screen map. I've also used Bootstrap to build a single-page app with a smallish map. You can also use simply Leaflet, and set up some buttons about the place using the built in controls, or roll your own user interface. To answer your actual question, ...


2

So you want to create a heavy and dated looking panel based map interface? /joking/ Personally I would use Leaflet and JQuery. Both are very lightweight but have a wide range of mature plugins that can deliver what you need in a lightweight and modular way. I don't think Bootstrap will be of much benefit. Map frames are pretty much responsive by default ...


1

I suppose you are running Qgis 2.8.1. The openlayers plugin has nothing to do with the JavaScript library Openlayers 2 or 3 ! Anyway to access this plugin in Qgis, you should go the tab 'Internet' and it shoud be there !


2

From the API docs (http://openlayers.org/en/v3.4.0/apidoc/ol.Map.html?unstable=true#forEachFeatureAtPixel): To stop detection, callback functions can return a truthy value. map.forEachFeatureAtPixel(pixel, function(feature) { el.innerHTML += feature.get('Proj_Client') + '<br>'; return true; });


0

First off, you're already using the debug.js version, so that's good. You're not really doing anything wrong or missing anything. Unfortunately, there were a lot of enhancements in the v3 engine which means you'll have to go digging for the information you want. For instance, the map projection information is no longer found on the map object directly, ...


2

The easy way I use to set up styling is to load your dataset in QGIS and style it with that. Use only simple style features like colour and width and do it on a single attribute. The save that QGIS style as SLD, and copy paste that XML into GeoServer's style dialog. Trouble shoot that a bit to make sure it all came through, and you're good to go! You do ...


0

You can't calculate distances accurately in 3857. (previously known as 900913 or 3785) Well... can't is a strong word, so let's say that it's very difficult and there are easier/faster methods. The way web Mercator projection is designed makes it non-conformal; scale is a function of latitude. To calculate distances accurately, you would first need to ...


0

In what way is the script 'not working' - there's several things people would need to know to help you with the issue: 1) what's the file you're trying to load and is it exactly 100 polygons? 2) Are the polygons relatively small - e.g. 10s of points or are they quite large? 3) What library versions are you using? OL2/3 release versions? 4) Does the JS ...


1

To squeeze out every little bit of your code, you should get rid of the main bottleneck, plus lower the redundancy, like here. The code can run under 200ms, which is very good compared to the original 500ms runtime. The main bottleneck is in the createCircle function. If you don't need every point to be present in a separate layer, you should pull the layer ...


0

I just find out how to do it and is very simple, just set the CQL_FILTER to null: //My var map is previously declared var layerFromMap = map.getLayersByName(input.name)[0]; //If my input is empty then I should delete the filters, like resetting the search if (input.value.length > 0) { layerFromMap.mergeNewParams({ 'CQL_FILTER': input.value }); ...


1

You could try to use the move callback: var my_polygonhandler = OpenLayers.Handler.RegularPolygon; var polygonControl = new OpenLayers.Control.DrawFeature(circles, my_polygonhandler, { handlerOptions: { sides: 40 } }); polygonControl.handler.callbacks.move = function (e) { var linearRing = new ...


1

Just use the OpenLayers.Control.GetFeature: var your_control = new OpenLayers.Control.GetFeature({ protocol: OpenLayers.Protocol.WFS.fromWMSLayer(your_wms_layer), box: true, hover: true, multipleKey: "shiftKey", toggleKey: "ctrlKey" }); ...


3

You need to write a custom control that does that thing. Ive written a tutorial on the topic, so check it out :) http://codentonic.net/2015/04/02/custom-openlayer-control/ if you have any questions feel free to ask me


2

At the moment I still prefer OpenLayers2. You can find a nice tutorial here: http://www.gistutor.com/openlayers/22-advanced-openlayers-tutorials/47-openlayers-wfs-t-using-a-geoserver-hosted-postgis-layer.html or even have a look at the "official" openlayers-example: http://dev.openlayers.org/releases/OpenLayers-2.13/examples/wfs-protocol-transactions.html ...



Top 50 recent answers are included