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

Making map more interactive

I have created a map using QGIS and I am planning to put it online using QGIS2Web. However, QGIS2Web does not provide much options of making the map interactive. One of my goals is that when a user ...
1
vote
1answer
11 views

Select out images from an ImageCollection using a list and make a new collection

I have an image collection that spans multiple years. I have looked at each image in the collection and created a list of the image's indices that I'd like to keep for my future analyses. However, I ...
0
votes
0answers
18 views

Customize contents of OpenLayers map attribution

I'm trying to build my own map attribution function and I want to see inside it a specific content. function MapAttribution() { const attribution = new ol.control.Attribution({ className: 'ol-...
0
votes
1answer
32 views

Google Earth Engine calculation of new Index NDRS

I want to calclulate this index in GEE. I managed to calculate the DRS, but I do not understand how to calculate the NDRS. Can you help? https://code.earthengine.google.com/?scriptPath=users%...
1
vote
1answer
18 views

Rotated image in Mapbox are skewed

I have a dji photo that I want to place at the exact coordinates in Mapbox. But when I rotate the image It become skewed. I saw a post that I solve is problem but didn't work for me. ...
1
vote
1answer
23 views

Error: "Parameter Element is Required" in Google Earth Engine?

In the below code I want to put elevation average values in to the list but returns error: code link: https://code.earthengine.google.com/6337849ec707ae2e229ba4bdb02e5fff var startDate = '2000-01-01';...
0
votes
0answers
17 views

Adding a new file type as layer into Geonode

I am trying to add a non-spatial (user-defined) file type, with a .zzz file extension as layer into Geonode. This filetype has no spatial content but as per requirements, I need to store as a Geonode ...
0
votes
0answers
19 views

Converting long/lat coordinates for a selected feature in Mapbox tile GeoJSON such as a road to Unreal Engine x,y coordinates

The goal is to be able to download a real-world height map, import it into Unreal as a landscape, then draw roads on that landscape based off the GeoJSON file coordinates for that road. I use this ...
0
votes
0answers
10 views

Is there a Post-classification Majority Analysis feature on Google Earth Engine for sentinel-2A? [closed]

I have a problem "Layer error: Image.visualize: Cannot provide a palette when visualizing more than one band". if there is can you help me by sending the google earth engine code?
1
vote
0answers
23 views

Leaflet highlight GeoJSON points within the other highlighted GeoJSON layer

I would like to have all the points highlighted within the other highlighted GeoJSON polygon. Next, I would like to have them displayed in the panel next to or at least in the console (for now). The ...
2
votes
1answer
46 views

View vector GeoServer line layer in Leaflet

I have simple line layer created based on shapefiles. It can be viewed in GeoServer with OpenLayers preview: I also can be imported and correctly viewed in QGIS. I tried to visualize this layer over ...
1
vote
1answer
24 views

Getting attributes of polygons that line overlaps using Leaflet and Turf

