Tag Info

Hot answers tagged

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


8

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


7

MapBox doesn't require you to use the MapBox.js API - you can use your customized tiles with OpenLayers easily by using OpenLayers.Layer.XYZ.


7

Keep in mind that WFS is already a service which returns its data format (mixture of OGC standards). GeoJSON and KML are only a data format, you'll have to build the service to return the data. So included with WFS are already advanced filtering capabilities such as temporal filters, spatial filters (intersect, touches, overlaps...) as well as logical and ...


7

Short Answer: No, not directly Long Answer You need to understand that these are two different technologies. a ArcMap Document (.mxd) is a file which tells ArcMap which layers to use and how to render them etc. OpenLayers is a JavaScript Library that is used for creating application which consume Web Services. A .mxd file can only be opened in ArcMap, ...


7

div.olControlScaleLine{ color: white; } div.olControlScaleLine>div{ border-color: white; }


6

You will have to host the openstreet map data on your own server and generate your styled tiles yourself. Look at Mapnik for tiling. MapBox could be a solution that is hosted in the cloud, but it is not free to use (but you can have limited free use and storage).


6

When working with clusters, OpenLayers creates an array of attributes to store the attributes of all features in the cluster. When your points are in a cluster you need to access the array instead of the attribute directly. Example (untested): function onFeatureSelect(event) { var feature = event.feature; var selectedFeature = feature; var text ...


5

After much grepping through the OpenLayers source, I have found it! The problem was not a missing request header, but a missing attribute on the img elements that make up the layer, specifically crossorigin. See MDN for the details of that attribute, and the documentation for OpenStreetMap layers for how to use it with OpenLayers (Update: Here is a little ...


5

What you have found is something in the OpenLayers sand box, which is an environment where OpenLayers contributors can add their own custom layers, controls, etc. Sometimes things created in the sand box work their way through to the core distribution. However, it is simple to take what has been created and add it to your OpenLayers build. First, you need ...


5

Look at the Boundless OpenLayers workshop. It covers a lot of material. The workshop is using GeoServer instead of MapServer, but you can simply change the URL of the example to your MapServer WMS service.


5

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


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


4

Without Looking at your code, I can't say why you can't access your ArcGIS Server 10 layer. But I can access ArcGIS map service layers in my OpenLayers App in the following ways: When the map service is a tiled Mapservice in WebMercator, I can use the following code: layer = new OpenLayers.Layer.XYZ( "ESRI", ...


4

The first "A" in "AJAX" stands for "asynchronous", which means that the application flow continues before the server sends back the response (I think "fire and forget" is a useful analogy). In your example, hiding the mask happens immediately after the request is made (not after it completes). The code you want to execute after the request completes must be ...


4

Maybe this one is a better example, and I'm afraid transformFeature control is not the right tool to do this job because it can only change the geometry of the feature but externalGraphic is a style property, which can only apply to a point feature. And another style property you need to use is rotation. So you have to write your own logic by using ...


4

If you are looking for good global low scale data, check Natural Earth, load it on your GeoServer and style it.


4

AFAIK WMS is not editable in a web client and so with OpenLayers. Maybe you were thinking about the WFS-T protocol which is editable instead. Here's a WFS Transaction Example with OpenLayers.


4

After a feature is selected, it's added to the vector layer's selectedFeatures array (and removed after it's deselected) You can test it in your browser: http://openlayers.org/dev/examples/select-feature.html Draw a polygon Open JS console (i.e. Firebug or Chrome dev tools) Type: var vectorLayer = map.getLayersByName("Vector Layer")[0]; var feature = ...


4

If you want to ZoomTo a specific ZoomLevel , you can use Map.zoomTo like this: map.zoomTo(level); \\where level is an integer, indicating the zoom level If you just want to Zoom out one level, you can use Map.zoomOut like this: map.zoomOut()


4

Here's my suggestions: Try the map as just tiles. Is this slow? If so, use someone else's base map or use GeoWebCache to pre-generate tiles. Then all you should be seeing when loading only tiles is HDD usage and no or very little processing. If you're loading vectors, and that's slow, don't load vectors. Tile the vectors and query the database for ...


4

You are getting this issue, because your GeoJSON data has Z coordinates. By Default, OpenLayer's GeoJSON parser fails when it finds more than two coordinates (i.e X & Y). To solve this issue, you must set the GeoJSON.ignoreExtraDims parameter to true. Here is a sample JSFiddle which shows the code in actions.


4

There's an Open Source project especially to read and write LiDAR (and any other source of pointcloud data) format. This library, called PDAL is located at http://www.pointcloud.org/ I've seen demo using OpenLayers reading data from a PDAL source, but can't locate it anymore. Your best bet would be to ask on the mailing-list over there. Edit Boundless ...


4

A solution could be to initialize OL without controls. var map = new OpenLayers.Map({ controls: [], div: "map_canvas" }); And now you can add your controls with map.addControl(new OpenLayers.Control.PanZoomBar()); Or define controls on initialisation var map = new OpenLayers.Map({ controls: [new OpenLayers.Control.PanZoomBar()], div: ...


4

Here is a complete answer how to show loading mask while doing WMSGetFeatureInfo : Create the loading mask (I've been using ExtJS) var mask = new Ext.LoadMask(Ext.getBody(), {msg:"Retrieving Info"}); Declare The WMSGetFeatureInfo event listener and make it HIDE the mask: infoControl = new OpenLayers.Control.WMSGetFeatureInfo({ url: "xxxxxxx", ...


4

OpenLayers directly read OpenStreetMap vector files (.osm format) and Leaflet can read it with plugin. Osm file contains all the points of the road in order.


4

Is it possible to make the local coordinate system the default for the whole map in one of those map libraries? You surely can. But then the base layer must be in this CRS too, meaning that you wont be able to use OSM from a public source. If not, should the data be converted into the coordinate system of the map (WGS 84) in the database or a ...


4

First of all, I recommend you to read the spec. The biggest pro of WFS is that it is official and standardized way to access vector data. That means when you use WFS, you do not have to reinvent to wheel (e.g. what should happen when two people edit the same feature at the same time?). It is also much easier to share data over WFS than using GeoJSON or KML ...


4

This is an interesting question, and I wanted to investigate the issue. Firstly, with some brief experimentation, I saw that Geoserver does not return any data from the non-rendered region when you use the GetFeatureInfo request on the WMS service. To see if this is expected behavior, I checked the documentation for the GetFeatureInfo request. You can ...


4

You are facing this issue, because you are using the OpenLayers Library that comes with Geoserver. This Library is an 'lite' version of the OpenLayers Library, and should not be used for Custom Applications. It has only those classes which are required by Geoserver's preview function. It does not have the additional classes like those required for the ...



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