Questions tagged [javascript]
JavaScript is a prototype-based, object-oriented scripting language that is dynamic, weakly typed and has first-class functions.
3,380
questions
-1
votes
0
answers
17
views
British National Grid to OS Grid Ref converter in JavaScript
I am looking for a British National Grid to OS Grid Ref converter in JavaScript. I've looked everywhere but can't find anything.
Are there any JavaScript or open source libraries about that do this ...
0
votes
1
answer
34
views
Display route layer between current user location and geocoded search locaton in Leaflet?
I would like to create a simple Leaflet app that zooms to the user location, and also to a location defined within the geocode search bar. Secondly, the app should show the shortest route between the ...
0
votes
0
answers
31
views
3D modelling with DEMs and ThreeJS
I am trying and right now in the search of methods to visualize 3D terrain with the use of the JS framework "ThreeJS" and so far I have only got through to visualizing with the QGIS2threeJS ...
1
vote
1
answer
53
views
Filtering clouds and creating median with Google Earth Engine Landsat8 EVI Composite
I am downloading images from Google Earth Engine's Landsat 8 Collection 1 Tier 1 8-Day EVI Composite collection here. I would like to create one image, a median composite of the images from May 1st to ...
0
votes
0
answers
27
views
Deck GL set MVT point layer icon faces camera
I'm attempting to set the MVT layer icon to faces camera in Deck GL (version 8.8). Currently, I use first person view and MVT layers. The problem is that currently the points faces up. I would like ...
0
votes
0
answers
23
views
Tippecanoe | Can't set max zoom extent level 22 for mbtiles
I know this might be a duplicate question but I wasn't able to find any solution. I'm working on a tool with the help of this package which is actually a platform to convert a geojson file to mbtiles ...
0
votes
1
answer
29
views
How to annotate features in google earth engine?
I have a CSV file with ID, X, Y, NAME and ZoomLabel. I have been successful with putting the Point Feature on the map.
Now I am trying to annotate the locations with the NAME field.
I used the ...
0
votes
0
answers
38
views
Create custom layout with OpenLayers
As a side project, I am learning to work with OpenLayers and I am trying to replicate the layout that is shown in these type of maps (see attached image)
I have started to play with the JS following ...
0
votes
0
answers
51
views
Error while creating Worker Pools in GeoTIFF
I have to extract rasters from a large TIFF file (about 8MB). For this purpose I use GeoTIFF v.2.0.7 readRasters, but performance is unsatisfying:
reading rasters took: 395143.48280000035 ms
As a ...
1
vote
1
answer
62
views
Initial zoom to GeoJSON object from file (.js) in Leaflet
I am building a viewer with Leaflet API and OpenStreetMap base. I want that when I enter this viewer it shows me immediately in the initial visualization the extension of my layer that I am using. For ...
0
votes
1
answer
29
views
Image Collection containing orbits not related to the defined boundary
I tried to download all the images in ImageCollection for methane emission (in a specific timeframe and for a defined location)and check their orbits. Even though I've added filterBounds, there are ...
0
votes
0
answers
44
views
Style in OpenLayers shows invalid characters on some computers
I have a layer in OpenLayers, which I style for font color. However, on some computers, the texts show with special characters, a blurred, confusing text that cannot be read. In others, without any ...
0
votes
1
answer
39
views
Unable to export time series from MODIS NDVI in GEE as transforming geometry into requested projection not working
I am trying to acquire MODIS NDVI (MOD13Q1 v061) time series using Google Earth Engine for certain locations for which I have the coordinates. My code looks as follows:
////////// Input
// Specify ...
0
votes
1
answer
68
views
JavaScript libraries to visualize CityJSON data
I am looking for JavaScript libraries that allow you to visualise cityJSON (https://www.cityjson.org/) data.
I am currently using cityGML with Cesium JS (https://cesium.com/platform/cesiumjs/), but ...
1
vote
0
answers
53
views
How do display WMS on demand directly from a webgis app
I’m making a webGIS app based on Cesium Js. I have a node js server for all the server logic, a tomcat server hosting Geoserver to be able to load WMS layer on Cesium.
On my app I want to allow the ...
1
vote
1
answer
44
views
Browser hangs while parsing georaster in geoblaze
I've been trying to create a histogram using geoblaze with a COG from s3.
The georaster is as follows: (generated with geoblaze.parse(url))
{
_data: '==hidden==',
projection: 32618,
height: ...
0
votes
1
answer
125
views
.getImage() generates error in geotiff.js
i am using geotiff.js lib to perform some processing on tiff files. referring to the official doc of the aforementioned lib here https://github.com/geotiffjs/geotiff.js
you can see in section Example ...
1
vote
2
answers
362
views
Converting shapefiles from S3 to GeoJSON in JavaScript for web map
I am working on a web map using OpenLayers and have encountered a challenge in converting shapefiles stored in an S3 bucket to GeoJSON using JavaScript. My goal is to display the converted shapefiles ...
0
votes
1
answer
63
views
Create KML file from Metro Dreamin map
I am wondering if there is an easy way to create a KML file from a Metrodreamin.com map; perhaps from a JSON file. Ideally I would like to do this from an Ipad. However I have acess to a Windows ...
0
votes
1
answer
622
views
TypeError: a.union is not a function
I'm trying to get the union of two polygons but every time I try I get a TypeError: a.union is not a function error.
Here's my code:
import GeoJSONReader from 'jsts/org/locationtech/jts/io/...
0
votes
0
answers
30
views
How to add addtional spatial data to 'qgis2threejs' programatically?
Is there a way to add additional data to the 3D model which exported from the 'qgis2threejs ' module?
For example, if I create lines (with X, Y, Z(height) coords) in PostGIS could I load it into the ...
1
vote
1
answer
124
views
geotiff.js - Elevation at point in DEM raster seems to be null or zero
When reading COG (Cloud Optimized GeoTIFF) or original GeoTIFF of a DEM/DTM (elevation map) file using Geotiff.js directly or geoblaze, elevation at a point through conversion of coordinates to pixels,...
1
vote
1
answer
78
views
Google Earth Engine ui.Chart.getDataTable() returns empty list
I am trying to grab the underlying data from a chart in GEE. It looks like there is a built in method for this: ui.Chart.getDataTable(), however it appears to not work. I've tried on multiple charts. ...
0
votes
2
answers
70
views
OpenLayers 7 WFS 1.1.0 not drawing polygons when srsName contains opengis.net/gml/srs/epsg.xml
I'm writing a web app that uses WFS data on top of OpenLayers with OpenStreetMap. The entire project works in EPSG:2180 projection and uses multiple versions of WFS (depending on server). OL doesn't ...
0
votes
0
answers
212
views
How to cycle through features of a given google.map.data layer
I'm building a Google map UI, where a user can select a state which will zoom them into counties which will zoom them into zip codes. This is not homework. It's a legitimate requirement for a client. ...
0
votes
1
answer
713
views
Converting lat/long coordinates to UTM using JavaScript - wrong easting
I am trying to convert these coordinates to UTM
const longitude = 143.5279742;
const latitude = 44.062027;
// Calculate the UTM coordinates
const zoneNumber = Math.floor((longitude + 180) / 6) + 1;
...
1
vote
1
answer
432
views
How to get attributes of Web Map feature which user clicked on in custom widget in ArcGIS Experience Builder application?
I have an ArcGIS Experience Builder application, which uses a Web Map I host in ArcGIS online. This Web Map contains a feature layer with several attributes, and I can use these in Experience Builder ...
4
votes
1
answer
198
views
Populating Google Maps using QGIS exported GeoJSON
I am populating a Google map using GeoJSON that I'm exporting with QGIS. I'm converting the TIGER shapefiles into GeoJSON for state polygons. I used the standard output, and received the file. My ...
1
vote
0
answers
146
views
Extracting elements plotted on OpenStreetMap canvas
I found a very nice website with eclipse maps, which example can be found here:
http://ytliu.epizy.com/eclipse/solar_eclipse_interactiveMap.html?ybeg=2001&ind=55&dT=69.49500924568443&k2=...
0
votes
1
answer
260
views
Pushing Foursquare's Swarm Check-In Data into a Google Maps Service
I've been using FourSquare's Swarm app to track my travels. I'd like to be able to plot the check-in locations on a Google Maps service (or any other web-based service outside of the Swarm App). I've ...
0
votes
0
answers
69
views
Calling js module into Google Earth Engine in R (rgee and rgeeExtra) results in 404 error
I want to use BFAST Monitor in Google Earth Engine from within R, using rgee and rgeeExtra. Adapting code from this post to rgee, I have got the following reprex:
library(rgee)
library(rgeeExtra)
...
0
votes
1
answer
127
views
How to move and rotate WMS layers independently using OpenLayers (without GeoServer)
There are maps on OpenLayers 6 and proj4js that manages WMS layers in different projections. Sometimes (e.g. for plan maps) the overlay is not aligned with base layer and a need a function that can ...
0
votes
0
answers
18
views
JavaScript implementation of OGC GeoSPARQL functions
I am aware of various Java implementations of OGC GeoSPARQL standard, provided by RDF4J, Jena, GraphDB and other vendors. Now I am looking for JavaScript libraries that implement whole set of ...
0
votes
1
answer
238
views
MODIS LST time series for daily average
I am trying to compute and plot the linear regression model for MODIS terra LST values. I have successfully plotted the "LST_Day_1km" band by using the following code:
var terraD = ee....
1
vote
1
answer
142
views
Leaflet shapefile plugin doesn't show the shapefile layer
I'm trying to use the Leaflet Shapefile plugin (https://github.com/calvinmetcalf/leaflet.shapefile). A demo page also shows the plugin's output (http://calvinmetcalf.github.io/leaflet.shapefile/). I ...
0
votes
0
answers
231
views
deck.gl: regenerating all layers every time
There are MVTLayer and GeoJsonLayer on the map.
The first one is background.
The second one should request features for current map extent only (i.e. bounding box strategy).
Code:
const map = new Deck(...
0
votes
1
answer
192
views
Reg Google Earth Engine code editor suggestion tooltip
When I try to create or copy geometries in GEE editor, I am not getting suggestion tooltip to convert geometries into import records. Its working for my other Gmail account. Having issue with other ...
0
votes
0
answers
57
views
Polygon will not display in angular / JavaScript layer
I have allowed the user to draw a polygon and save the points to Firestore. When the page loads, Firebase retrieves the polygon coordinates relevant to a location. When I create the polygon rings ...
1
vote
1
answer
78
views
Why can I add data as a map layer, but not be able to export it in GEE?
I have put together a script in earth engine with the purpose of producing an NDVI max time-series collection with relevant masks applied from 1984-2022, then reducing this using Kendall's correlation ...
0
votes
1
answer
48
views
How to calculate the burnt area for each rectangle in the grids specified and save in CSV
I am new to the Google Earth Engine. I am trying to calculate the burnt area for this gridded region (dividing the region into 24 x 24 grids), and save the area in a CSV file. But I am unable to get ...
1
vote
1
answer
228
views
Select bounding box Earth Engine
I am trying to select a particular region (square) on map of ERA5 dataset but ee.Geometry.BBox instead add the layer on the whole map instead of that squared region. I have region coordinates inside ...
1
vote
1
answer
62
views
WMS XML file does not have "contents" tag
I'm trying to use WMSLayer (https://developers.arcgis.com/javascript/3/jsapi/wmslayer-amd.html) to create a layer from a WMS file. However, the class makes a call to https://www.geoservicos.ide.df.gov....
1
vote
1
answer
228
views
Convert HMTL Maps to GeoJSON/JSON data
I have an HTML file here, but I don't know how to extract the coordinate data into a GeoJSON or shapefile. Is there a quick way to get it? Link : https://codeshare.io/DZEwnO
...
function myMap() {
....
0
votes
0
answers
129
views
Wikipedia layer in Leaflet
I have been trying to move examples of Wikipedia layers to my file server. They work when opened via file explorer, but not when uploaded. All that I have changed are the addresses for the JS files. I ...
0
votes
0
answers
434
views
Infowindow on Google Maps map is not showing
When I add an infowindow it's not showing also the rectangle anymore.
let map;
function initMap() {
// The location of Uluru
const uluru = { lat: 32.1582615544072, lng: 34.89155037133181 };
...
0
votes
0
answers
138
views
Plot reference lat/lon lines in Leaflet
Basically taking the code from the sample provided by the leaflet website, I am able to get the general map for leaflet:
Now, I would like to add reference lat/lon lines. For example, 0, 10, 20, ... ...
1
vote
1
answer
133
views
JavaScript ArcGIS: Relative links are not working
I want to show a link in popup template when clicking on a feature. I am using popup template:
const template = {
// autocasts as new PopupTemplate()
title: "Trail run",
content: "...
0
votes
1
answer
120
views
Removing popup programmatically does not work in MapLibre JS
Removing programmatically a popup does not work.
Popup created OK, as:
map.on('click', function(e) {new maplibregl.Popup().setLngLat(e.lngLat).setHTML('MODIFICATIONS').addTo(map);});
Deleting ...
1
vote
1
answer
684
views
Leaflet.draw change polygon filling programmatically
I'm using Leaflet.draw to draw and edit polygons.
var drawControl = new L.Control.Draw({
edit: {
featureGroup: drawnItems,
edit: {
selectedPathOptions: {
...
3
votes
1
answer
403
views
Detect if features are next to each other but not overlapping using Turf.js
I would like to detect if two features are only sharing one or more edges but do not overlap using Turf.js. What I have tried so far is using all the relevant boolean functions of turf. Unfortunately ...