Tag Info

Hot answers tagged

12

The reasons why it is so slow is you retrieve megabytes of data doing your WFS request. To confirm, open Firebug (Firefox addon debugger) or Chrome and look into Net(work) panel. You will see it's too huge. This data takes time to be process (your "page is unresponsive" syndrom) browser capabilities: you never display more than one thousand of feature in ...


11

What you want to do, is usually called a 'Swipe' tool. There is no inbuilt tool or control for this in OpenLayers, but thankfully, there is an example here: Swipe Control with Google and OSM based on a custom class. You just need to include this JavaScript file in your application. Most Swipe Tools/controls that I have seen online, are based on the ...


9

Mango does it with Leaflet. Check out an example here. Of course you could just save the time to code it yourself and just create the map for free using Mango.


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

From the sounds of it you are trying to put down 1500 vector markers onto an OpenLayers map. Am I right? If this is the case then I would strongly suggest using some other method to display your vector features, as 1500 vectors in an OpenLayers map is a lot and will cause the browser to slow down and even crash altogether. The differences between browsers in ...


7

OpenLayers 2 will stay for a while because of its history: it's the first big Open Source API for mapping. So, people invest a lot and they can't switch: there is no backward compatibility between the two versions. FYI, the 2.13 version is in 2.13 RC2, so it means the official release will land in some weeks. OpenLayers 3 is a rewrite of OpenLayers with a ...


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


6

You must first understand how PyQGIS handles geometry (Geometry Handling) The most important element is the point: QgsPoint(x,y) and a line or a segment of line are composed of two points: QgsGeometry.fromPolyline([QgsPoint(x1,y1),QgsPoint(x2,y2)])); So to construct a line: line_start = QgsPoint(50,50) line_end = QgsPoint(100,150) line = ...


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

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


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

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

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

As stated above, you add an extra ;-separated CQL query for each layer. 1st query aligns to the 1st layer, 2nd to 2nd, etc. So, even if you want the same query on each layer, it'd be something like: https://server.com/geoserver/site/wms?service=WMS&version=1.1.0&request=GetMap ...


4

After further investigation, I've managed to solve the problem. What is causing the problem is that Proj4js will dynamically load any parts it needs rather than immediately loading all of it's scripts. Internet Explorer has most trouble with this, but also Firefox and Chrome show the symptom. IE managed to not be able to use any transformations, even after ...


4

OpenLayers.mobile.js - a mobile focused build --> Includes a subset of the OpenLayers library to serve common mobile web app use cases. This build provides access to OpenStreetMap, Bing, WMS, WFS and vector layers; touch optimized controls; geolocation; vector editing and interaction tools. The examples tagged mobile can use this build. so it ...


4

Please check timeline plugin on GitHub. I am sure it will help you. It contains simple library to create a time related map with Open Layers. It supports cluster strategy (Open Layers.Strategy.Cluster) and time filtering. Currently it supports source data in GeoJSON or GeoRSS format.


4

The label placement algorithm will almost certainly decide not to show both labels as they will overlap. There are various vendor options that you can use to make it less picky about overlaps and clutter but it will end up looking ugly. The better solution is to combine the two properties into one label (this will give you much more control over the way ...


4

I think you should extend your Layer with custom protocol option. var options_proj = { 'internalProjection': new OpenLayers.Projection("EPSG:3857"), 'externalProjection': new OpenLayers.Projection("EPSG:4326") }; new OpenLayers.Format.WKT({ protocol: new OpenLayers.Protocol.HTTP( { url: "kml path", format: new ...


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


4

First of all you have to activate your new key handler : keyHandler.activate(); You may also work a little on your callbacks. You will find a working example based on your code at the following URL : http://www.empreinte-urbaine.eu/mapping/ol_keyboard.html


4

In general, debugging JavaScript code is not as easy as debugging your python code although firebug has made the problem much simpler already. When it comes to js libraries like OpenLayers, first make sure you have the uncompressed version for development. When some error occurs, you can find the source file and the code line the defect originates in ...


4

I would tackle this problem as follows: Write a webservice which returns the latest/current position of the GPS unit as GeoJSON. Have Google/Bing/OSM/whatever as a base layer, in the Leaflet application Have a Vector Layer in the map to show the current point. Every 10 seconds , using JavaScript, I would query the webservice, and get the latest position of ...


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



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