Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [javascript]

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

0
votes
0answers
13 views

How do I get TIFF asset of historical images to my drive?

I have loaded Landsat 4 TOA images. I added a table for my region of interest then I clipped it. Now I want to export the clipped image to my drive. But this error is shown in the task bar whenever I ...
0
votes
2answers
16 views

Updating legend (when active layer is changed) in CARTO VL?

I have made a CARTO VL map that allows the user to update the active layer depending on which groundwater aquifer option is selected. The layers have different Sources, but use the same Viz. For ...
0
votes
1answer
25 views

Integrate JSON file inputs (specifically latlng) in Leaflet with JS

It's my first time using Leaflet and I wanted to simply put two markers based from my inputs. I managed to connect my JSON file with the JavaScript and the only problem I have is how to dynamically ...
0
votes
1answer
20 views

How to access column in CARTO.js histogram dataview

How do I access a certain column in a CARTO source? For instance, I have chart.js reading the ticketcount column using this: var source = new carto.source.SQL('select * from ticketspercounty_copy')...
0
votes
1answer
25 views

Clipping classified image by shapefile in Google Earth Engine

I have classified an image tile, but I cannot clip it along the area shape. How do I do it and get my study area classified and clipped in a TIFF file?
-4
votes
2answers
42 views

Leaflet-JS Not sure what is wrong with my script below

I have posted a screenshot of my index.html and JavaScript file. The problem is that It doesn't display any webmap. the only thing I can see is the head(h1 from my html. Any thoughts on this?
1
vote
0answers
23 views

Watersheds and Catchment delineation in Earth Engine only with included datasets

Is there a possibility to derive Watershed boundaries or catchment areas by using one or more of the integrated data sets in google earth engine? The available data sets are: WWF HydroSHEDS ...
0
votes
2answers
28 views

Changing a markers location at set intervals

I am trying to plot coordinates of a marker using a GeoJSON feature. I am able to plot my points fine but my issue is, when the interval happens the old marker stays on my leaflet map rather than ...
0
votes
0answers
16 views

Is it possible to link different map's cursors in Google Earth Engine?

Is it possible to link different map's cursors in Google Earth Engine? For exemple: var left = ui.Map(); var leftcusor = left.style().set('cursor', 'crosshair') var right = ui.Map(); var ...
0
votes
0answers
22 views

Leaflet WMS layer label disappears on zoom [duplicate]

I am populating a tileWMS layer on my map (also created through Leaflet) through Leaflet from GeoServer which is working fine but the issue I am facing is with visibility of labels. On various zoom ...
3
votes
0answers
41 views

Function fires despite conditional query in leaflet-map

In a map built with Leaflet I created a button to export and download data as geoJSON drawn before by the user with Leaflet.draw. To prevent an empty download, I am querying the existence of data. ...
1
vote
1answer
26 views

OpenLayers: How do I remove a layer based on a value?

In React, I'm using a pagination that returns a certain amount of results on each page. Using the address of these results, I convert them to longitude and latitude using a geo-coder package and set ...
1
vote
1answer
23 views

Earth Engine Cascading selects - redraw/highlight on select

I am trying to create a scenario in Earth Engine where a user has three drop down selects. On each select, the next select will be filtered by spatial intersections of the first select, and the third ...
0
votes
0answers
22 views

ArcGIS JS API vs 4.10 Add Feature Thumbnail to a DIV Template

Hi @Bill Chappell and users, I would like to add add a thumbnail related to each feature on a mapView on click or click on next feature this latter due to features overlapping. My GeoJSON has an ...
1
vote
1answer
66 views

Merge Advanced View Positioning and View Animation functions

I'm trying to merge two functions that are displayed as OL's samples, the Advanced View Positioning and the View Animation. I can successfully change the view with the animation method, but I can't ...
1
vote
1answer
42 views

Different icon of the nearest marker to current location in Leaflet

I'm working with Leaflet and JavaScript for the first time, so I feel a bit lost here. I have an app that displays user's location and a couple of points of interest from a GeoJSON on a map. The ...
-2
votes
0answers
13 views

I need to interpolate or fill missed month (2015-12-01) [closed]

