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
Make your voice heard. Take the 2019 Developer Survey now

Questions tagged [javascript]

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

1
vote
1answer
30 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
31 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
17 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
10 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
27 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 / ...
1
vote
1answer
42 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
35 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
33 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
22 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
8 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 ...
0
votes
1answer
23 views

Correlating Point Samples and MODIS SST in Google Earth Engine

I've got a dataset of ~60 points that we've taken during a series of oceanographic cruises where we were sampling, among other things, sea surface temperature. I'm interested in comparing these point ...
0
votes
1answer
21 views

Earth Engine Map view disappeared from Code Editor API. How can I bring it back?

This question is about the interface on Google Earth Engine. I have been using it for several days without problem, however just today the map view disappeared. I can still bring up a small inset in ...
0
votes
1answer
44 views

How to overlay a raster using OpenLayers?

Through the example provided by the examples section of the OpenLayers website I was able to replicate the overlay method of an image. But when I try to add a different raster, now present in the ...
0
votes
0answers
18 views

Writing code to add calculated image to display in Google Earth Engine?

I wrote a code for Land Surface Temperature (LST) from Landsat 8 images in google earth engine. I have successfully calculated the following steps, NDVI, fractional vegetation (fv), emissivity (EM), ...
0
votes
0answers
26 views

Merging two MapBox MBTiles files using javascript/typescript in Cordova?

I am using the MapBox-GL-JS API to render maps in a Cordova hybrid app that runs on Android and iOS. I have serving vector tiles locally from the phone working. In my use case, I would like users to ...
1
vote
1answer
38 views

Reducing hourly rainfall data to monthly data for particular period of time and making a timeseries chart

I am working with GSMaP image collection (hourly rainfall data) in Google Earth Engine. I would like to make a script which is calculating and making a chart of sum rainfall in particular location ...
0
votes
1answer
36 views

Reducing hourly data to daily data and making a timeseries chart

I'm using GSMaP image collection in Google Earth Engine. Below you can find a script which helps to reduce hourly data to daily data and extract in point scale. By this using this script I would like ...
0
votes
0answers
28 views

Importing OL5 files in NodeJS

I need to import things from OpenLayers-5 into my NodeJS application so that I can show the WMS-layers I made with GeoServer. It seems that there is no way around NodeJS with Express if I want to ...
1
vote
0answers
27 views

Hiding specific OpenStreetMap basemap tags?

I have been trying to find a way to hide or suppress specific tags on OSM within my .js code. There is just too much information packed into the OSM basemap and it takes away from what is important ...
0
votes
1answer
31 views

Leaflet : Differentiating colors dynamically

Here's what I want to do: Show all features of the GeoJSON file using Leaflets. Connect to the database, in a database there is a table that has an ID column that matches the GeoJSON file feature, ...
1
vote
1answer
82 views

Multiple on-the-fly filtering based on markers' features on leaflet

I would like to filter the markers on my (geojson) layer according to two features: year and type of event, ideally using both filters (year and eventType) as check-boxes without using layerGroup at ...
0
votes
0answers
18 views

Reduce hourly image collection to daily image collection [duplicate]

I'm using GSMaP image collection in Google Earth Engine, which has hourly precipitation data from 2000 to present. My question is how to create an image collection with daily precipitation image? ...
0
votes
1answer
19 views

How to create an array of repeated values on the client side using JavaScript in Google Earth Engine?

I want to do something like: var from = [2,3] var to = Array(from.length).fill(1) image.remap(from,to,0) Of course, I could just assign [1,1] to to, but from is an input of a function and it is not ...
0
votes
0answers
44 views

OL5 functions in JavaScript not working with NodeJS

So I made a weathermap with GeoServer and OpenLayers5. Works fine and all, but NodeJS keeps giving me a hard time. Does anybody know how this really works? Because I need input from the end-user, ...
0
votes
1answer
37 views

Nothing happened when call function remove layer on leaflet

I'm tryng to call function for clear layer. But nothing happened, using this <li class="list-group-item"> Remove All <div class="material-switch pull-right"> <input ...
1
vote
0answers
10 views

OpenLayers store layer in a cookie [migrated]

I'm refactoring the whole code into modules and I'm facing a problem accessing a variable from an iframe. Basically I have a map where you can draw features and when you want to print you click on a ...
2
votes
1answer
41 views

HTTP Basic Auth Failure: Esri JS API

I am unable to prompt the Basic Authorization popup to appear using the Esri JS API with a Secured OGC WMS service. A concise description: Using a basic fetch request, with credentials: "include" ...
1
vote
1answer
66 views

Getting Temperature Data of Given Point Using MODIS LST Data?

