New answers tagged javascript
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 ...
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
...
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 ...
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'...
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: [
{
...
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.
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 ...
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(...
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 ...
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) ...
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 ...
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 ...
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});
0
votes
Adding WMS layer with CQL filter
As mentioned here
adding &CQL_FILTER=YOUR_FIELD='YourValue' would just make it
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 ...
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="...
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.
...
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 ...
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 ...
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 ...
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 ...
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:...
Top 50 recent answers are included
Related Tags
javascript × 3299leaflet × 857
openlayers × 584
openlayers-2 × 406
google-earth-engine × 386
arcgis-javascript-api × 319
geojson × 295
geoserver × 146
html × 143
web-mapping × 132
mapbox × 121
arcgis-server × 115
google-maps × 102
jquery × 93
carto × 92
wms × 83
google-maps-api × 76
json × 71
mapbox-gl-js × 68
coordinate-system × 66
openstreetmap × 65
popup × 62
wfs × 56
polygon × 55
postgis × 47