New answers tagged

0

It seems that the problem emerges from somewhere else. The clone() works fine, also the measure and the removeComponent. But I guess that the code e.g. in Measure.js makes other adjustments while continuing measuring that mess up my geometry. In OpenLayers.Control.Measure in the measurePartial function the geometry is cloned again: geometry = ...


0

The route geometry you get is a encoded polyline. You can create a route from it as follows: // route is ol.geom.LineString var route = new ol.format.Polyline({ factor: 1e6 }).readGeometry(polyline, { dataProjection: 'EPSG:4326', featureProjection: 'EPSG:3857' }); var feature = new ol.Feature(route); feature.setStyle(styles.route); ...


1

Altough I wasn't able to find a bug in the above code... I managed to work it around using another way to load GeoJSON based layers. Another thing, the lat and longs weren't properly ordered in the example given (so that the correspond to positions on Rosario, Argentina)... Below are written correctly. <!DOCTYPE html> <html> <head> ...


2

If you're wanting to display a lot of data, use WMS, which is a rendered image-based system. And then if you still want to have interactivity, you can do that using vectors. Check out this: https://github.com/alexgleith/maps-website/blob/master/stormwater.html#L151 This is a pretty complex example, and it uses leaflet rather than openlayers, but the core ...


0

Try running it without the style: <!doctype html> <html lang="en"> <head> <link rel="stylesheet" href="http://openlayers.org/en/v3.15.1/css/ol.css" type="text/css"> <style> .map { height: 80%; width: 100%; } </style> <script ...


0

I just found your answer. While your solution was that Measure doesn't use the Snapping Control, it seems to me, that in my application this is not true. When I disable the OpenLayers.Control.Snapping, then no snapping occurs. So it is used. The only difference to your application is, that I use the DynamicMeasure.js lib which extends the Measure.js from ...


1

The geojson layer is in EPSG:4326, not 3857. For the center_coord, you should reproject the degree values to EPSG:900913: new OpenLayers.LonLat(lon, lat).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject());


1

The first issue is that in view.jade the Javascript block is not indented over. Everything under and including script(type='text/javascript'). needs to be indented one space. The other issue is that ol.js isn't being imported. In layout.jade the following line must be added: script(type='text/javascript' ...


0

This looks like a projection issue. Your GeoJSON is showing units in degrees longitude and latitude: {"type":"MultiPoint", "coordinates":[[-33.015055,-60.655964],[-32.940781,-60.636731],[-32.917201,-60.683852]] }; The default GeoJSON CRS is a geographic coordinate reference system, using the WGS84 datum, and with longitude and latitude units of ...


0

Alright, problem solved. I'd installed a package called geoserver-geonode. A security "feature" of the package makes it so only layers uploaded through GeoNode can be served up. Since I imported the JSON file through GeoServer's import extension, it was not allowed to be served. So I installed GeoServer and GeoNode packages separately and all is fine. (I ...



Top 50 recent answers are included