I am trying to get MODIS satellite data with Google Earth Engine to find temperature data of given points on a map. I would like to get an array of all the points in an area (every 1km square in ...
-1
votes
0answers
21 views

Potree added point

Is there a way in Potree to have all ploted points (like an array) ? I can get an array when i'm in distance measure, but i can get all point i've in map, like a single point.
0
votes
1answer
20 views

Google Earth Engine: Problem with the updateMask function

I'm trying to use the updateMask function in GEE but I'm not quite sure how to use it in this occasion. So i did a trend analysis with formaTrend() to analyze the loss of forest cover in an area: ...
0
votes
1answer
34 views

Use Google Earth Engine to stack NDVI timeseries layers into one image and export

I would like to export the NDVI with the date in the filename in one image. Now I can only export them respectively. And when I export the NDVI image, it shows the error "Error: Exported bands must ...
0
votes
1answer
18 views

Earth Engine get dates from imageCollection

I try to get all acquisition dates of my ImageCollection in Google Earth Engine Code Editor. var begin = ee.Date.fromYMD(2017,1,1,'Europe/Berlin'); var end = ee.Date.fromYMD(2018,1,1,'Europe/Berlin');...
0
votes
1answer
34 views

Can multiple MapBox vector tile mbtiles be merged just using SQLite?

Is it possible to combine two vector mbtiles files using just SQLite? I noticed this question Joining several raster .mbtiles? but it does not seem to work with vector files. I also came across ...
0
votes
1answer
31 views

Remove rectangles from Leaflet map

I am drawing a Leaflet map. I also want the ability to add the coordinates via a form. How is that done? leaflet map
0
votes
1answer
24 views

Earth Engine export scale interpretation

I'm exporting a Landsat RGB image from Earth Engine. I want to use the full native resolution (30-m pixels) in the output file. However, it seems that using 30 in the scale argument fails to export at ...
0
votes
1answer
30 views

Leaflet + Polymer 2 map loading with distorted tile

I am struggling for some time now to get the leaflet map loaded properly within Polymer 2. I have searched various threads in SO: this, Github: this, this and several other posts, unfortunately still ...
2
votes
1answer
58 views

Leaflet Search: cannot search for Point types

I followed this repository Leaflet Search and I want to combine search box, using polygons, polylines, and point. for polygons and polylines is working fine. But not for points. The property Name ...
0
votes
1answer
50 views

Calculating temperature of given area using MODIS LST data?

I am using Google Earth Engine and the MODIS Land Surface Temperature data to try and calculate the temperature of a square of land. Here is my code so far: var dataset = ee.ImageCollection('MODIS/...
0
votes
1answer
27 views

Missing band in mapping function using Google Earth Engine

I built a function to add a a new band (b1_1) to each image of a image collection and I mapped it. It does seem to work, at least when printing the image collection and inspecting it in the console. ...
0
votes
2answers
76 views

L.Control.Search: Using looping for searching data on Leaflet

Is there a way to find data from different layers and different propertyNames? I have several GeoJSON data files, with different properties. At this moment I can only search one GeoJSON. For looping ...
1
vote
0answers
68 views

Cluster points into evenly numbered groups

I need to take x number of points and equally/spatially divide them into groups. Meaning that if I had 40 points like in the image below and wanted to have 4 groups of points. Each group should have ...
1
vote
1answer
43 views

What prevents reducers from returning values?

I am attempting to calculate tree canopy coverage statistics (count, min, max, mean, median) on a census block level using the GLCF: Landsat Tree Cover Continuous Fields data set. I ran the script and ...
0
votes
0answers
20 views

OpenLayers 4 ruler

I'm refactoring the whole code of the app with modules and I'm having some problem with the Ruler function of OpenLayers 4 now. In the previous code was working OK, but now when I double click on the ...
-1
votes
0answers
39 views

Openlayers 2 to Openlayers 5, extract coordinates

I have a draw-function (Openlayers 5): function drawPolygon() { var polygonLayer = new ol.layer.Vector({title: "Polygon Layer", source: new ol.source.Vector()}); mouseControl = new ol....
1
vote
1answer
51 views

Toggle ArcGIS Online WebMap Layers using Javascript?

I am taking an intro course on webmapping and am having some trouble figuring out how to set up a layer list and toggle layers on/off. I have already preconfigured 2 layers in a WebMap using ArcGIS ...
-1
votes
0answers
41 views

Toggling choropleths and tooltips with Leaflet.js

I've a map showcasing two choropleths, as well as three separate polygons (two of which are related thematically). My objective is to create a functioning toggling tool to 1) select one choropleth at ...
0
votes
1answer
49 views

Google Earth Engine equation

I want to write an equation for fractional vegetation in Google Earth Engine usisng NDVI. My code is; var ndviClip = ndvi.clip(table); Map.addLayer(ndviClip, {min: -1, max: 1, palette: ['FF0000', ...
0
votes
1answer
38 views

Function in OpenLayers 5 JavaScript does not work

I am making a weather application and it is essentially working. (It is my first GIS-application, so I am really glad with that!) It is just still very basic. I made de application with PostGIS, NPM ...
0
votes
1answer
27 views

OpenLayers/Geoserver rendering transformation is failing at the Prime Meridian

I have a layer that represents surface pressure in GeoServer. I am using a rendering transformation SLD to generate the contours. When I try to map it in OpenLayers, the contours show up fine when ...
0
votes
3answers
58 views

Convert a list into ee.FeatureCollection in Google Earth Engine

Starting with this, I have // load var landCover = ee.ImageCollection('MODIS/006/MCD12Q1'); var country = ee.FeatureCollection('USDOS/LSIB_SIMPLE/2017'); // filter // filter on image for 2017 and ...