Tag Info

Hot answers tagged

7

div.olControlScaleLine{ color: white; } div.olControlScaleLine>div{ border-color: white; }


7

Why use a database? Because it's not necessarily the case, especially with larger datasets, that you can expect to be able to push the entire thing to the client. If you're talking thousands of points, then sure, but for millions of points you probably don't want each and every one represented in RAM on your end users' client. Not everyone has a super fast ...


6

Geoserver is OWS server. That is a server side application that can serve maps using standards like WMS and WFS. Being a bit more precisely WMS serve images that represent maps or layers, WFS serve features, WPS process data using predefined operations, ... Geoserver includes a web admin interface where you can style the layers or preview it. The layer ...


5

Since QGIS 2.4, it is in the "Web" submenu. It was a kind of design decision to move the plugins from the plugin submenu to Raster/Vector/Web submenus. If you updated from QGIS 2.2 you have to update the Plugin too. If you have another installation of QGIS 2.2 in a different folder, you have to reactivate the plugin in QGIS 2.4 after each running of QGIS ...


5

In ol.proj.transform you need to specify the fromProjection before the toProjection, then it should work. As Michael Gentry explains in his answer, another Problem is that you have to specify the longitude (west-east thus x) first and then the latitude (south-north thus y). And a better way to set the center is to get the current view and set the center ...


5

This question was asked on Twitter recently https://twitter.com/RemiBovard/status/525028570780139520 If you follow the answer, at the moment, integrating layer switcher in the core is not the priority but there is an available component at https://github.com/walkermatt/ol3-layerswitcher You can also take a look on "The book of OpenLayers" samples (by ...


5

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


4

First of all, OpenLayers 3 doesn't have a LayerSwitcher control. In OpenLayers 2 however, there is a .olControlLayerSwitcher style which can be animated by JQuery without any further styling options. You can use JQuery's animate function for this task: $(".olControlLayerSwitcher").animate({top: "55px"}); There is no need for the 30px animation, except if ...


4

Aha, I was confused for a while, but now I'm not. Generally, I would expect a buffer in UTM to match up pretty well to a geodetic buffer. Close enough you wouldn't be able to see the difference. But, looking at your map, it looks like you're working in a European city, but you're generating your PostGIS buffer in UTM 18, which is valid in the area of New ...


4

This is a known issue of OpenLayers, there is a known workaround is to add: renderers: ['Canvas', 'VML'] to your vector layer configuration. I have tested it with firebug in your page. With that line added, it works all right. The reason is that the default SVG renderer has a limited coordinates range. For more details please checkout the issue page: ...


4

The problem is in the way you are setting up the Image Layer. You are not providing all the required parameters. You need to provide the correct bounds of the image. You need to find out what the real bounds are in Web Mercator, and use those as well as the image's Size (i.e height and width), while setting up the layer. Please see this example on the ...


4

