Tag Info

New answers tagged

0

WMS vender parameter means you can append the parameter to the WMS url directly, just like normal WMS parameters.


0

You can either use the getFeaturesByAttribute method, or loop through the layer's features array: for(var f=0;f<layer.features.length;f++) { if(layer.features[f].attributes.someAttribute == 'desiredValue') { selectFeatureControl.select(layer.features[f]); break; } } This assumes you have an active instance of ...


0

Of course. You can get feautures using getFeaturesByAttribute method and redraw them using drawFeature.


0

You need to pass transparent:true parameter in the both of your WMS services. Further more, you'll have to request the WMS Services to provide output in EPSG:3857, since you want to overlay it over OSM. Hence you will add both the services like this: vagar_alla = new OpenLayers.Layer.WMS( "vagar_alla", ...


1

Ok, I have it solved, for future users here was the issue I thought my cross domain was working ok as the browser sent a preflight to the third party server which returned the following [00:13:50.018] OPTIONS http://clixxxxex.ph/kmz/storm-track.KML [HTTP/1.1 200 OK 367ms] In fact, this was just the Preflight Request, Openlayers never issued the GET When ...


1

Your kml works with the OpenLayers KML example like this: var map = new OpenLayers.Map({ div: "map", layers: [ new OpenLayers.Layer.WMS( "WMS", "http://vmap0.tiles.osgeo.org/wms/vmap0", {layers: "basic"} ), new OpenLayers.Layer.Vector("KML", { strategies: [new OpenLayers.Strategy.Fixed()], protocol: new ...


0

Probably the problem is that visibility is false, try changing it like below: var typhoon = new OpenLayers.Layer.Vector("typhoon", { strategies: [new OpenLayers.Strategy.Fixed()], protocol: new OpenLayers.Protocol.HTTP( { url: "http://xxx.ph/kmz/storm-track.KML", //url: "/storm-track.KML", ...


0

I'm guessing I'd have to list the X,Y coordinates of every system in a list with Names. So that when a Name is Entered in a Search Box it moves the map to the listed coordinates. Your idea is correct, you need to take a look this: Search functionality in Openlayers/Geoserver Basically, the demo that would work for you is this (you need to refresh a ...


1

I have tried your kml file on OpenLayers (version 2.13) and the layer can be added to map successfully. So the problem is not from the kml file. I'm not sure about this, but you have defined your layer invisible, do you set the visibility to true explicitly somewhere?


1

There is actually quite detailed documentation about the issue here. Here's some quotes from the site relating to your issue. The LegendPanel will include legends for all the layers in the layerStore it is configured with, unless the layer is configured with displayInLayerSwitcher: false, or a layer record has a hideInLegend field with a value of true. ...


1

It is not possible to do what you want in an elegant and simple way. Since the two services are in different coordinate systems, and with different tile systems, they will not work together. It might be possible to change the map's projections and resolutions, depending on the which service is used as a base-map, but the User Experience when the map's ...


0

Use setLayerIndex instead setLayerZIndex which is a "private" method. Using the setLayerZIndex you simple change the z-index of the DOM elements but not the position of the layer within the map's layer stack. Once you have ordered the layers as you want, you are right using the SelectFeature control passing the desired layer (WFS) where to select features. ...


1

This is caused by the default implementation of OpenLayers.Style.createLiteral: OpenLayers.Style.createLiteral = function(value, context, feature, property) { if (typeof value == "string" && value.indexOf("${") != -1) { value = OpenLayers.String.format(value, context, [feature, property]); value = (isNaN(value) || !value) ? value ...


0

Assume your label value is a number object (if not, convert it to numbers), then you can just use function toFixed(2), and it will convert your numbers to strings with two decimal places. However, in such way all you numbers will be converted to have 2 decimal places, as the number shown in the picture, 0.2 will become 0.20, 2.9 will be 2.90. But of course ...


0

What have you tried and failed to have work? I usually simply set the #map div (or in the case of that above example, a class) to match a CSS rule: #map { width: 100%; } That should make it fill out the container. You might need to explicitly set height as well. I often do this with jQuery so that my map is never too far out of a certain aspect ...


0

Ok, it should be an OpenLayers bug: upgrading from version 2.12 to 2.13 solved this issue for me.


0

I had similar problems a while ago. In my case it were cache problems. Try deleting the tomcat cache (/catalina/work) and the browser cache. You could also try and let geoserver handle the workspaces. url : "http://" + nsClimVar.Constants.SERVER_IP + "/geoserver/wfs",


0

I made it work! Had to add : resolutions: [4891.969809,2445.984905,1222.992452,611.4962262,305.7481131,152.8740565] and to add to z+4 to get to right zoom level. I used this site http://simonmercier.net/blog/?p=88 to get the right resolutions to use.


2

There are several ways you could tackle this. There is a package kriging that does ordinary kriging. There are several methods in the package gstat, package raster has contour function for rasters as well as many other things. The package in itself is very complete. The fields package has a Tps function which could satisfy you: Description: Fits a thin ...


0

When I added WMS version and CRS parameters to the request URL, it worked just fine. Now it looks something like following. var my_layer = new OpenLayers.Layer.WMS("Main Roads", "http://localhost/cgi-bin/mapserv.exe?map=C:/xampp/htdocs/sarisara/example.map&version=1.3.0&CRS=CRS:84", {layers: ['roads'], transparent: true}, ...


0

I found a solution using Douglous Peuker algorithm which can be used to reduce the number of vertices with a tolerance factor and generate a simple linear map while maintaining network topology. PostGIS ST_Simplify function has been implemented on top of this algorithm. There 's also an OpenLayers implementation of this.


0

What is reason behind pink tiles? Related to server response or client side problem? How you provide tiles? If this problem is related to server side error, you can try to produce transparent empty tile for this problem when error occurred (Since part of a layer cannot be produced; in my opinion, this problem is related to server side). If it is related to ...


0

The error is in event.feature attribute, actually there is no object passed when the control triggers the activate event. So the event.feature is undefined in your case. Look at the source code here at line 324.


1

I think there are some problems in your code. Your ModifyFeature control is in a for loop scope, but you add the control to the editingToolBar and then to the map outside the scope of the for loop. The logic in the for loop is also kind of problematic, with that for loop, you are saying: iterate over the created features, and when the feature id matches a ...


1

Updates Java Script var map = new OpenLayers.Map('map', { projection: new OpenLayers.Projection("EPSG:3857"), displayProjection: new OpenLayers.Projection("EPSG:4326"), units: "m" }); var imagery = new OpenLayers.Layer.OSM( "Simple OSM Map"); map.addLayer(imagery); localWMS = new ...


0

The LayerSwitcher control does not have an image. It is a Div with a particular background color. You can override it using CSS. I can use the following CSS to make it red .layersDiv { background-color: red !important; } The plus icon that you see when the control is minimized, is an image. You can replace it, if required. The normal icon is at ...


1

Beware of micro instances. Their performance is not consistent. They may be relatively fast for short periods of time and very slow after it. http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts_micro_instances.html


2

map.setCenter( new OpenLayers.LonLat(1.147, 52.472).transform( new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject() ), 5 ); you're mixing things like above. If Mapserver is serving your Postgis data set in EPSG:3857, you don't need EPSG:4326 in your mapfile. The EPSG:4326, ...


2

Yes, tiling is the right solution to increase performance, but you will need more disk space. In the Open-Source, Mapnik + TileCache or TileStache are the best libraries (in my opinion) to generate tiles. You can serve your tiles with GeoServer, MapServer or GeoDjango. If you dont want to tile, remember that 5000 features its quite a lot to display on a ...


0

I'd strongly recommend that you store data as geometries in whatever database you want to use. Storing KML sounds inefficient. There are a number of products that you could use. I recommend you look at MapDotNet (www.mapdotnet.com). 60 day trial is free, Express (thread limit) is free. See also www.mapsjs.com for examples of HTML5 clients. Disclaimer: ...


2

I suspect an out of memory error: the first application to be accessed will issue a large (how many features are fetched with every layer?) WFS request which completes, but prevents further requests from being carried out successfully. This explains the works-after-restart behaviour as with a restart all JVM memory would be released and then reallocated ...


1

There are a couple of issues with your code. Firstly, the map was not properly initialized. The Url of WMS service, as well as the transparent paramter was incorrect. I have corrected the code. The following works for me: var map, layer; function init(){ var geographic = new OpenLayers.Projection("EPSG:4326"); var mercator = new ...


0

Please try setting "extractStyles: false, e.g. var kml = new OpenLayers.Layer.Vector ('Australia Boundaries',{isBaseLayer:true, protocol: new OpenLayers.Protocol.HTTP ({url: 'kml/australia.kml', format: new OpenLayers.Format.KML({ extractStyles: false, extractAttributes: true})}),projection: new OpenLayers.Projection("EPSG:4326"), strategies: [new ...


1

My solution was go to option server state -> reload and that is all.


1

If you download and install http://geonetwork-opensource.org, you've got all the tools you mentioned above in a single package... Also you might want to have a look at http://geonode.org, which also bundles all of these projects, but adds an easy-to-use interface. For sure, both of these projects fit your usecase perfectly


0

You might be running into an well known Issue: http://hub.qgis.org/issues/6822 Please see this question:How to Digitize Free Satellite Imagery in QGIS?


1

As far as I know rotating text is not possible in OpenLayers. You might be able to implement something yourself if you're familiar with javascript and openlayers code, but I don't think it's easy. It seems like someone has tried this approach, see this ticket. With some luck the code provided there may work.


0

Its the animated zooming that doesn't work, not the Transition effect (transition effect is the 'temporary blurring' of the layer before the tiles of the next zoom level load). I imagine this is just a limitation of Internet Explorer 7. Especially since the dev examples don't do it either. I am fairly sure that it does this effect using transform css ...


4

I think if you were to try and do this with current OpenLayers it would require a lot of fiddling with animations and tweens and all stuff I have never bothered with. However, it looks like the upcoming OpenLayers 3 will be able to do this sort of thing out of the box. Try it out by heading to the OpenLayers 3 Animation Example page and hit the 'Fly to Bern' ...


3

But 'ZoomStatus' isn't even mentioned in the documentation According to http://trac.osgeo.org/openlayers/ticket/3629 it's scheduled for 2.13 (but the current dev version still doesn't feature it). The fact is that it does little more than call map.getZoom() anyway, so you're probably better off implementing a custom handler. Example: Go to ...


0

how about using GeoExt for this: http://api.geoext.org/1.1/examples/zoom-chooser.html


0

OpenLayers.Map is not a constructor is related to the OpenLayers.js file, so this is saying that this file is not located in your script tag (ie. in the HEAD section of your HTML). Also, it could be that <script src="http://openlayers.org/dev/OpenLayers.js"></script> no longer works or there are some problems nowadays with it, this is because ...


0

If you have your WMS Layer in singleTile mode, OpenLayers has a ratio variable describing the ratio of the requested tile size over the screen size. It defaults to 1.5. This means your requested tile is about 1.5 times larger than the area you see on the screen. This might explain your time difference between 1. and 2. Here is an example of how to create ...


0

The solution to reading the geojson as returned from the PostGIS database was to change the Select statement from: var sql = "select st_asgeojson(the_geom), id, area_sqmi "; to var sql = "select st_asgeojson(ST_Force_2D(the_geom)), id, area_sqmi "; and forcing PostGIS to output only 2 dimensions when it returns the geojson.


0

I think I am stuck with the similar problem. I have some raster data saved in the PostGIS Raster table. Now I want to visualize it on my website, which is based on Openlayers. For the vector data, I can use Geoserver since it has a PostGIS Vector datasource function. But I have no idea how to link the Geoserver to the PostGIS raster table. @ Ragi Yaser ...


0

I think this is the very example you are looking for: http://openlayers.org/dev/examples/getfeatureinfo-control.html The example is using GeoServer, but the same applies for MapServer. You may just serve the data as WMS in MapServer, and on client side create a OpenLayers.Layer.WMS layers instead of OpenLayers.Layer.MapServer, then just do as the sample ...


0

if you are using apache for serving your tiles, try to check out Password Protect a Directory with .htaccess. it is all about retricting access to a directory on a web server using .htaccess. http://en.wikipedia.org/wiki/Htaccess A .htaccess (hypertext access) file is a directory-level configuration file supported by several web servers, that allows ...


0

Try running your query again, in firefox with firebug og chrome with Developer tools. Have the console-window open and add some console.log-statements to your success-function: success: function(e){ console.log("responseText: ", e.responseText); var features = geojson.read(e.responseText); console.log("features: ",features); ...


0

I think you need to test a simple example first, something like this: <!DOCTYPE HTML> <html> <head> <title>OpenLayers Demo</title> <style type="text/css"> html, body, #basicMap { width: 100%; height: 100%; margin: 0; } </style> <script ...


1

The "center" variable is never used in your example: var center = new OpenLayers.LonLat(-93.27, 44.98).transform( 'EPSG:4326', 'EPSG:3857' ); Also, Bing maps take position in decimal degrees so try removing the transform from Bing.setCenter(new OpenLayers.LonLat(rec.get('x'),rec.get('y')).transform('EPSG:4326','EPSG:26191'), 9);



Top 50 recent answers are included