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
1answer
8 views

Change opacity of the layer with range slider

I want to change the opacity of the layer with a range slider (input type="range") when scrolling here is my layer code in main.js: const UnTiled = new ol.layer.Image({ opacity:0....
0
votes
0answers
9 views

Cannot read property 'addLayer' of undefined in svelte

below is my code. I am using leaflet in svelte to plot a map with image. <script> import { onMount } from 'svelte'; import L from 'leaflet'; var map; onMount(() => { map = L.map('...
1
vote
0answers
33 views

Showing different popups for different layers?

I have multiple layers that have different pieces of information. I have radio buttons for selecting layers and when layers selected I want to show different popups which different information for ...
1
vote
1answer
27 views

Fetch point data from image WMS

Based on the previous questions I asked, I got a way to fetch the clicked point information, but I want the exact value of gray_index, but as you can see the answer is text or HTML. In the image below,...
0
votes
0answers
20 views

Zoom on a tileset area in CesiumJS

I work on Windows and Cesium 1.72. NodeJS and Cesium work well. I succeed in loading / displaying a tileset format3D tiles (Meshs + associated texture). However, I want once the tileset shows up that ...
0
votes
1answer
17 views

Coord parameter not working in GeoServer SQL view WFS request

I try to use coords from two points collected in a JS file in order to send them to a WFS Geoserver request, connected to a SQL view which will create a buffer around the line composed of those two ...
0
votes
0answers
20 views

Random coordinates need to move little right

I have amcharts map which shows circle on it. I have few records(nearly 200) which do not have locations. These records(circle) I am showing in the map in Sea so that those records clearly will be ...
0
votes
0answers
14 views

Adding multiple checkbox value into JSON array if am having dynamic number of checkbox list [closed]

I have a multiple checkboxes like <div id="checkboxList"> <div><input type="checkbox" value="1" class="myChk"> Value 1</div> <div&...
0
votes
0answers
10 views

vue.js base wont load in while loading OpenLayers map

While using OpenLayers library in vue.js the map won't load. It isn't showing any error but only zoom in, zoom out and OSM atrribution is showing. <template> <div ref="map-root"&...
0
votes
0answers
36 views

How to get values to create world file

I have troubles to get the value of the word file. I know, the world file includes 6 points. A, B, C, D, E, F. I have tried to take a ArcGIS doucument as a reference, however, it does not fit the ...
1
vote
0answers
44 views

Get pixel value of ImageWMS that has geotiff format [closed]

I have layer (ImageWMS that has GeoTIFF format) and also OSM or another for my baselayer. According to https://openlayers.org/en/latest/examples/disable-image-smoothing.html I should get pixel[0] and ...
0
votes
0answers
38 views

Fetching JSON data from URL

Here is my code and (console.log(feature)) gives me URL that has data in console. How can I fetch data and use it as var? map.on('singleclick', function(evt) { var view = map.getView(); var ...
0
votes
0answers
31 views

Showing raster map pixel's information(pixel value) when clicked on the map in OpenLayers? [duplicate]

Here is my raster map code and I want see pixel information like pixel value from it when I click on the map: const UnTiled = new ol.layer.Image({ opacity:0.9, source: new ol.source.ImageWMS({ ...
0
votes
1answer
21 views

Coordinate values ​are not displayed correctly in OpenLayers

I'm trying to display coordinates of map click event. I do not think the coordinates are displayed correctly. The two numbers shown to me are (3889586.1245487547, 6296722.285457358). Where do you ...
0
votes
0answers
28 views

Uncaught TypeError: map.getLonLatFromViewPortPx is not a function

I have write the following code for showing coordinates of map but I getting this error: Uncaught TypeError: map.getLonLatFromViewPortPx is not a function Here is my code : map.on('click',function(e)...
1
vote
0answers
20 views

Web GIS with NetCDF data

I have NetCDF data and am trying to transform this into JSON, using Python, to then use in a web sig (NCWMS server). By transforming this into JSON, could I display this same data dynamically (with ...
0
votes
0answers
27 views

Loop through coordinates, adding a marker to the map for each using HERE maps

I am trying to add a number of markers to my map, using HERE maps API. I have my coordinates in a list, and there are 30+ pairs. var coords = [[60.1697768639186, 24.82923586371288], [60....
0
votes
0answers
16 views

How can I extract each value of a column from a Feature Collection and append it to a new list in Google Earth Engine?

I want to map a function over a Feature Collection to extract some column values and turn it into a list. I do know how to map a function over collections, but I'm new with Google Earth Engine and I ...
1
vote
1answer
36 views

Adding labels after meeting a zoom threshold in Leaflet

I'm making a map in Leaflet and I have up to two labels per marker: var redIcon = new L.Icon({ iconUrl: 'https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-red....
-1
votes
0answers
17 views

Google Maps geocoder returning letters/strings, not coordinates

I would expect this code to return geographic coordinates when I input an address. geocoder.geocode( { 'address': address }, function(results, status) { if (status == google.maps....
0
votes
0answers
21 views

SVG tile interactivity with vue leaflet

I am not being able to extract or interact with the svg tiles data on mouse hover/click using leaflet. I have a tile server that serves svg tiles eg:https://sometileserver.com/roads/{z}/{x}/{y}.svg, ...
0
votes
1answer
22 views

How can I extract only Polygons from Google Earth Engine's Feature Collection?

I have here a shapefile which contains some limits of productive areas from the company I work for. When I open it with ArcMap it seems there are only polygons, and indeed the source tab from layer ...
0
votes
1answer
32 views

Google Earth Engine: memory error when calculating monthly average precipitation for a small region using GLDAS data

I am trying to calculate the total monthly precipitation rate using the Rainf_f_tavg band of the GLDAS-2.1 image collection on Google Earth Engine (https://developers.google.com/earth-engine/datasets/...
0
votes
1answer
36 views

Adjust pop up container in Leaflet

I have a problem wit my current project. When I export my QGIS Project via qgis2web there is a strange behaviour of the map pop ups which are not fitting the content. It sometimes cuts the container ...
0
votes
0answers
33 views

Merging Image Collections and Land Classification using Google Earth Engine

I ultimately would like to look at multiple parameters on a landscape to identify suitable habitat for a squirrel species. The parameters I would like to look at are 1) NDVI 2) Elevation 3) Impervious ...
1
vote
1answer
18 views

MapBox GL - filtering GeoJSON by feature index

I'm using MapBOX GL JS with GeoJSON data source. The content of the GeoJSON is changing dynamically. It is a FeatureCollection which contains polygons. I would like to update my MapBox data source ...
0
votes
1answer
35 views

Reading KML Simple Data to a popup in Open Layers

I have created a pop up for markers read from a KML file, however The KML file data is not being read and I assume due to it being in a <SimpleData> tag and in a <name> tag How would I be ...
3
votes
1answer
37 views

Filter list of objects by object property in GEE

I am currently trying to do a grouped reduction, but I am having trouble manipulating the outputs. The code calculates areas per land cover type and outputs a list of objects with two properties, '...
1
vote
1answer
35 views

Parsing Geopackage (gpkg) file in JavaScript into array

I am a beginner with GIS. I have the following code that is successfully creating and displaying a map: <div id="map" style="width: 1000px; height: 700px"></div> <...
1
vote
1answer
23 views

Resetting a marker Style after another marker has been clicked

Is there a way to reset a markers colour after clicking off of it. I am trying to make the markers colour change once clicked on and then update the infobox to the name of the train station and zoom ...
0
votes
1answer
38 views

Leaflet: Error when showing marker name within an info box/popup from GeoJSON data

I am trying to make it so when you click on the marker you get a popup with the name of the station within wales. Live working of my code: https://ces-web2.southwales.ac.uk/students/18018815/mitchtut/...
0
votes
0answers
13 views

Google Earth Engine: error using uploaded shapefile to subset MODIS image collection

I am trying to run the following script to calculate the mean vegetation condition index (based on MODIS NDVI data) for a single district in Ukraine (Tokmatskyi). I imported the shapefile for this ...
1
vote
1answer
46 views

Showing different markers on hover

I have a list of links and withing the links I have data attributes for lat and lon. <a href="#" data-lat="23.232322" data-lon="-97.2466634"> <a href="#&...
3
votes
1answer
61 views

Classifying an image based on the EVI values of vegetation

I am very new at GEE, and I’m trying to classify an image based on the EVI range of various vegetation classes. For example, Bamboo may have a minimum threshold of 0.6712 and maximum of 0.776 EVI. ...
1
vote
2answers
53 views

Clustering Markers from a KML file within openlayers

Is there a way to cluster markers within openlayers as there is within leaflet. I have many markers which display the various listed buildings within wales and I am wondering if I am able to cluster ...
-1
votes
1answer
20 views

Google Earth Engine - error in function to plot seasonal vegetation index for a region using MODIS data

I am trying to create a function to calculate the average Vegetation Condition Index ((mean NDVI of individual year)-(min NDVI from full period)) / ((max NDVI from full period) - (min NDVI from full ...
0
votes
0answers
22 views

Stopping default deselect on click of map OpenLayers

I am trying to create a box selection where I don't want to unselect until I click on an action button. Right now its getting unselected as soon as I click somewhere on points or anywhere on the map. ...
1
vote
1answer
42 views

Changing the colour of a GeoJSON polygon if user location is within it in Leaflet

I am wondering if there is a way to change the colour of a polygon got from a geojson file only if the users/browser location is within that polygon if so is there any example or working code that ...
1
vote
1answer
36 views

Google Earth Engine: calculating and plotting monthly average NDVI for a region from MODIS data

I am trying to calculate monthly average NDVI for Ukraine the 2010-2020 period using MODIS data and then plot the values onto a graph (averaging all images in each individual month of each year ...
0
votes
1answer
26 views

GEE: How to export a list of multiple feature collections to a single CSV?

Apologies for my ignorance but I am brand new to using GEE and javascript. I've searched for some time for solutions but can't find/understand what I'm looking for. I have 4 shapefiles which each ...
0
votes
0answers
17 views

How to use the JS GEE API to allow users to download vector data from the user interface when pushing a button?

I have created a GEE app where users can generate training data for a simple classification. I would like for them to be able to export their training data so that it can be reused. I have already ...
0
votes
1answer
40 views

Manipulating data with a Handsontable spreadsheet in a Leaflet GeoJSON Layer and rerender the map

The goal is to add a spreadsheet view to a GeoJSON Layer to comfty edit the properties directly in the spreadsheet and the location (lat/long) within the map by dragging the marker with leaflet.draw. ...
0
votes
0answers
10 views

First Layer not rendering while adding tiles to the google maps

I am working on adding multiple tiled imagery (layers) to the google maps. I have created a loop of the layers and when the user clicks the button of that layer it will be visible and the rest will ...
0
votes
0answers
24 views

Dropdown list and map.fitBounds in Leaflet

In my Lealfet application I have a dropdown list which uses data from a GeoJSON to directly populate the list. HTML <div class="form-group"> <label for="inputCS"><...
-2
votes
1answer
111 views

Image expression in Google Earth Engine

I've been just approaching to Google Earth Engine and JavaScript. I am trying to write a code for chlorophyll-a concentration retrievial from Sentinel-2 images. I want to obtain the chl-a from the ...
1
vote
2answers
49 views

How to make a second WFS request via Ajax call from GeoServer?

After making the call for this WFS from GeoServer I'm able to display it on the map without any problem. But how do you run two (or more) requests to get another WFS? Here's my WFS request for the ...
1
vote
1answer
50 views

How can I add WFS using Leaflet Control Tree?

How do I add WFS when using the Leaflet.Control.Tree by jjimenezshaw plugin? Without using the control tree plugins, I can to make the call from Geoserver through Ajax and display my data on the map ...
1
vote
0answers
53 views

OpenLayers JSTS dealing with polygon difference that splits polygon

I have some polygon features on a map layer in OpenLayers. They are contained within a 'boundary' polygon (a field boundary, for context) and fit together perfectly with no 'holes' inside of the ...
0
votes
2answers
96 views

Dynamically load data from a GeoJSON

I ask a new question about the problem I have, because I tried it but I don't know how to solve it. (I'm learning OpenLayers, and I see that it isn't that easy). Using a html select, I run a PHP query ...
0
votes
0answers
19 views

Assign coordinate values if the variable is undefined

Whe user inputs an address, the variables latitude and longitude are passed from my geocoding python script. However when no input is given (IE when the page loads initially) I want my map to centre ...

1
2 3 4 5
63