I have a Leaflet Polyline: var polyline = L.Polyline(polylineData).addTo(map); and a Leaflet GeoJSON of Polygons: var countries = L.geoJson(countries, {style:{color:'darkgrey', opacity:1,fillColor:'...
0
votes
0answers
21 views

Is it possible to generate river lines in Google Earth engine? [closed]

I'm trying to calculate the river lines through the dataset ("WWF/HydroSHEDS/15ACC"), I calculated the centroid of each pixel that is possible to be a river and later I made an ee.Algorithms....
0
votes
0answers
14 views

How to run and export zonal statistics for each feature of a Feature Collection in Google Earth Engine?

I'm building a JS script in GoogleEarthEngine. I am automating the code for many year to get a vegetation index (Enhanced Vegetation Index (EVI)) for each year. (code here). I'm trying to get for each ...
1
vote
0answers
27 views

Calculating change area using NDVI in Google Earth Engine

I am new to Google Earth Engine and JavaScript. I am trying to visualize and calculate the changed area from the NDVI of 2 years (Landsat 8 surface reflectance). Can anyone please help me out to ...
2
votes
1answer
38 views

Downloading entire image collection of a particular month from 1990-2020 in GEE platform?

I am trying to download ERA-5 daily minimum temperature data of 10 years (2010-2020) for a particular month (at present for November) and a study area (an imported shapefile as WH). I have extracted ...
1
vote
0answers
16 views

Put a legend into GEE map

How can I add a legend to my own script? I'm new in GEE's JavaScript environment. I attached my script right here: // Palette with the colors var palette = ('FF0000', '22ff00', '00BA08','006304'); ...
1
vote
1answer
16 views

How to get nearest locations by coords using Laravel or JavaScript

I have a locations table that has latitude and longitude I have a JavaScript event that register the clicked coords, that coords are saved on coords variable. Then, I'm using axios to get a list of ...
0
votes
0answers
12 views

Error 'appendChild' when trying to open popup

I'm trying to customize the result text of Leaflet control geocoder let searchBox = L.Control.geocoder({ geocoder: googleGeoCoderProvider, defaultMarkGeocode: false, }).on('...
1
vote
1answer
69 views

Map lat/lon onto polar stereographic projection map based on two known points on map image

I've searched already everywhere but couldn't find anything. I have a "polar stereographic projection" map that is true at 60 degrees latitude north as an image (e.g. https://flightplanning....
1
vote
1answer
33 views

Uncaught Error: Unsupported GeoJSON type: undefined - Openlayers

I get a valid geojson from the database using a query. Below one is the php script used to read the data. <?php include "../includes/init.php"; // including data base connection $sql = &...
0
votes
0answers
53 views

AJAX Request (Point Feature, Format GML) with fetch API from WFS failed

I work with OpenLayers 6.9.0. Individual polygon and point features are displayed on the map with a GetFeature request via WFS. The WFS delivers GML, no GeoJSON. Points and polygons come from the same ...
2
votes
1answer
59 views

Leaflet mouseover event with two markers

I have a map on which one layer overlays the other one (I have icon markers displayed and larger circles markers behind them). I'm trying to create a function that changes the icon symbol AND the ...
1
vote
1answer
45 views

Change marker icon on mouseover/mouseout in Leaflet

I have a map made with Javascript, on which there are numerous points and each one of them has a specific png marker. I managed to display all the markers correctly with the following code: var ...
0
votes
0answers
21 views

Extending terriamap measurement tools functionality

I want to extend the existing measurement tools that terriamap has with a functionality that can measure volume on building/3D model that overlayed on the map. I've seen that the tools consist of two ...
1
vote
1answer
15 views

collectionVV.filterDate is not a function error in GoogleEarthEngine [closed]

Hello I dont know anything to this but I just have one mistake in my code I dont know why: // Load country features from Large Scale International Boundary (LSIB) dataset. var countries = ee....
0
votes
2answers
41 views

Georeferencing raster image in JavaScript

I was wondering if it is possible to georeference raster image using some kind of JavaScript lib or external API or other kind of service. My project is written in React with Mapbox GL JS. I wanted to ...
1
vote
1answer
22 views

Add Each Image to Previous Image in Google Earth Engine Error?

The below code has written to add each image to the previous image using iteration function but I don't know why returns negative values while positive expected! Code link: https://code.earthengine....
2
votes
1answer
35 views

Show the locations in Esri Map as dots, not as pin-points

Currently, my Esri map is displaying the locations in the map as Pin-points. But I want to display those locations in Esri Map as dots (Circles) not as pin-points. Could you please refer to the ...
0
votes
1answer
20 views

Make text color in innerHTML change depending on value in GeoJSON

When I hover over different counties on my map, a div updates whether or not the county voted republican or democratic in the 2020 election (among other things). It will either say it voted republican ...
1
vote
1answer
31 views

Error Handling Geoprocessing Service in ArcGIS JavaScript API

I am using ArcGIS JavaScript API 4.21 (with TypeScript). @arcgis/core/tasks/Geoprocessor is deprecated since version 4.20. So I am using @arcgis/core/rest/geoprocessor instead. import JobInfo from &...
0
votes
1answer
24 views

Filtering substring from a geojson string column in Mapbox GL JS

I am trying to filter my Mapbox map based on a substring filter. I have a column called COUNTY which has strings like Kern,Ventura,Los Angeles. My current code is as follows - map.addLayer({ id: &...
0
votes
1answer
84 views

Use of Leaflet to display raster image from WMS GeoServer

I'm trying to display raster images from GeoServer on a Leaflet map. Simply like this: var map = L.map("mapid").setView([15.6261, -61.44361], 13); var wmsLayer = L.tileLayer.wms('http://...
0
votes
0answers
24 views

How to make div update with zoom level?

I have a div that updates with mousehover. For example, when you hover over GA it displays the data for GA, when you hover over NC, it displays the data for NC, etc. I want to have the same div, but ...
0
votes
1answer
23 views

Data is not appearing in chart in GEE

I have not been able to figure out why the dataset I load does not appear in the chart I created in Google Earth Engine. I am new to GEE and JavaScript in general, so I may be missing something ...
2
votes
1answer
55 views

Make data layer disappear and different one appear on click in Leaflet

I'm mapping COVID vaccinations per state and per county in the US. I have state data as well as county data displaying properly. I'm trying to make it so that when I click on a state it zooms in to ...
7
votes
2answers
116 views

Styling popup with two separate styles at once in Leaflet

I have the point layer as you can see below: where the semicircles are fine but points not necessarily. I would like to customize these points as well. The problem is, that I can't find a good option ...
4
votes
1answer
58 views

Variable nested inside another variable not displayed properly in popup in Leaflet

I would like to set my popup content. Some of the information will be condition-based. I tried the following options: onEachFeature: function (pointFeature, layer) { var stream = function(liveStr){...
0
votes
0answers
69 views

Drawing a Custom Map Projection in D3 using Observable

I am trying to create a custom map projections in D3 using Observable, following the approach given in the d3-geo Docs. Essentially, you pass a function that takes in (lambda, phi) and returns [x, y]. ...
0
votes
0answers
51 views

Rounding latitude longitude locations up/down to approximately 0-1 kilometer to mutual GPS coordinations dot/point

This is a very simple problem I have to solve simple (in JavaScript, but it doesn't matter for that topic). OK its possible so solve that the hard way, but I just want to solve that as easy as ...
0
votes
1answer
16 views

How to change the icon image when clicking off the symbol layer

In Mapbox, I can successfully swap marker images when clicking on a marker. However, I can't get it to change back when clicking an empty space on the map. This causes the pop-up to close, but the ...
0
votes
0answers
41 views

OS Grid reference control clash with version 6.3.1

I would like to implement the OS Grid reference control, which is here: http://eap.ucr.ac.cr/mapas/ol-ext-master/examples/canvas/map.control.gridreference.html I have modified the code for my needs, ...
0
votes
1answer
17 views

Google Earth Engine - Area is undefined to used in if

I'm having trouble getting my if to recognize the value of the area. When utilize .type returned undefined Code doesn't return response I tried: ee.Number .float .int var ar1 = a1.area(); var ar2 = a2....
1
vote
1answer
47 views

Extract coordinates from .gpx file with OpenLayers (or any other JS library)?

I have a simple drag and drop event assigned to my OpenLayers map. This allows me to take a .gpx file, drag & drop it on top of my map which results in the route being visualized on the map. The ...
0
votes
1answer
162 views

Auto-populating field from another feature layer in Survey123 using JavaScript

I'm creating a survey where the collector can drop a point and several fields auto-populate from another feature layer. For example, an inspector is at a property and finds a code violation. Hence, ...
0
votes
0answers
66 views

Import GeoJSON object into PostGIS in JavaScript

I'm looking for a way to persist my GeoJSON object to a table in PostGIS, I've installed the ogr2ogr JavaScript library to achieve this; on this case this what I got so far: async function ...
0
votes
1answer
25 views

OpenLayers drawing circle doesn't work for version 5.3.0

I had to downgrade my OpenLayers version a bit from 6.1.1 to 5.3.0. After this, I've noticed, that I can't draw the circle anymore. From the following code: var circleInteraction = new ol....
0
votes
0answers
42 views

How do I prevent leaflet search function to first zoom to the center of the map rather than directly going to the correct location?

I have created a map using leaflet and QGIS2Web. The search function of the map works strange. When I search for something (an African language), it first zooms in to the center of the Africa rather ...
1
vote
0answers
61 views

Integration of StreetView with QGIS2web openlayers map failed

After attaching the street view to my map I have most of options gone. Predominantly I see the error: TypeError: S.hasRenderer is not a function My full code is here: https://mktest.opx.pl/ If I ...
1
vote
1answer
65 views

OpenLayers delete selected features by the right-click pop-up

Following this question: Deleting selected feature in OpenLayers? I would like to have also an option to delete the object by the mouse right-click. I found an option for switching on the context menu:...

1
2 3 4 5
66