Tag Info

Hot answers tagged

9

In addition to the above excellent answers, let me add my own experience. A year and a half ago I decided I wanted to use OpenLayers (OL) in my Master's project and set out to learn it. I have been doing programming and digital map making as part of my work as an archaeologist since the early 1980s, and have been an ArcGIS user for 15 years. I am happy I ...


9

It isn't necessary to learn OpenLayers or Leaflet when you just want to use GeoServer. However, I have a single advice for you: because you already have a working GeoServer, do yourself a favor and go to https://github.com/boundlessgeo/suite/tree/master/geoexplorer. Follow those instructions, build a geoexplorer.war and deploy it to your servlet container. ...


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

I've always successfully used Custom Builds Profiles to create custom OpenLayers Deployments. There is a detailed explanation available here: Custom build Profiles These are the steps I follow: Go through my Code and see which classes I'm using. Basically look for any class which you are using like new OpenLayers.ClassName(). Add these classes to the ...


6

QGIS don't use directly the layers of Bing Maps or Google Maps or Apple (forbidden, licensing issue) but use OpenLayers via Python (with the OpenLayer Plugin). This plugin allows you to add a number of image services (allowed) to your map canvas. You can use them for your work, but if you want to publish the map, you will be bound by the terms of the ...


5

Your generated GeoJSON is valid JSON, no problem. But, it's not valid GeoJson, as you can see here: http://geojsonlint.com/ The problem seems to be that the features-array in your featurecollection contains three features, two with geometry:none and one with just geometry (which is also string-encoded). So, in short: Your OpenLayers-code seems fine, the ...


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


4

The following piece of code allows you to transform your latitude and longitude coordinates from epsg:3857 to epsg:4326 in just one line. Just substitute longitude and latitudine values to LON and LAT in the code. point = new OpenLayers.LonLat(LON,LAT).transform('EPSG:4326', 'EPSG:3857'); In point you'll have an OpenLayers readable point.


4

This is a comparison between multiple tiles and single tile using WMS in OpenLayers: var map = new OpenLayers.Map({ div: "mapDiv", layers: [ new OpenLayers.Layer.WMS( "Single Tile", "http://vmap0.tiles.osgeo.org/wms/vmap0", {layers: "basic"}, {singleTile: true, ratio: 1} ), ...


4

Yes it is possible to do this, and it's a great way to share browsable maps via DVD or USB stick offline. The major drawback is of course each client needs a complete set of tile data (probably running into a few thousand files and several gigabytes depending on the zoom level/area of the map). You need to render the tiles (or copy them off an existing ...


4

In short: openlayer run something like a web browser in the background with the images, and force the position in the web browser to match the one in the gis software (sometimes it doesnt do pretty well). Thats why you can use bing or google images in QGIS.


4

Since your search region is circular, it is perhaps best not to consider it to be a polygon, but as a point with a radius and to use the ST_DWithin() function: ST_DWithin — Returns true if the geometries are within the specified distance of one another. It should save you and the processor a lot of effort.


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

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

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

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



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