var startDate = ee.Date('2015-01-01'); var endDate = ee.Date('2018-12-31'); var nMonths = ee.Number(endDate.difference(startDate,'month')).round(); var MOD13A2_NDVI = ee.ImageCollection('MODIS/006/...
2
votes
3answers
119 views

I'm trying to add my local GeoJSON files to my Leaflet web page

I'm quite new to JavaScript and I have been trying to add my GeoJSON files to a web page. I can't seem to figure out how to get the GeoJSON to actually load. I've checked it using GeoJson.io and it ...
0
votes
1answer
18 views

Earth Engine - Why can't I add an imageCollection to a ui.Select()?

When I create an ImageCollection, I would like to select the images from a select box, and then load them onto the map when selected. var myImageCollection = ee.ImageCollection("LANDSAT/LC08/C01/...
1
vote
1answer
18 views

Building Docker image including IPython Notebook and EE?

I'm starting to play with EE, already tried a bit of Javascript API. Now trying the Python one. So I found https://github.com/tylere/docker-tmpnb-ee and git cloned it, then from the terminal I did ...
2
votes
0answers
39 views

Adding points to map with Leaflet using .forEach function

Trying to add an array of points to a map with a Leaflet with .forEach. I thought this should work, but alas, it does not: var jsonData = [ { "LNG":-75.16472099534634, "LAT":40....
0
votes
1answer
24 views

Google Earth Engine formaTrend function

So I'm using the formaTrend() function in Google Earth Engine to detect differences in forest cover over time (via long-trend). My question is if there's a paper or an explanation to what exactly ...
0
votes
0answers
27 views

Landsat surface reflectance product and low sun angles

I am trying to find out functional way to map arctic greening in Svalbard, Norway. Area of interest lies in the 78th parallel north. Most of the images during growing season have high cloud cover. I ...
1
vote
1answer
29 views

How can I calculate decibel unit (dB) values for PALSAR in GoogleEarthEngine

I use the yearly Palsar mosaic of the GoogleEarthEngine. In a first step I was able to calculate the HH-HV value and add it as a new Band to my image. But now I would like to transform in a first step ...
3
votes
2answers
53 views

Google Earth Engine IDE alternatives?

I'm starting to play with EE and I jumped right into the online web-based IDE for the Earth Engine JavaScript API (https://developers.google.com/earth-engine/playground). I see there is also a Python ...
-1
votes
0answers
14 views

How to get wms layer name on click. I tried it in different ways but i am not getting. i have 3 wms layers in this way [duplicate]

var tiled = new ol.layer.Tile({ visible : false, source : new ol.source.TileWMS({ url : 'http://192.168.4.229:8080/geoserver/geodata/wms', params : { ...
0
votes
0answers
13 views

How to access MODIS map service from livefeeds.arcgis.com?

How can I access MODIS map service from configurable map viewer ? Here is my code from viewer.js : var token = 'OvKOMsp8IMRZE5E0FbtsmLx-nUMulBrbukj_1w-i_F-Taxpx5wwC3C7ZcufAsOiA-gV-c3-...
2
votes
2answers
81 views

Unexpected token Identifier error - Import OpenLayers

I'm trying to use some OpenLayers libraries in my code, and called him in JavaScript like this: import Map from 'ol/Map.js'; import Overlay from 'ol/Overlay.js'; import View from 'ol/View.js'; ...
1
vote
1answer
46 views

Import from in Openlayers

I'm looking for some examples in OpenLayers to add in my project, and all those examples had something like this in their JavaScript:` import Map from 'ol/Map.js'; import Overlay from 'ol/...
1
vote
0answers
27 views

Earth Engine: Function to generate daily image collection from 3 hourly

I am working with GLDAS-2.1 image collection. I would like to generate a daily image collection with max temperature, min temperature, mean temperature and sum temperature for each day from 3 hourly ...
0
votes
0answers
16 views

Clip linesegment at a polygon boundary using turfjs

Having a linestring and a polygon, Is there a way to clip the linesegment at the boundary of the polygon and retain the shape of the linestring which runs inside the polygon? Example Linestring { ...
-2
votes
2answers
41 views

Keep the zoom level and the Center of the screen view when reloading a web page [closed]

<script> function init(){ var osmAttr = '&copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/"&...
2
votes
1answer
68 views

OpenLayers: prevent map from resizing [closed]

We are using OpenLayers on mobile devices. When ever the keyboard is shown, OpenLayers resizes the map. This gives us performance issues when there are many features on that map. It takes a long time ...
0
votes
0answers
18 views

Converting TopoJSON data to GeoJSON using JavaScript in browser?

There are many articles about how convert GeoJSON to TopoJSON using JavaScript, but I could not find how to convert TopoJSON to GeoJSON in the browser. Response: Using http://d3js.org/topojson.v1....
-2
votes
0answers
32 views

How to set color of Leaflet marker from GeoJSON

How can I change the color of my marker? var geometryArray = JSON.parse(geometry); //Collecting the different types of land use in different layers ...
0
votes
1answer
30 views

How to interpret the red trend map of time series on Google Earth Engine?

I'm starting to play with Google Earth Engine. Following https://docs.google.com/document/d/1mNIRB90jwLuASO1JYas1kuOXCLbOoy1Z4NlV1qIXM10/edit# I managet to put together this https://code.earthengine....
2
votes
1answer
43 views

How to snap to a geojson-vt layer (Vector Tile Layer)?

I'm using geojson-vt to render a large geojson (originated from OSM) file. This file contains all road from a state (extracted with overpass-turbo way[highway="*"]). I'm buinding a domain-specific ...
1
vote
2answers
42 views

Google Earth Engine: Labeling polygons according to their attributes

I went through different websites and GEE Guides to find a way to label polygons. But, I could not find a solution for it. Is there anyone who knows how to label polygons based on their attribute data ...
1
vote
1answer
39 views

Point data extraction and printing as a TABLE

I am working with MODIS-NDVI image collection in Google Earth Engine. Below, you can find a script which is creating a chart of NDVI values over the given period for particular location. I would like ...
1
vote
2answers
54 views

Reloading OpenLayers 5 WMS automatically with new data

I am making a weather application. It is almost finished now, but I just have one problem left. I want a WMS-layer to automatically reload every few seconds. I thought I had the solution, but it seems ...
1
vote
1answer
41 views

Vector layer does not appear with OpenLayers

When I import the vector it simply does not show in the map. I tried with a raster and it worked fine. I tried now with both KML and GeoJSON and the same thing happen, I can see that it loaded in the ...
0
votes
1answer
32 views

Animating layer in OpenLayers4

Is there a way to include animate properties of a vector layer (GeoJSON)? var highlightStyle = new ol.style.Style({ stroke: new ol.style.Stroke({ color: '#fff', width: 1 }), ...
0
votes
0answers
19 views

Openlayers4 ol.layer.Group only gets first item

I am trying to change the opacity of vector layers using one slider but I seem not to get the right logic to loop each item as opposed to just the first. Here is my code so far. Link to full code ...
0
votes
1answer
22 views

How to post marker to Mapbox GL map

I'm following this tutorial about Mapbox GL and flask which has been going great until the step to add markers to the map. I've tried to distill it to make it as simple as possible but it's still not ...
1
vote
1answer
40 views

Leaflet: improve code for show/hide legend icon

I'd like to know how I can improve the code below, making it better and easier to read. The idea is that when the user turns on / off the layer, their representation in the legend is also shown / ...
2
votes
1answer
59 views

Obtain monthly and yearly average values of EVI using MODIS data on Google Earth Engine

I am currently trying to export and obtain rasters of EVI for: Every month of the year across 2000 to 2018 ie. If January has two MODIS EVI images, I would like to take the mean of the images for ...
0
votes
1answer
37 views

Using JavaScript to manipulate the display of GeoJSON on Openlayer4

I am loading a number of geojson data (all polygons) and using 3 sliders, the user should be able to get a polygon displayed based on the slide value. Here is an online example of what I intend to ...
4
votes
0answers
43 views

Fixing buildings that do not appear in 3D using Mapbox gl js?

I'm trying to adopt this Display buildings in 3D example, but I found out that in my city (Minsk, Belarus) some buildings look flat like this: The coordinates of this particular building are 27....
0
votes
1answer
45 views

Failed connection to Earth Engine servers

I'm trying to export a multi-layer image to drive on Earth Engine, but the task fails with the following error: "Error creating or submitting task. Failed to contact Earth Engine servers. Please ...
0
votes
0answers
16 views

Reducing hourly rainfall data to monthly data and printing as a TABLE [duplicate]

I am working with GSMaP image collection (hourly rainfall data) in Google Earth Engine. Below, you can find a script which is calculating and making a chart of sum rainfall in particular location ...