The Stack Overflow podcast is back! Listen to an interview with our new CEO.

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
0
votes
0answers
26 views

How do I adapt existing responsive web site to display Leaflet maps?

My website works well on different devices but it seems that only works with images, although I would like to show other media, like Leaflet maps and videos. Just about all pages are laid out on a ...
0
votes
0answers
10 views

Link to another URL permalink in Leaflet

I am about to combine more than 1 map. This is kind of sync, but is not particular sync as shown in the following example: https://github.com/jieter/Leaflet.Sync Basically my goal is to get instant ...
0
votes
0answers
21 views

How to create regional map tiles for Leaflet

I would like to create the map tiles in leaflet, which will be used in regional scale. I mean, that once I provide sth like this: L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png?{...
1
vote
1answer
32 views

Get the longest route from collection of polygons

const startPoint = [x,y]; const nodes = [[x,y], [x,y]....]; const polygons = [...]; const createConnectedPath = (startPoint, nodes, polygons) => { // The path should follow the center of each ...
1
vote
0answers
19 views

Keep properties after spatial join

I have two Feature collections: One that includes the location of dams and one that provides the basin area of a river within a country. I want to use gee to obtain a list of dams constructed in a ...
0
votes
0answers
14 views

stratifiedSample in Google Earth Engine: how to return region's attributes?

I am trying to select a random sample of pixels inside ROIs organized in a Feature Collection. I'm achieving what I want, except that ROIs have attributes, that I would like to carry to my output. ...
0
votes
0answers
1k views

OpenLayers 5: XXX.getFeatureInfoUrl is not a function [on hold]

I am trying to add functionality to retrieve feature attribute information for an image layer with OpenLayers 5 and getFeatureInformationUrl (I eventually want to add functionality to retrieve feature ...
1
vote
1answer
16 views

Adding time band as year to NDVI composite

I try to add time band to my NDVI time-series and using this function (took it from developers guide), for regression calculation. It looks like script is working but magnitude of slopes is extremely ...
0
votes
2answers
29 views

Leaflet map with coordinates included in the URL path

I am trying to implement the dynamic coordinates in the URL path in the leaflet map as per the Google Maps example. I found some examples: https://stackoverflow.com/questions/15919227/get-latitude-...
0
votes
2answers
51 views

Changing opacity for KML layer fetched in Leaflet map

Is it possible to change the opacity for the .kml file, that has been attached via leaflet-plugin? Basically the plugin is here: https://github.com/windycom/leaflet-kml but after implementation ...
0
votes
1answer
19 views

Google / Mapbox static maps displaying custom image with certain bounds

I have a process which generates a simple Google Static Map (can also be a MapBox static image as the code is pretty much interchangeable). It's recycled code from a project I found years ago. The ...
1
vote
0answers
16 views

Overlay image in Mapbox gl doesn't work in Chrome

I'm trying to prepare image overlay layer in mapbox gl with city plan as background. It works perfect in Firefox but in Chrome I see only dark grey polygon. I use 4Mb .png file. Firefox Desktop - ok ...
2
votes
1answer
19 views

Image slideshow in leaflet map based on geoJSON layer

To be more precised like previously Image slideshow implementation into Leaflet map I have developed my code in the jsfiddle, which states where the problem is: https://jsfiddle.net/Krukarius/...
1
vote
1answer
24 views

Leaflet Layer Control for Multiple Layers in One Object

I'm reading in a large JSON object that has multiple layers within the same object. The structure is like so: { "type": "FeatureCollection", "name": "AllProgrammedProjects", "crs": { ...
1
vote
0answers
15 views

Google Earth Engine: cumulative iteration of weekly mean anomaly

Using the link here I've managed to calculate a weekly mean anomaly for several regions of interest. I'm hoping to calculate a cumulative mean anomaly, then work out how many consecutive weeks have ...
1
vote
1answer
47 views

Leaflet- How to use time dimension plugin with image overlay

I am very new at Javascript. I am trying to create animation with my monthly soil moisture output (.png format) on OpenStreetMap using the Leaflet package. I could use the time slider plugin to move ...
1
vote
0answers
18 views

2D canvas library for OpenLayers. Drawing custom interactive objects

I am looking for the 2D canvas library like Konva.js that I can use above OpenLayers 5.x. I need to draw shapes with font inside that are interactive - can be dragged over the map to the appropriate ...
2
votes
1answer
74 views

Adding hyperlink for each feature of GeoJSON layer under qgis2web?

I wanted to put a hyperlink for each station of my layer "dots" and I would like thereafter in my web page: to click directly on a station to send me to the concerned page. Indeed, I added a ...
1
vote
0answers
27 views

Google Earth Engine: Error for mapping expression function over feature collection

I'm having an issue when trying to create a function to map over a feature collection. I'm trying to create SST thresholds for several regions where over a certain SST value is 1, under another SST, ...
1
vote
1answer
43 views

Leaflet map GeoJSON placemarks with image slideshow

I am wondering how to create leaflet map where GeoJSON placemarks provide the image slideshow as per the example below: https://docs.mapbox.com/mapbox.js/example/v1.0.0/markers-with-image-slideshow/ ...
0
votes
0answers
16 views

Using requirejs with ArcGIS API for JavaScript v 4 API from CDN?

ArcGIS API for JavaScript Quick Start guides show "all-in-a-single-html" approach which is good for examples. However how about bigger apps? I added comment on older issue (closed) at https://github....
1
vote
1answer
19 views

Exporting Lists from Earth Engine

I am using code from the emapr lab to learn to use LandTrendr to get mean NDVI values per year for a geometry. I am trying to export the generated list from earth engine to Drive. The list only ...
1
vote
0answers
26 views

Creating isometric infographics based on spatial data with extruding polygons based on quantitative values [closed]

I'm creating some maps of county-based statistics through time, and I'm looking for suggestions for moving beyond 2D representations. For reference, I'm using SQL server and QGIS, although I'm happy ...
3
votes
2answers
58 views

Make Leaflet polyline bold by hover?

I have a Leaflet map that I show streets and also there is an unordered list of street names in the same page with map. What I want to do is when mouse cursor hovers on a street name in the list, the ...
1
vote
1answer
51 views

Get the surrounding pixel coordinates from an ee.Geometry.Point?

Not the best example, but say I have an image of Sea Surface Temperature and a point like so: // Load an image of sea surface temperature (SST). var sst = ee.Image('NOAA/AVHRR_Pathfinder_V52_L3/...
1
vote
0answers
37 views

Problem with loading big data (GeoJSON) via PHP

I have a problem with loading (big) data via PHP from a spatial database. I let run this project on a localhost Apache Server. From a data count of about 30.000 edges I get an error VM885:1 Uncaught ...
0
votes
0answers
11 views

Create Geotiff from JPEG or PNG [duplicate]

I'm working on creating maps using Cesium. Now my client needs to export the viewport map to an image. I'm already exporting to PNG/JPEG but now I need to create a GeoTiff. Is there any way to ...
0
votes
1answer
16 views

Mapping over a dictionary in Earth Engine?

Say I have a dictionary in Earth Engine as follows: var dictionary = ee.Dictionary({ key1: null, key2: null, key3: null }); How do I use the map() function to change all the values of each key ...
1
vote
1answer
29 views

Set bar colors on a Google Earth Engine chart

I am trying to define a set of colours by month on a ui.Chart.image.series, however, after adding the .style line, no changes are made. I would like to have a different bar color for each month, the ...
1
vote
0answers
58 views

reduceRegion() not working in Earth Engine?

I have code here that is supposed to take a feature collection of points (defined as "table") and get the values of those points where they intersect imagery from Landsat 5 surface reflectance ...
0
votes
1answer
18 views

How to restrict Leaflet points to general DB rule

I am trying to make a REST call which accepts bounding box lat-lng as body parameters. But unfortunately DB geoPoint restriction is: • Latitude : max/min +90 to -90 • Longitude : max/...
0
votes
0answers
24 views

How to add a vector layers to my map using OpenLayers 3?

I'm trying to add a vector layer manually to my map but i receive this error: Uncaught TypeError: b.attachEvent is not a function the code is : // adding data // Define Geometries var point = new ...
0
votes
1answer
34 views

Map single layer from list in Earth Engine

I'm trying to map an isolated month of imagery reduced with a median reducer in Earth Engine. However, when I try to incorporate code from this approach (also tried using the listOfImages[2] approach ...
1
vote
2answers
36 views

Default Leaflet icon is not showing

I want to use default icon provided by leaflet instead of using something else. But unfortunately i am not seeing anything, not even error. var myIcon = L.icon({ iconUrl: 'my-icon.png', ...
0
votes
0answers
26 views

Google Earth Engine Export chart as JSON

First of all, I am creating two charts, the first one is named “plotNDVI”, and the second one is name “chart”. I have problems with both of the charts in the part of export to drive or to cloud (i ...
1
vote
1answer
57 views

Exporting Time Series Data using Google Earth Engine and JavaScript?

I'm new to the GEE platform. How can I create a time series analysis (vegetation indices) of a particular shape? would like to export in table form var OLI = ('LANDSAT/LC08/C01/T1_RT_TOA'); //...
1
vote
1answer
31 views

OpenLayers: map with popup and marker cluster

I'm trying to create a map with marker cluster and popup using Openlayers 5. I'm be able to show a popup on click as you can see below but when I try to use marker cluster the contents are no longer ...
0
votes
0answers
10 views

OpenLayers 2 how to load overlay a raster image as they are scrolled into view

I am overlaying a raster map over an OSM base with variable opacity here https://www.aeolian.org.uk/mapexample/slider.html. I want this to work over a larger area, so want to load neighbouring raster ...
1
vote
1answer
23 views

Pop up appearing blank after JSON parse?

My aim is to retrieve the attribute list of a WMS layer. The concept is to fetch it as JSON data, then parse it and display it in a pop up. I am using OpenLayers3 with local GeoServer and JavaScript. ...
0
votes
0answers
16 views

jsts , get merged geometries

I am trying to merge two LineStrings using jsts library. I tried with linestring1Geom.union(linestring2Geom).It works but the problem is I want to get LineString as result geometry , but instead I ...
1
vote
0answers
27 views

Create shapefile with images as attributes using JavaScript

I want to make a feature in a react.js web application where I can export/download shapefiles from the dashboard. I have implemented shp-write which takes a GeoJSON input. It is working fine with ...
2
votes
1answer
35 views

Align images with self-defined CRS in Google Earth Engine

I have uploaded a dataset to GEE and I want to align every image in the collection to have the same geographic extent as the first image of this collection. My code so far : var ref_image = ...
0
votes
1answer
50 views

Converting .map() from JavaScript API to Python API?

I wrote this code using the Earth Engine JavaScript API. The code clips the image collection using variable "table," which is a feature collection of about 12,000 points. I get the length of the image ...
0
votes
1answer
24 views

Changing property on Carto VL feature?

I have a map that relates to a table. When the user selects a table row, I would like to highlight the corresponding map feature. This is the only way I found to do it: const siteGeoJSON = ...
0
votes
1answer
28 views

Size Legend for Carto VL

I am trying to construct a legend based on size using Carto VL, and am struggling to implement the solution posed in this Github thread. https://github.com/CartoDB/carto-vl/issues/1260 I built a ...
0
votes
1answer
49 views

Getting attribute list of a particular WMS layer and display it as a popup in OpenLayers3?

I have an OpenLayers3 map with two layers provided from local GeoServer.My requirement is to get the attribute list of one layer and display it as a pop up inside the map window. To achieve this, I ...
0
votes
0answers
19 views

Earth Engine - Create features for every unmasked raster cell

I have a feature collection of my AOI with patches of same soil classes. And I have a raster image with precipitation data with a cell size of 1000 x 1000 m. Now I try to create a feature collection ...
3
votes
0answers
25 views

Calling a function by its name in Earth Engine code-editor

I have a module where I process some raster images according to one of different functions/ statistical models. I am trying to find a way to allow the user to select which function to use. I have ...
0
votes
1answer
29 views

Google Earth Engine: Tasseled Cap Index calculation and extraction of the mean value for each polygon of a shapefile

I have been trying to use a shapefile consisting of bounding boxes of cities in order to extract the mean value of the tasseled cap vegetation index. I inserted the shapefile as a FeatureCollection ...
1
vote
1answer
21 views

OpenLayers map fill full screen?

I have an OpenLayers map with the following css: .map { height: 100%; width: 100%; } However the map does not fill the whole screen, and it stays like this (take a look at the bottom): ...