Tag Info

Hot answers tagged

3

I assume you use an ol.style.Icon. ol.style.Icon has a scale option that you can use to scale the icon image. For example, if you want to scale an image down you'll use something like this: var style = new ol.style.Style({ image: new ol.style.Icon({ url: 'http://example.com/icon.png', scale: 0.5, // … }) }); Now, if you want different ...


3

the unit is Pixel,see http://dev.openlayers.org/releases/OpenLayers-2.12/doc/apidocs/files/OpenLayers/Feature/Vector-js.html {Number} Pixel point radius. 


2

I have a new stack exchange account and don't have a reputation high enough to comment on the "Uncaught TypeError: Failed to execute 'putImageData' on 'CanvasRenderingContext2D': float parameter 3 is non-finite." error. This occurs because you have the lat and the long inputs backwards. map.getView().setCenter(ol.proj.transform([lat, long], 'EPSG:4326', ...


2

We work regularly with tiled layers in our applications and I usually store tiles directly on a dedicated disk which I host as a virtual directory. You can see the tile directory here: http://argeomatica2012.cloudapp.net/SOLIDARIDAD_ortho/ I then add the tiles directly as a XYZ layer to my OpenLayers map like so: layerXYZ = new OpenLayers.Layer.XYZ("XYZ ...


2

You're missing the # at the start of your jQuery id selector, line 119 in your jsfiddle, for your toggle-layers element. A neater solution might be to use the bindTo method between your source layer (vectorLayer) and target element (a checkbox). See http://openlayers.org/en/v3.1.1/examples/bind-input.html as an example


2

If you have moved on to the netCDF Java API it might be interesting for you to try Python as well. I have worked with Java for a while but find Python for number crunching and data analysis more convenient. Geoserver should be able to serve your postGIS data as NetCDF. You can then use Python or Java to generate a Netcdf file that contains the difference in ...


2

Just add the BaseLayer as a RasterLayer. <GDAL_WMS> <!-- Data is subject to term of use detailed at http://code.google.com/intl/nl/apis/maps/terms.html and http://www.google.com/intl/en_ALL/help/terms_maps.html --> <Service name="TMS"> <!-- ...


2

You could also use WMS or even preseeded tiles and just grab the single features you need to edit from wfs. http://dev.openlayers.org/releases/OpenLayers-2.10/examples/getfeature-wfs.html


2

You could run your script, convert the csv and then read the converted data with the OpenLayers.Text-format. But I also think that it's more straightforward to change the way the csv is read if you can't change the csv (on the server side) before you read it with OpenLayers. I just gave it a quick try and it works. I just made a copy of the file "Text.js" ...


2

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


1

These kind of operations aren't supported out of the box in ol3. (maybe in the future). But you can use a library like http://turfjs.org , in this case you'll need https://github.com/Turfjs/turf-within or https://github.com/Turfjs/turf-inside You can use ol.format.GeoJSON to convert from a ol3-geometry and geojson for turf and back.


1

