Tag Info

Hot answers tagged

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


3

You need to use WFS-T, the T standing for transactional, which is what's required to be able to write-back. Both Openlayers and GeoServer support this. This question may help on the script side - WFS-T: changes not saved on an OpenLayers map There's also a sample tutorial here: ...


2

That is a very hard question to answer. OpenLayers 2 has been very successful and it is easy to find examples for just about everything. OpenLayers 3 is a total rewrite and uses the Google Closure toolkit which provides a number of useful services: code compression, event handling, cross browser support, etc. OpenLayers 3 also uses webGL rendering, when it ...


2

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


2

I didn't play with it but I remember seeing Bjørn Sandvik from Thematic Mapping playing with Three.js and WMS. The recipe is available on this blog post.


1

For future seekers of ol knowledge, I found the answer using the SelectControl control, which has a hash of attributes including two booleans that were pertinent to my problem: 'box' and 'multiple'. The docs are here: http://dev.openlayers.org/releases/OpenLayers2.10/doc/apidocs/files/OpenLayers/Control/SelectFeature-js.html#OpenLayers.Control.SelectFeature ...


1

Sure you can. Its as easy as loading the map. See this example: http://dev.openlayers.org/examples/osm-google.html Code: (Place this after the OpenLayers map) var gmap = new OpenLayers.Layer.Google("Google Streets"); map.addLayer(gmap); and load the folowing javascript: <script ...


1

This is covered in THIS answer which asks how to return a tile for a Java Application. You can load a single tile by sending a completely formatted WMS url which includes the bounds that you want. See the answer from iant for more details.


1

If security is not an issue but you only want to load data within the current viewport. You can also look at OpenLayers BBOX strategy.


1

Your problem may come from using WFS 1.1.0 with a coordinate system that has a northing-easting axis order. You can try these solutions: Use WFS 1.0.0 version. You can test that 1.1.0 sends coordinates as northing-easting ...


1

OpenLayers has a GetCentroid function for getting the centre of a polygon if you don't want to bring it in from the database directly: http://dev.openlayers.org/apidocs/files/OpenLayers/Geometry-js.html#OpenLayers.Geometry.getCentroid From there you should just be able to treat the point as a regular point feature. See also this example: ...


1

You need to get the data from the server in geoJSON format. I can get you an example in PHP if you want, but I think there are plenty examples around. Then in Javascript, you can do something like this: $(document).ready(function(){ setInterval(function() { $.get("datasource.php", function (data) { if ( !data.error ) { ...


1

If I understand your question, you want to be able to change a property on all or some of the features (on separate layers) on the map. From the ol.map object, you can get the layergroup property. This will give you access to all the layers on the map, you can then just do something like: var layers = map.get('layergroup').getLayersArray(); for (var i in ...



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