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
20 views

Displaying QGIS's “Map Tips” in OpenLayers?

Still a little new to QGIS and Openlayers. How would you display QGIS's "Map Tips" into OpenLayers? I am currently using QGIS 2.18 and have the latest update in Openlayers. In QGIS, I have created a ...
1
vote
1answer
26 views

Leaflet JS - open popup on button click

New to JavaScript, coming from Python background. Created a custom control and have added buttons inside the _div using a for loop and innerHTML. I want to zoom to and open the popup of a layer of ...
1
vote
0answers
9 views

Changing the Legend Icon color for visual variables?

I am building an Arcgis application with the latest Javascript API. Its a relatively simple sensor management tool. The problem I am facing is with the legend and the way the icons are represented. I ...
1
vote
1answer
29 views

Landsat 8 images black?

I am trying to get cloud-free imagery for a specific region during specific dates. I am very new to GEE, but the script below seems to work. However when I look at the imagery that is then printed on ...
0
votes
1answer
19 views

Get field value: JSON response from feature service

I have JavaScript in work order management software: load("nashorn:mozilla_compat.js"); importPackage(java.util) importPackage(Packages.psdi.server) var ctx = new HashMap(); ctx.put("url","https://...
0
votes
0answers
24 views

Error: Unrecognized argument type to convert to a FeatureCollection: [object Object]

This code works in Earth Engine Code Editor, but it doesn't work in my server-side web app. I get Error: Unrecognized argument type to convert to a FeatureCollection: [object Object] //inputs is ...
0
votes
1answer
40 views

Handling popups with overlapping layers in Leaflet

I have two polygon layers (polygons) that overlap. I've created a leaflet map using qgis2web. The issues is that, if I click on the overlapping area, the popup only shows information for the topmost ...
0
votes
0answers
10 views

Export CSV file from widget without headers for each item

I have edited the eDraw widget from Web AppBuilder for ArcGIS Developer Edition, but am not very familiar with JavaScript. The goal of the widget is for the user to draw points on a map and be able to ...
0
votes
1answer
13 views

Linked popup image in GeoJSON file

Developing the issue solved in this post: Trying to pop up image in GeoJSON file? I would like to have each GeoJSON image thumbnail possible to open in larger window. I was trying to connect with ...
1
vote
0answers
20 views

Display .kml file in Leaflet

I would like to show my .kml file in my leaflet map.~ There is a plugin: https://github.com/windycom/leaflet-kml whixh unfortunately doesn't work. It show only a blank map in the coordinates provided....
0
votes
0answers
34 views

Creating radius map with conditional overlap colors on Google Maps?

Here is what I need to do: Have a webpage with a zoomable map. We currently use google maps api, but willing to try others. I have around 1000 lat/lon points. For each point, I would like to create a ...
0
votes
0answers
13 views

Get time stamps from TileWMS Layer Openlayers

I've got a WMS Layer which contains many different images at different times. I'm able to display in Openlayers the images from a single time period if I specify a "time" parameter in params. I've ...
0
votes
0answers
10 views

Authentication with service account to Google Earth Engine?

We are building an application that uses the Google Earth Engine API. It uses a service account with an editor profile. This generates tokens without problems, but that token is not valid for the GEE ...
1
vote
1answer
23 views

WMTS from GeoServer to OpenLayers is Unknown TILEMATRIX X

I tryed use default WMTS layer with GeoServer source. Code looks like that: var projection = ol.proj.get('EPSG:3857'); var projectionExtent = projection.getExtent(); var size = ol....
1
vote
1answer
21 views

Binding multiple Leaflet image overlays as one

I am planning to put at least ten single image overlays, spread across the country. I have got two so far: var priorycourt = 'Priory_court.PNG', imageBounds = [[52.399892, -1.531154], [52.400837, -1....
2
votes
1answer
39 views

How to write hyperlinks to local files in GeoJSON properties?

I am wondering how to make a hyperlink from GeoJSON file properties to the local drive file. I found two options here: Clickable hyperlink from GeoJSON field in feature this option refers to a whole ....
0
votes
0answers
23 views

WebGL error when switching visualization

I am getting similar WebGL error messages when switching CARTO VL visualizations: [.WebGL-0x59c22054800]RENDER WARNING: there is no texture bound to the unit 0 [.WebGL-0x59c222e5500]RENDER WARNING: ...
-1
votes
0answers
15 views

Counting number of elements in an list in Google Earth Engine?

I have a question about counting the number elements. In Google Earth Engine I tried ee.Reducer.count, but it is not helpful to me. Could anyone can give me some useful suggestion? \\\GEE var a1=ee....
0
votes
0answers
11 views

Filter a feature collection by coordinates in Google Earth Engine?

So I imported a shapefile consisting of 52 points and wrote a "for" loop to get the all the attributes of the shapefile and store it in a feature collection (that is everything up to "var attribute_fc"...
0
votes
0answers
27 views

WMS GetFeatureInfo JSON error

I'm trying to get informations from geoserver with AjaX jQuery of my spatial data at the clicked point using WMS GetFeatureInfo. But I have this ERROR : http://localhost:8082/geoserver/schemas/...
1
vote
1answer
33 views

Google Earth Engine - Using the ee.Reducer.sum() to count the area of diferent classes of a layer (hansen/global_forest_change_2017_v1_5)?

I have use the following function to calculate the area of an area of interest (AOI) of a classification using landsat8 images. this counts the area in square meters of the classification for a given ...
0
votes
0answers
25 views

Leaflet GeoJSON legend with custom icons

I have been developed a legend, details are here: Leaflet GeoJSON map legend Now I am wondering how to take into account my custom icons, set for GeoJSON file. var myIcon = L.icon({ iconUrl: '...
1
vote
0answers
21 views

Filtering the number of pictures per month of a time series in Google Earth Engine

I'm calculating the NDVI of a time series (1 year) of Sentinel-2, but I only want two images per month to calculate that instead of the whole collection of images with less than 75% cloud. //NDVI ...
3
votes
1answer
47 views

Leaflet mouse move to get coordinate

I hope to be able to display the coordinates on the map when the mouse moves, not to use marker. But my code can't run successfully. This is my code: <html lang="en-US" xmlns="http://www.w3.org/...
0
votes
2answers
33 views

Leaflet GeoJSON map legend

I am struggling with creation of the map legend adequate to my GeoJSON stylization. The code looks like below: var geojsonMarkerOptions = { radius: 8, fillColor: "#ff7800", color: "#000", weight: 1, ...
0
votes
0answers
28 views

Tiled WMS server producing no data on Openlayers map?

I've been investigating setting up a server with OpenLayers which will display tiled data from a datacube-ows wms server. At the moment I have an index.html file which initializes the server and a wms....
1
vote
0answers
19 views

Display route and the two markers in Leaflet routing Machine?

How do I make the route and the two markers appear in Leaflet routing Machine? Here is my code: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> ...
0
votes
0answers
34 views

Error when adding single image layer from WMS server

No one question from stackExchange with similliar title works for me. Cause I face another situation. I added WMS layer, and chrome's debuger throws this Group.js?d2e6:207 Uncaught TypeError: layer....
1
vote
1answer
27 views

Leaflet load JSON data

Does my code have problem? Because if I run in Visual Studio, it doesn't show error, but the file didn't load on my map. I put the JSON file and HTML on my desktop. This is my code : ...
1
vote
0answers
14 views

Convert polygon co-ordinates to GeoJSON using JavaScript [closed]

I need to convert the below polygon to a GeoJSON object, "Polygon":"146.90805846452713 -42.942663073539734, 147.01517516374588 -42.87627762556076, 147.15525084733963 -42.745309352874756, 147....
1
vote
0answers
17 views

Create a table from the properties of images and feature collections in Earth Engine?

I am trying to export the metadata properties of feature collections and images and put them into a table. The code I included works fine, but I will eventually need to get all the attributes from a ...
1
vote
1answer
51 views

Leaflet Foreach point in GeoJSON check Distanceto

So I was wondering how I can get the points from the GeoJSON located here. and then for each of them separately check if the distance of Markers is within 5 meters range of these. I have tried but ...
0
votes
0answers
14 views

Performing classification using composite of Sentinel 2 instead Landsat8 in Google Earth Engine?

I am looking fo the equivalent of the following code: // Load the Landsat 8 scaled radiance image collection. var landsatCollection = ee.ImageCollection('LANDSAT/LC08/C01/T1') .filterDate('...
0
votes
0answers
18 views

Getting properties of each feature in feature collection using Google Earth Engine?

I would simply like to get the properties of each feature in a feature collection. For example, in the screenshot, I would like to return the value of "1" from "site." Here is my code: var table = ...
0
votes
1answer
17 views

Adding the selected feature on the map in Google Earth Engine

How can I add the selected county on the map? var states = ee.FeatureCollection("TIGER/2016/States") var counties = ee.FeatureCollection("TIGER/2016/Counties") var statesNames = states....
0
votes
0answers
29 views

Adding JSON layer in Leaflet just like GeoJSON data? [duplicate]

I am trying to add different layers to a leaflet map. Now i really want these layers in order to add features like zoom. With GeoJSON file this was easy but I am not getting a good way to plot array ...
1
vote
0answers
30 views

Load JSON data Problem

Why my file only read data3 popup data? data1 and data2 just popup the data3 data <html lang="en-US" xmlns="http://www.w3.org/1999/xhtml"> <head profile="http://gmpg.org/xfn/11"> &...
0
votes
0answers
25 views

Leaflet load GeoTIFF file from browser [duplicate]

I want to load a GeoTIFF file from a browser using Leaflet. I have created a custom control button that on click loads a file from local computer. fileInput.Change() is the function that is called, ...
0
votes
1answer
38 views

GeoJSON search box for multiple layers

I am wondering how to make the GeoJSON search more efficient. I would like to get the search result from more than 1 layer in GeoJSON. My code is (I attached one of two GeoJSON examples): var test = ...
0
votes
1answer
31 views

Search box for GeoJSON in Leaflet

I have been struggling with adding a search box for GeoJSON stuff, similar to COntrol.geocoder in Leaflet. I used the advice under this post: Adding one search box for multiple GeoJSON polygon layers?...
1
vote
1answer
54 views

Load polygon JSON to Leaflet

I want my JSON data with URL can load on the map, and it is a polygon data. I don't know what the problem with my code. This is my code: <html lang="en-US" xmlns="http://www.w3.org/1999/xhtml">...
1
vote
0answers
18 views

Define layer names in Earth Engine Image export

I'm trying to export an image from Earth Engine but found that each layer in the .tif export is automatically named using the band index. I want the layer names to be set using band name, rather than ...
0
votes
0answers
19 views

Sentinel 2 Image Collection radiometric correction in google earth engine

I would like to know if it is possible to do automatic radiometric normalization for several images in a time series (an image collection i have created) to a single reference. I have found some ...
0
votes
1answer
34 views

Leaflet marker popup link from outside of map dynamically

I am using Leaflet JavaScript library to show some earthquake informations. You can able to see few red circles on map. When you click that red circle it will display few details in popup. I want to ...
1
vote
1answer
23 views

Polyline is not pointing to correct langitude.latitude data in Leaflet [duplicate]

I am trying to add polyline in my existing leaflet map. But unfortunately its not overlapping the correct coordinates. this.testd = [ [26.946345158021394, 45.30658810117468], [31....
0
votes
1answer
43 views

Loading GeoJSON file into map in Leaflet

I put my GeoJSON file on my desktop, I don't know why my file can't load to the map. My code: <html lang="en-US" xmlns="http://www.w3.org/1999/xhtml"> <head profile="http://gmpg.org/xfn/...
0
votes
2answers
28 views

Leaflet GeoJSON popup marker customization

I would like to customize leaflet .bindPoPup geoJSON marker. I found some solutions, although I would like to use my existing one. Basically the operation leads to merge two functions as per below: ...
2
votes
1answer
49 views

Using ui.select for Administrative levels dropdown in Google Earth Engine

How can I use ui.select for Administrative levels dropdown in Google Earth Engine? I would like to use ui.select to first select the state and then select the county. Here is the GEE code: var ...
0
votes
0answers
10 views

Creating subLayers using CARTO JS v4.1.8

I created a simple map with multiple layers using the below code. this.cartoSource = new carto.source.SQL(sql); this.layerStyle = new carto.style.CartoCSS(layerStyle); this.layer = new carto.layer....
0
votes
0answers
38 views

Issues printing OSM basemap using MapFishPrint 3

I'm trying to get the GeoExt MapFishPrintProvider function mentioned in this other post to work. However, the debug tools are writing this message to the console: "Couldn't find a suitable ...