Tag Info

Hot answers tagged

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

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


3

The first coordinates are in WGS84 longlat degrees EPSG:4326, while the second ones are in Spherical Mercator "metres" , EPSG:3857. This is what you set the display projection to, so no reason to get worried about. In QGIS, with a Openstreetmap background, your points look like this:


3

Welcome to GIS Stackexchange. In general all plugins are installed via Plugins->Manage and Install Plugins. Once the dialog box opens, Just start typing 'OpenLayers' in the search box and you'll see the list available plugins narrow until you can find the one you want. For PostGIS, QGIS 2.2. already comes with PostGIS connectivity capabilities out of ...


2

By nothing appears in the browser you mean the blank page, right? This happens when you didn't close some brackets ), } or missed "," or ";" etc. Your layer Google Streets looks strange, it is like you missed the piece of code, you don't say the type and the bracket { is not closed: //Função de inicialização - google.maps.MapTypeId.ROADMAP (street layer ...


2

For shapefile - simply open shp in QGIS and on the Layer menu -> "Save as", it can save to KML, GML, GeoJSON and many more. For DWG it is a bit harder because it is not open format, you will need some comercial tool to convert it to DXF 2000/2000i/2002 version. Then DXF file you can also open in QGIS (it uses GDAL/OGR behind the scene). For converting DWG ...


2

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


1

Before I come to your question, I'll like to explain something about commercial APIs like Google Maps API or the Bing Maps API. When you use the Google Maps API, you are actually getting 3 different things: Firstly, you are getting a JavaScript Library that you can use in your application or HTML Then you get access to a set of tiles, which are created by ...


1

The documentation for the Bounds constructor says: bounds {Array(Number)} [left, bottom, right, top] So you need to provide these parameters as numbers var bounds = new OpenLayers.Bounds.fromArray([wms.min_x, wms.min_y, wms.max_x, wms.max_y]);


1

I have solved my problem. Perhaps not the best way... The solution was a "singleTile" option for every WMS-Layer. It was set always to true. With "singleTile: false" I solved my problem. Actually my problem with WMS "vector" layers persisted on all zoom levels. It was simply difficult to see this.


1

To display the map, it is necessary to declare the projection of the data, and the projection you want to be displayed. The geojson data seems to be in EPSG:4326, while the OSM map you load is in EPSG:900913. My own osm map starts with map = new OpenLayers.Map ("map", { controls:[ new OpenLayers.Control.Zoomlevel(), ...


1

You would have to use WFS to get the effect you want. Unfortunately, I haven't looked at much version 3 code, but in version 2, you would create client-side default and highlight styles with an icon. You would then add a select control to the layer with "hover" set to true. Hope this gives you some ideas.


1

Is the WMS layer in the same projection as the Google layer? If not, you will have to handle the LayerSwitch event and reproject the overlay to make it align with the different projection. Note that the OpenLayers devs don't recommend mixing base layer projections, but in practice it can be made to work.


1

If I understand correctly what you are looking for is something a bit like what is possible using Google Maps with its user added markers and lines. The reason that Google can do this is that they offer a service costing lots of money - but paid for by advertisers. OSM is different. There are disadvantages - and advantages. The fact that it's a lot harder ...


1

For a simple way to add markers on top of an OSM based map: uMap This lets you add markers, or draw lines or areas on the map. You can import data from a GPX, KML, or GeoJSON file etc. It has a number of different tile layers to choose for the background map. You can share a link to the map if you want, or embed it another webpage. By default, any maps ...


1

That depends on what you want to achieve. How to render your own tiles is described on switch2osm. This step is only necessary if you want to change the style of the tiles. TileMill is another approach for rendering your own tiles, among many many others. If you are instead just interested in adding a custom overlay, then go for Leaflet or OpenLayers. ...


1

It looks like you should publish your PostGIS layer as WFS service using GeoServer. How use OpenLayers.Editor for eding WFS layer see example. All you need is setup editLayer property of OpenLayers.Editor.


1

I tried your code example and it's working for me, I called it openlayers-example.html stuck it in my root folder next to the json1.json file and called it like http://localhost/openlayers-example.html. So you may need to double check that the json file is where you think it is and call it like: url: "http://localhost/json1.json" That said, I think ...


1

You forgot to add the wms_layer_all layer, on the first map: map_1.addLayer(wms_layer_all); //Variável para mudar o ponto central do mapa var map_center = new OpenLayers.LonLat(-120, 34); Then, everything will be ok:


1

I have repaired your code, but first I want to list all the found errors, so that you can avoid them in the future: the init() function is incredibly small so it is not surprising that nothing works: in the above init() function, there is a missing square bracket, on the last line of code. portions of the comments are mixed with the code: ...


1

There are several options here: use GeoServer's REST API to upload the SLD you create and then reference it in the WMS request (as a named style), this is what GXP does (try and edit a style with GeoExplorer and see what XHR traffic goes on) see for instance: https://github.com/boundlessgeo/gxp/blob/master/src/script/plugins/GeoServerStyleWriter.js if your ...


1

The correct code: <!DOCTYPE html> <html lang='en'> <head> <meta charset='utf-8' /> <title>My OpenLayers Map</title> <script type='text/javascript' src='OpenLayers.js'></script> <!-- Chamada a Api Google Maps especificando a versão 3.2 --> <script ...


1

The provided example works if the SelectControl is created with a Layer, not with an array of Layer: var selectControl; selectControl = new OpenLayers.Control.SelectFeature( Selected_Buildings, { clickout: true, toggle: false, multiple: false, hover: false } ); map.addControl(selectControl); selectControl.activate(); Final ...


1

OpenLayers.js: i would recommend you to download the lib and link it to your application server. This way you can have total control over its URL and content. "insecure content" warnings: that happened to me too. In OpenLayers 2.13.1, when you instantiate an OpenLayers.Layer.OSM, it is configured by default for HTTP. From OpenLayers.Layer.OSM doc: url ...



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