In Firefox you could do a rightclick on the blank tile and choose "open image in New tab" to see if it is displayed outside your app. Apart from that you could try this to see if there is an image load error: OpenLayers.Util.onImageLoadError = function() {console.log("error");};  or use the CSS-Class: .olImageLoadError { /* when OL get's a Error 404 ...


1

And as always predictably happens...... About an hour after I post the question, I end up answering it and finding a solution. It turns out, all I needed to add to my constructor was the following map.maxExtent = new OpenLayers.Bounds(0,0,700000,1300000); This was added just after setting the map projection as follows function init() { map = new ...


1

The following approach works for me to save static maps to png files from a webpage with an embedded OpenLayers2 map (I see no reason why it should not work with OpenLayers3 though). The following code is based on the example given at http://acuriousanimal.com/blog/tag/phantomjs/. I slightly modified it to integrate the code given by user cjoudrey on ...


1

Are you using GeoServer as a backend? You could construct a GetMap request via JavaScript and use a HTML GET request to get that image. I use this same approach to programmatically embed static maps into reports in Ms-Access. EDIT: I use PostgreSQL to store my data, and GeoServer handles the rendering and serving of that data. To embed static maps in ...


1

have you tried to move the graphic to the same folder or a subfolder? or use an absolute adress http://jsfiddle.net/ucrtthya/ and don't forget to load the website with the http protocol, like http://localhost/mymap.html otherwise it could perhaps be a problem if you open the webpage with "file///" and try to load a image with the "http://"-protocol


1

I don't if the reason that you couldn't find anything in the documentation, was because you didn't un-clicked the "Stable only" in the upper right corner of the API documentation. Try this: var _feature; // your feature var _style = _feature.getStyle(); var _imagestyle = _style.getImage(); var rotation = _imagestyle.getRotation(); I haven't testet it, ...


1

Edited: There are several errors in your code, namely: Your style functions uses feature.getGeometry().getType(); This will always return "Point" for a Point geometry. A style function should be something like: var styleFunction1 = function(feature, resolution) { if (feature.get("type")) { return styles1[feature.get("type")]; } ...


1

Yes you can for example use the WMS-Layer from your QGIS-Server in ol3: http://jsfiddle.net/expedio/0woc6xL3/


1

I managed to fix this after some sleep and coffee. Changes below: Changed the strategy to BBOX - I don't think this was preventing the map rendering but I think this setting is preferable as it prevents the whole data set loading. Changed the version from 1.0.0 to 1.1.0 (version 1.0.0 does not automatically reproject different SRS) Changed srsName ...


1

The Openlayers plugin can only deliver the tiles if they are on the server. The maximum zoom level is different for the various maps. While some servers are restricted to a certain zoom level, bing has higher zoom levels only for urban areas. You can get an overwiew of the quality from : http://ant.dev.openstreetmap.org/bingimageanalyzer/ Using the ...


1

well strange thing... what you could check is the featurestate... or just make a copy of the shapefile, delete your sensitiv/confidential data if neccessary ,insert two/three dummy-features and send me the file. Then I could give it a try. here the code: layer_selectable.events.register("loadend",map,function() { ...


1

You could try following: make sure that you don't use your workspace prefix in the geoserver-url http://myserver.de:80/geoserver/wfs instead of something like http://myserver.de:80/geoserver/ah_neu/wfs and add some more parameters like the schema: // version 1.1.1 layer_selectable = new OpenLayers.Layer.Vector("WFS", { strategies : [new ...


1

You could edit your WFS-T Service directly with QGIS for example to see if it's an error of your javascript-application or of geoserver itself. http://docs.qgis.org/2.2/en/docs/user_manual/working_with_ogc/ogc_client_support.html section "WFS and WFS-T Client" ( or in german: "QGIS als OGC Datenclient") In QGIS you could also check which limit is set for ...


1

ok, then I would suggest two steps: Reload Featuretype (in the layers-settings) And right after an insert check the logfile within the Geoserver WebUI. There you should find informations about the wfs insert: (screenshot from geoserver with default logging properties): and one more question: when you used OpenJump did you edit the PostGIS-Layer or ...


1

have you tried to switch to a different WFS-version in your OpenLayers-Code before? var wfsLayer = new OpenLayers.Layer.Vector( "Name", { strategies: [new OpenLayers.Strategy.Fixed()], protocol: new OpenLayers.Protocol.WFS({ version: "1.0.0", url: "http://localhost/geoserver/wfs", featureType: ...


1

The syntax is: Open Table "*<path of table>*" For example Open Table "C:\Temp\table1.TAB" Open Table "D:\GISDATA\points.TAB" etc EDIT or to list open tables in a session use MapBasic: Dim i as integer Dim j as integer Dim TableArray(1) as String ReDim TableArray(i) i = NumTables() For j = 1 to i TableArray(j) = Tableinfo(j, TAB_INFO_NAME) ...


1

You have a typo in the following lines jvg_wms.setVisibility(ture); vaga_wms.setVisibility(ture); building1_wms.setVisibility(ture); ture should be true


1

This comment is an annotation for the Closure Compiler. So if you don't compile your application code with the Closure Compiler then you don't need that comment at all. So you can safely remove the comment (and the brackets around the right-value): var viewResolution = view.getResolution(); Note that you will find such annotations in the official ol3 ...


1

From your syntax, it looks like you are using OpenLayer 2.x The OpenLayers.Layer.WMS does not implement the getDataExtent() method, so you cannot use it to zoom into the Layer Extent. There is nothing inbuilt within OpenLayers that can get the extent of a WMS layer, and hence you'll have to roll your own. In most cases, where you control the layer, you ...



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