Questions tagged [javascript]

JavaScript is a prototype-based, object-oriented scripting language that is dynamic, weakly typed and has first-class functions.

Filter by
Sorted by
Tagged with
1
vote
0answers
45 views

Create Time Series Chart of NDVI (based on Landsat 5) of a National Park in Germany with Google Earth Engine

So this is my code so far: My Questions: How do I name the title and x-axis and y-axis? It isn´t working with .setOptions({title: 'NDVI Bayrischer Wald Landsat 5 1984 - 2013'}) unfortunately. How do ...
1
vote
0answers
76 views

Why does layerView as returned by view.whenLayerView not have a watch method in it?

It seems to me that the layerView variable used as in this line: view.whenLayerView(layer).then((layerView) => { does not have the watch property so the zooming-to-Romania functionality does not ...
5
votes
2answers
499 views

Google Earth Engine: Javascript API vs. Python API

Google Earth Engine seems to be most commonly used through either the Python API, or the Javascript API on the browser. Trying to decide for one, I have come across this comparison, from a Tyler ...
0
votes
0answers
62 views

Temporally grouped reduction in Earth Engine: confusing behavior

I am trying to create two Image Collections in Earth Engine, each representing monthly composites of Sentinel 1 observations in my ROI. The first contains VV images, the second contains VH images. I'...
0
votes
0answers
19 views

Doing average for image collections changed spatial resolution in GEE

I tried to calculate the averaged map for a satellite product in a month using GEE, but after I exported the result, I found the spatial resolution was changed into 1 lat/lon deg, and the native ...
0
votes
1answer
41 views

How to create an interactive based filter (checkboxes) with multiple layers using Carto VL

I'm relatively new to coding, and have been developing a map using Carto VL and Mapbox. I've found a way to create a filter within a map where users can turn off and on different categories within ...
1
vote
1answer
179 views

Add an incremential number to each feature in a FeatureCollection in GEE

Bit stuck at the moment on this. I need to add an incremental number (1:total length) to each feature in a FeatureCollection in Google Earth Engine. So consider for instance the GAUL dataset as ...
-1
votes
1answer
66 views

Handle large point layer on client side using Leaflet/OpenLayers [closed]

I'm planning to write an web app which will display large amount of point features (approx. 120 000 features, 50mb after data cleanup). Each point will consist of only two values - coordinates and ...
0
votes
0answers
169 views

Looping FeatureCollection and ImageCollection in Google Earth Engine editor

I have an image collection and feature collection. In my image collection, I have filtered the dates and a specific band by this: ''' var imagecollectionL8 = ee.ImageCollection("MODIS/006/MOD11A1&...
0
votes
0answers
30 views

Reduce the height of the selected cesium entity to zero on mouse click in cesium

How do i need to reduce the height of the selected entity to zero on mouse click in cesium. Below is the code which i had tried var handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas); ...
0
votes
0answers
32 views

Adding DWG files to Cesium Globe

I have .dwg files which are not georeferenced. Is there any way to add those to Cesium Globe and extrude?
0
votes
0answers
129 views

Create GeoJSON layer based on remote server request (ArcGIS JS API)

I'm starting with ArcGIS JS API. I'm doing the following POST request to my remote server: esriRequest("php/load_gisdata.php", { method: "post", query: { table: &...
0
votes
1answer
90 views

Coded value domains are not showing in pop-up in JavaScript API webapp

I have a web app that was built with JavaScript API 4.10. One of my layers is a map image layer that includes many sub-layers with some fields that have domains. The issue is that in the pop-up only ...
0
votes
1answer
36 views

How to use feature collection after esri leaflet query.run()?

35 years coding but new to GIS leaflet and Esri.leaflet. Javascript I can do but it is not one my long term primary languages. I am trying to make a query result available for processing after some ...
0
votes
0answers
34 views

CesiumJS:3Dtiles tileset path? (Windows)

I'm trying to load and display my 3D tiles file with CesiumJS on my Window Station and Chrome web browser. Cesium server seems to running fine locally. When I type the 'npm start` command via one ...
1
vote
0answers
34 views

How to add image in OSM with the authorisation key using OpenLayers

I am trying to get a layer from the WMS request but the problem is the URL expects the authorization header. I have tried implementing that I am getting the error. Failed to execute 'createObjectURL' ...
4
votes
1answer
658 views

Understanding tileScale in Earth Engine

In many Earth Engine functions such as Image.reduceRegions or Image.sample, there is an argument called tileScale. The API documentation generally interprets it as: A scaling factor used to reduce ...
1
vote
1answer
46 views

Google Earth Engine Map Layer Incorrect Position

Having read the Google Earth Engine guide 'NDVI, Mapping a Function over a Collection, Quality Mosaicking' (https://developers.google.com/earth-engine/tutorials/tutorial_api_06) I am trying to compute ...
1
vote
0answers
27 views

Filtering pins from arrays with checkboxes and general cleanup

I am new JavaScript but I am looking for a way to use checkboxes to turn on and off sets of pins. The problem I am having is that I want to find the intersection of two arrays and pull the ...
1
vote
0answers
113 views

Get daily mean of AOD from MCD19A2 in GEE

I tried to get daily mean of AOD from MCD19A2 in GEE, but my mean function always returns zero. // function to add date to image collection from system:time_start var writeDate = function(image){ ...
0
votes
1answer
68 views

Generate a JSON instead of an image for the legend with OpenLayers

I'm not clear on how I can pass the params to getLegendUrl. My aim is to obtain the JSON and for this scope I use the code below: var graphicUrl = wmsSource.getLegendUrl( resolution, 'params'...
0
votes
1answer
180 views

Is there a way to make FeatureGroup or LayerGroup un-clickable in Leaflet?

I have a FeatureGroup that serves as a container for imageOverlays. Normally a popup opens when one of the image overlays is clicked. Now at some times I don't want this to happen, and I can't figure ...
0
votes
1answer
82 views

ArcGIS JS API - time series with heatmap

I am trying to create a time series of covid data moving across the globe. For now, I'm trying to use a heatmap to do it. Using this COVID19_Time_Series_Combined (which pulls data from here), I ...
1
vote
0answers
33 views

Iterating over features in Google Earth Engine

I am using the Zonal Time Series plotter from the LandTrendr scripts to plot an NDVI time series for a geometry. I would like to modify the script to be able to loop through objects in a table, ...
1
vote
0answers
144 views

Chirps Monthly mean Data for multiple points or region using GEE

Using the this Code (https://code.earthengine.google.com/3491eb14052114811c048687b7885bf7) I am trying to obtain monthly mean time series of precipitation data (chirps) of multiple location. I have 2 ...
0
votes
1answer
83 views

Using Himawari 8 in Leaflet.js from NASA GIBS

I'm currently developing a Leaflet based map webpage and want to display satellite imagery, specifically from the Himawari 8 satellite. NASA have the GIBS api which appears perfect for my purposes. ...
1
vote
1answer
39 views

Extract training data with correspond to a reference image

While extracting the pixel values from a given image, the following technique works, with given geometries (feature collection fc). var training = image.sampleRegions({ collection: fc, properties: ...
0
votes
1answer
136 views

Google Earth Engine ui.Select callback fires recursively

I'm attempting to adapt the GEE community tutorial for creating interactive selection areas for analysis, tutorial here. I want to adapt the code to use a dropdown menu via ui.select to turn on and ...
0
votes
0answers
12 views

How to get the maximum value of NDVI in GEE?for anther way but reduceRegion()

sorry,I tried to use this method to get the maximum value of NDVI, but all years are -1 to 1, which is obviously wrong. Is there another way? var dict1 = cdl_image.reduceRegion({ reducer: ...
1
vote
0answers
58 views

Anomaly Detection using CHIRPS in GEE

Using the following script, I am trying to do precipitation anomaly detection but I am not able to figure out what is the actual monthly average based on which the anomalies are plotted for the given ...
1
vote
0answers
32 views

Problem with overlaying polygons onto DEM with qgis2threejs plugin

I am trying to export a scene using qgis2threejs, adding a polygon layer overlay on top of a DEM and a satellite image. After exporting, it looks like the polygons don't overlay onto the DEM correctly....
1
vote
1answer
35 views

Get all the Tile layers added to the map using OpenLayers?

I want to get all the Tile layers which are added in the base_map. When I am using map.getLayers() I get the list in the array_. How can I identify all the charts and remove the individual charts. ...
1
vote
2answers
113 views

Request Multiple WMS for Raster Calculations in Leaflet JS

I need to display in leafletJS a Layer that is the difference of two rasters received from a regular WMS. With the help of this repo I figured out how to manipulate the values of a raster tile in ...
4
votes
1answer
108 views

Math formula to calculate GPS location for weighted GPS data points

I'm working to improve the location and accuracy of a map / data-point driven application. I have a collection of locations of interest. Each location of interest has a collection of data points that ...
0
votes
0answers
57 views

How to import H3 Spatial Index modules into NodeJS App

I am trying to load a module called 'geojson2h3' in my NodeJS app. After running npm install geojson2h3, I tried following the initial code instructions given in Github to test it out: import ...
0
votes
0answers
66 views

Aggregate daily to monthly values for each pixel in google earth engine

I have an ImageCollection which is daily resolution for multiple years. For each year and month, I want to sum the pr band in the ee.ImageCollection such that I have a monthly value instead of daily. /...
0
votes
0answers
14 views

How calculate distance of two points (between my location and previously my location) in JavaScript?

I am using JavaScript and geolocalisation but I want to calculate the distance between my previous location and new location. How can I do this?
1
vote
1answer
159 views

Function with map.addLayer() and map.removeLayer() not working

I am trying to create buttons that add and remove layer groups and I am not having any luck. Can you take a look at how I have this set up? var main = L.tileLayer('https://api.mapbox.com/styles/v1/...
0
votes
0answers
15 views

Checking location in which polygon

I have KML file for country polygon. I can read the KML file in PHP and see all boundaries. What I want now is when I put a marker on point showing me the title of the polygon. Does anyone have any ...
1
vote
1answer
78 views

Getting .argmax() in a list appended to an image collection: Google Earth Engine

I have appended a list of elevation data to a filtered image collection in GEE as metadata. I now want to find the position of which elevation (e.g. 25 meters) has the highest pixel count using ....
1
vote
0answers
114 views

Removing multiple layers in OpenLayers

I have created a project where I need to add and remove multiple layers in OpenLayers. The layers are from shapefiles that are available on a node server. I loop trough a list of all the names of the ...
0
votes
1answer
40 views

Use if statement to judge in the Earth Engine

I hope to calculate such a formula through GEE: But I don’t know how to write judgment statements and load this in GEE, Hope you can point out the error. Here is my code: var getcsi = function (image)...
0
votes
0answers
9 views

Amcharts4, map chart with bả

I am having a small problem, hope everyone will help me! I want to create a map with a bar chart like in the demo of Amcharts 4 there is a map example with a pie chart. I don't know how to do so.this ...
1
vote
1answer
166 views

addControl give a problem with ol.control.FullScreen

I'm experiment some customizations of OpenLayers, when I try to use map.addControl with ol.control.FullScreen I see this error message: Uncaught TypeError: t.element.setMap is not a function This ...
0
votes
1answer
379 views

Applying less than and greater than threshold in image segmentation in Google Earth Engine

I am trying to segment the images based on the threshold values. For instance, I want to put a threshold range between > 800 and < 1200, but with my existing code in Google Earth Engine, I can ...
1
vote
0answers
34 views

Cubic interpolation

I have an image, originally at 1000m resolution (lonlat projection). I want to warp it using cubic splines or cubic interpolation and download an image at 100m resolution (with same projection). How ...
0
votes
1answer
142 views

Leaflet kmz stops loading other kmz files if gets XHR 404 while fetching remote file in any one of kmz's

Referring to https://github.com/Raruto/leaflet-kmz Here is my leafllet kmz code: <script> var map = L.map('map', { preferCanvas: true // recommended when loading large layers. }); map....
0
votes
0answers
61 views

Building an offline tile server for ESRI World Imagery

I have a JavaScript and Leaflet project which serves users OSM and ESRI maps offline. I have 2 map layers. I successfully built the OSM part with switch2osm tutorial. But I couldn't find the similar ...
0
votes
1answer
39 views

Making Images in Collection Binary Based on Threshold

I am trying to make every image in a collection into a binary image based on whether it's band's pixel value is higher or lower than a certain threshold. For instance, if an image's pixel in a ...
1
vote
2answers
131 views

Removing individual Leaflet markers added through L.geoJSON

I'd like to click on a button in a sidebar outside a Leaflet map and remove a marker associated with that button. But when I bulk add data through L.geoJSON, the function appears to not create ...

1
3 4
5
6 7
63