You can set on the start of openlayers script with: function init(){ var option = { projection: new OpenLayers.Projection("EPSG:3857"), displayProjection: new OpenLayers.Projection("EPSG:4326") }; or in the layer with trasformation extent = new ...


4

The ScaleLine represents the scale of the map on the screen, and hence is intrinsically different from the scale of a printed map. The OSM tileset is built using the Web Mercator projection, and this projection does not maintain scale. This is why you do not get perfect scale. If you want the geodesic scale, you should use the geodesic:true parameter ...


4

It is possible, but you need to have the layer also available as WFS feature type. Then you can do something like http://openlayers.org/dev/examples/wfs-protocol-transactions.html. Note: that example shows editing of a polygon layer, but you can do the same with a point layer. The component used to drag/drop points is OpenLayers.Control.ModifyFeature.


4

You will need to add a new interaction. Assuming that... this.mapRaster = ol.Map This should work this.mapRaster.on('singleclick',function(e){ var iconFeature = new ol.Feature({ geometry: new ol.geom.Point(e.coordinate), }); iconFeature.setStyle(_self.iconStyle); _self.rasterVectorSource.addFeatures([iconFeature]); Make the ...


4

While you will find that Google Maps works without a key, Every official Documentation and sample I can currently access, says that you need to use a Key. The Getting Started page says: All Maps API applications* should load the Maps API using an API key. Using an API key enables you to monitor your application's Maps API usage, and ensures that ...


4

If you do not find any it is not difficult to set up your own. Install Geoserver and you can get geojson out from WFS with requests like ...


4

ThePlacename.com has an api that returns place borders in GeoJSON format: http://theplacename.com/restapi


4

You can either define vector_term as global variable or pass it as argument in loadKMLTMINT function. To pass as parameter the function definition should be function loadKMLTMINT(terminalcode,vector_term) {


4

You can only use a x,y (i,j) coordinate search for GetFeatureInfo requests http://docs.geoserver.org/stable/en/user/services/wms/reference.html#getfeatureinfo However, you may test for interactions with polygons (and many other geometries) using a Web Feature Service (WFS) request. E.g. ...


4

If you use custom objects and properties in your GeoJSON, they are ignored when the object is read using GeoJSON format. You can clearly see this on line 115 of the GeoJSON.js source code. Since the properties are never read in the first place, it is not possible to get them in OpenLayers. There are multiple workarounds to get what you want. You could ...


4

The OpenLayers.Control documentation says: Controls by default are added to the map they are contained within however it is possible to add a control to an external div by passing the div in the options parameter. So you just need to pass the div to the control while initialising it, somewhat like this: var mp=new ...


4

This is not possible with WMS. WFS gives the data itself (READ only), and WFS-T is a transactional extension of WFS that allows you to CREATE/UPDATE/DELETE data through the WFS protocol. In your case, for what you need, you can't use WMS / GetFeatureInfo but you need WFS-T or to use a different approach like JDBC to edit the content of your postgis tables.


4

You can set the base layer by doing: var layers = this.map.getLayers(); layers.insertAt(0, base_layer);


4

For example: let's say you have a 10 megabyte raster/vector file that covers a large area. If you include the file directly into OpenLayers, it will download the entire file to the browser and render whatever part of it the map needs even if it's a small area. What mapserver will do for you is always deliver to the browser a small image of exactly what ...


4

If you have to work with a Google base map, OpenLayers 2 will satisfy your needs. As stated in an OpenLayers 3 issue by @ahocevar, There will be no ol.source.GoogleMaps, unless Google change their policy and allow direct access to their map tiles. Your only chance to use Google wiht OpenLayers 3 is to make a base map without any controls with Google ...


4

The final answer is: your vector data is out of range. There were two problems with your map. The first was, that your dataset contains three coordinate for every point, while OpenLayers 2 can only handle two. To fix this, you have to include an ignoreExtraDims parameter to your format object: format: new OpenLayers.Format.GeoJSON({ ignoreExtraDims: ...


4

There is no method for setting source at api, http://openlayers.org/en/v3.0.0/apidoc/ol.layer.Vector.html. However you can define source; var source = new ol.source.Vector(); and set source at the beginning; var vectorLayer= new ol.layer.Vector({ source: source }); Then you are free to add or remove features to source dynamically by using ...


4

If you look at the picture below, you'll see your Shapefile is actually being displayed on the map. But it's not being projected to your map's reference system. Your Shapefile has EPSG:4326 (as you can see here) and your map has EPSG:900913. So, in your ol_simple.js file, change line: var outProj = new OpenLayers.Projection('EPSG:3857'); by: var ...


4

You probably do both, but mostly on OpenLayers. The GeoServer part is mostly related to styling of layers. OpenLayers is the client, and GeoServer is the server. For basic cases, you load the data into GeoServer (and publish out whatever layers and styling you need), then use OpenLayers in your web page (javascript and HTML). OpenLayers calls GeoServer to ...



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