3

Neither +proj=igh or +proj=goode are currently supported by proj4.js but mproj does support +proj=goode Demo here https://jsfiddle.net/3bjo7rsL/ and the code below. Error catching is needed to handle "off the world" transforms at the edges. <!DOCTYPE html> <html> <head> <link href="https://cdn.rawgit.com/openlayers/openlayers.github....


3

You can use ol.color.asArray method for that. Fourth element of array is then opacity: var color = myStyle.getFill().getColor(); var colorArray = ol.color.asArray(color); var opacity = colorArray[3]; EDIT: As Mike rightfully pointed out, above code is suitable only for reading opacity. Since asArray() method returns cached color, if we want to change color ...


2

Welcome to SE GIS! Are you a fellow Washingtonian? I suspect that your problem is linked to the data you received. There are a couple of things to consider: Washington state is divided into two State Plane Coordinate System zones: North and South (I'd display an image of that dividing line for you, but I can't find it at the moment). Anyway, that ...


2

Your bounding box is broken, GeoServer is unable to create a polygon from bbox=-Infinity,-Infinity,Infinity,Infinity.


2

Bootstrap elements (popups, dialogs) have their own logic (methods) of showing/hiding. Initially they are hidden, they are then showed by JQuery $(element).modal('show') method, so you have to treat them differently as usual html overlays. Instead of setting html content, you just call $(element).modal('show') method: <div class="modal fade" id="myModal"...


2

The source for the clusterSource must be a vector source, not a layer. i.e. source: random_points.getSource()


2

As long as you are styling unselected features with the layer style you can set a style for selected features as an option for the interaction. But just like a layer style it will not override styles set directly on a feature. selected_feature = new ol.interaction.Select({ condition: ol.events.condition.pointerMove, style: new ol.style.Style({ ...


2

In getting coordinates from features you must first get geometry by getGeometry() and then get coordinates from geometry by getCoordinates(): var coordinates = feature.getGeometry().getCoordinates();


2

style is defined in the code you have provided, so the error may be in the code for getText(feature) which you haven't shown. It is more efficient to define a single style and use a style function to set the text for each feature: var style = new ol.style.Style({ image: new ol.style.Circle({ radius: 7, stroke: new ol.style.Stroke({...


2

Now that you published your GeoJSON, I finally noticed that error lies in the way you are trying to read GeoJSON. You cannot read it when specifying format, you have to use features option for this. Then you don't have to specify format at all: var vectorLayer = new ol.layer.Vector({ source: new ol.source.Vector({ features: (new ol.format.GeoJSON({ ...


2

By default, GeoServer only delivers 10000 features on a WFS GetFeature request. You have configured it to deliver only 50. So you may want to change &maxfeatures=50 to something like &maxfeatures=20000. 20000 is a good setting because it is the maximum that OpenLayers can render smoothly on an average machine when zoomed out.


2

This is not currently possible with the code generated by qgis2web. The code merely opens an iframe whose source is the getFeatureInfo URL. In other words, the client has no knowledge of whether a feature is present or not. A solution could be developed to fetch the getFeatureInfo URL and analyse it, only then displaying the content if an appropriate ...


1

You cannot get the extent from the center and number of pixels alone. These images all have the same center and number of pixels: You also need to know the resolution (the distance on the ground covered by each pixel) and the rotation (was the image taken with north at the top)


1

There's no built in method in OpenLayers, you would need to include a third party library such as turf.js var poly1 = turf.bboxPolygon(bbox1); var poly2 = turf.bboxPolygon(bbox2); var poly3 = turf.bboxPolygon(bbox3); var bbox = turf.bbox(turf.difference(turf.difference(poly1, poly3), poly2));


1

Your matrix is almost certainly not called just 6, if you look in the GetCapabilities response from GeoServer you will see a list of available matrix sets like this: <TileMatrixSetLink> <TileMatrixSet>EPSG:4326</TileMatrixSet> <TileMatrixSetLimits> <TileMatrixLimits> <TileMatrix>EPSG:4326:0</TileMatrix> <...


1

Problem of recursive calls can be solved by introducing clearingInProgress variable, which tells when clear() was called and so loading has to be skipped: var clearingInProgress = false; var source = new ol.source.Vector({ format: new ol.format.GeoJSON(), loader: function() { if (clearingInProgress) { clearingInProgress = false; return; ...


1

The OpenLayers example is scaling to fit a displayed map extent into a paper size. If you want a specific scale on paper the logic will be slightly different. You need to set map size from the paper dimensions and dpi. For A4 portrait at 300dpi the paper pixels therefore the mapsize will be [ 210 * 300 / 25.4, 297 * 300 / 25.4 ] OpenLayers resolutions ...


1

Would a 8-digit hex-code work? See also: https://drafts.csswg.org/css-color/#hex-notation https://css-tricks.com/8-digit-hex-codes Have also a look at this page: https://stackoverflow.com/a/28033076/42659


1

As it turns out, using Turf library instead of JSTS is simpler and works with meters: const format = new GeoJSON(); const features = format.readFeatures(geoInput, { featureProjection: 'EPSG:3857' }); const buffered = turf.buffer(geoInput, 251300, { units: 'meters' });


1

What you have got wrong is CRS specification when reading features from GeoJSON with readFeatures method. This method has two CRS options: dataProjection tells projection of GeoJSON data and featureProjection tells projection of generated features. In your case dataProjection should be 'EPSG:26918' and featureProjection default 'EPSG:3857': var features = ...


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