New answers tagged

0 votes

Web AppBuilder DE - Use an uploaded shapefile to query

Figured it out myself. Turns out to be simple: the graphics property of the uploaded layer contains every feature with its attributes and geometry. So I can loop through each graphic in the graphics ...
user avatar
  • 331
1 vote

How to snap a graphic to a vector basemap layer

It is not possible to snap to Vector Tile Layers right now. The types of layers you can snap to are defined in the type of the layer property of FeatureSnappingLayerSource: FeatureLayer GraphicsLayer ...
user avatar
  • 11
1 vote
Accepted

How to add image in Mapbox with turf.js grid

This is not really a GIS question but more of a general HTML/JS nature, but anyway, here's how you can solve this. You can read each image that has to be repeated only once, draw it on the canvas and ...
user avatar
  • 16.7k
0 votes

Leaflet Map moves to opened popups when zooming in (React-leaflet)

I found the solution for my Problem Encountred an issue when the user ZoomIn the map drifts towards the popup i set the AutoPan prop to False as i am using react-leaflet and it worked just fine i'...
user avatar
0 votes
Accepted

Copying the system:time_start property from a filtered Image Collection to a Mosaic/Image in GEE

I ended up figuring out my own question, so I'll just leave the solution here: Example Solution // ### IMPORTED GEOMETRY ### var Geom = /* color: #0b4a8b */ /* displayProperties: [ { ...
user avatar
0 votes

Toggle dark mode on and off using on and un in OpenLayers

As mentioned in this answer the problem I had was that I was reassigning the function each time and therefore un was not matching it to the binded signature of the on listener.
user avatar
  • 11
1 vote

Detecting Leaflet layer type (react-Leaflet)?

Since I'm not familiar with React, answer will be for vanilla Leaflet JS. Since Leaflet layers have no property that can be used to detect layer type, one possible solution is, when creating layer, to ...
user avatar
  • 16.7k
0 votes

Copying the system:time_start property from a filtered Image Collection to a Mosaic/Image in GEE

First of all, you shouldn't use getInfo method in this way. . . . var FilteredMosaic = S2_L1C.filterDate(FRST_PRVW_DATE, LAST_PRVW_DATE).mosaic().set("system:time_start", S2_L1C.filterDate(...
user avatar
  • 25.8k
0 votes

Converting GEE Javascript to Python using geemap not working

In your python code you are using a client-side function (for loop) over server-side functions. That's the first error. Also, .lt doesn't work over image collections, only over images. So if you want ...
user avatar
  • 11.7k
1 vote

Change popup content with JavaScript

Define your show_hide() function on global level and then call it with text parameter you want to replace current text with. Code could then look something like this: function show_hide(element, txt) ...
user avatar
  • 16.7k
0 votes
Accepted

How to Map.addLayer() rainfall featureCollection over globe using Google Earth Engine?

Is not a GEE error/lack of data. This dataset hasn't global coverage. From CHIRPS: Rainfall Estimates from Rain Gauge and Satellite Observations CHIRPS Overview Climate Hazards Group InfraRed ...
user avatar
  • 11.7k
0 votes

Pure JavaScript Library for Geometry Operations

As of 2022, for reference on similar questions, there is also the Geometry.js library (first release in 2019) that could fit for some needs, complementary with the nice JSTS library. It is pretty ...
user avatar
  • 1
0 votes

Go to the URL when clicked on Leaflet marker

L.marker use a strict syntax, beware to enclose all options by { and separating comma. new L.marker([1.25,42.3],{win_url: "http://127.0.0.1:8000/mapcamion", icon: iconPanne});
user avatar
0 votes

Adding WMS layer with CQL filter

As mentioned here adding &CQL_FILTER=YOUR_FIELD='YourValue' would just make it
user avatar
0 votes

Exporting an uploaded map from Google Earth Engine to my drive

The error tell you the answer. You use Export.image.toDrive but pass it a FeatureCollection instead of an Image. Try Export.table.toDrive instead: Export.table.toDrive Creates a batch task to export ...
user avatar
  • 51.7k
0 votes

Providing parameters in a URL to select and zoom to a feature on startup

This will read the owner parameter from your url and will flyTo the owner if it exists in your GeoJSON. <!DOCTYPE html> <html lang="en"> <head> <meta charset="...
user avatar
  • 673
3 votes

OpenLayers GeometryCollection styling issue

Problem is that you are referencing global value labelInput.value when defining text label in the style. This causes style to always reflect current value of labelInput.value when styling features. ...
user avatar
  • 16.7k
0 votes
Accepted

Choropleth hover functionality is glitching using Leaflet

Your problems have nothing to do with GIS, it's pure JS stuff. It was pointed out in the answer to your previous question that you used the same style style for both of your choropleth layers. The ...
user avatar
  • 16.7k
0 votes
Accepted

Choropleth layer selection does not work in Leaflet

There are three things that that cause your map not to work as expected: In event processing function change you set new event processing with $("select").change, instead of just checking ...
user avatar
  • 16.7k
2 votes
Accepted

How to get layers name added to OpenLayers map v6.14.1?

Layers in OL do not have names by default, but you can give layer a name by setting some custom layer property, like for example using custom option name: 'My layer name'. Then your code above will ...
user avatar
  • 16.7k
0 votes
Accepted

Polyline from an array of LatLng points - remove/hide polyline segments based on their length in Leaflet

Leaflet (unlike OpenLayers) does not have possibility to separately style individual elements of a single feature. Each feature can have only one style, so to achieve what you want, instead of having ...
user avatar
  • 16.7k
0 votes
Accepted

Multiple sources for SearchFeature in ol-ext

As Mike pointed out, I had to listen to the addfeature event on the respective sources and add the corresponding feature to another dummy source: const searchSource = new ol.source.Vector({ features:...
user avatar

Top 50 recent answers are included