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

How can I return a set of Landsat images based upon swath indexes in Earth Engine?

I'm encountering an odd error in Earth Engine, as per the title I'm trying to generate an ee.ImageCollection based upon the Landsat WRS_PATH and WRS_ROW specific to our area of interest (ex., WRS_PATH ...
user avatar
  • 111
2 votes
0 answers
18 views

Select interaction with openlayers: multi equals true. How to store all layers?

I have a select interaction, with multi option equal to true. This interaction is used with popup, following code https://viglino.github.io/ol-ext/examples/popup/map.popup.feature.html I store the ...
user avatar
0 votes
0 answers
10 views

Cluster of different WFS layers in Openlayers [closed]

I have a layer control and it is possible for me to choose one or more layers. But even for different layers I have point in the same location and I would like to group them. I'm using Openlayers. I ...
user avatar
1 vote
0 answers
17 views

Difficulties displaying JS function result based on feature field calculations in HTML web page

I am looking to display a statistic that I derived from a JS function, called "Weighted RSR". This statistic is calculated by the following equation: (Sum(SquareYards * AdjustedRSR) ) / ...
user avatar
0 votes
0 answers
36 views

WFS layer in OpenLayers: get each feature geometry [closed]

I have a WFS layer and I need to be able to get every feature from that layer and add it to an array. I'm not sure how to fetch each geometry from the WFS layer. I need this array, because I'm going ...
user avatar
0 votes
0 answers
25 views

SQL query into a Google Apps Script (*.gs)

I am beginner in .gs and javascript (.js) code and I want to write a Google Apps script including an SQL query to apply it to one or more Google Sheets tabs : tab where I write my *.gs code : ...
user avatar
0 votes
0 answers
7 views

Executing Geojson2h3 on the browser without Nodejs

I am trying to execute Geojson2h3 on the client browser without Nodejs. I have imported the 'geojson2h3.js' javascript file. However, I am getting an error with the following code. I am hoping that ...
user avatar
0 votes
0 answers
18 views

React Leaflet layer without attribution properties

how to get layer attributes with geojson? I try to get attributes from leaflet layer, but layer does not currently contain data in e.target when i try click to Polygon. import React , { useState, ...
user avatar
0 votes
0 answers
5 views

Get element in raster array based on BNG coordinates

I have some BNG coordinates which are converted from lat and long using proj4. I also have a raster file based on BNG. I want to get the relevant element from the raster array based on the coordinates ...
user avatar
0 votes
1 answer
31 views

GEE: How can I code this more simply?

I want to make a long-term period selector and need more selectors, not just one. So, I made each label and value in items and copied them. I want to know if there is a more efficient method. Please, ...
user avatar
0 votes
1 answer
21 views

Process for Determining Accuracy of Polygon [closed]

What tools/processing/decision trees would one use to get a base line of the accuracy of a polygon? I'll explain below. In my line of work, I deal with buffered lines (polygons) and I'd like to create ...
user avatar
  • 1,051
1 vote
0 answers
30 views

Using JavaScript fetch to upload shapefile into Geonode not working

I am trying to use JavaScript fetch to upload a GeoJSON into Geonode. I had acquired the JavaScript code to do that. https://github.com/GeoNode/geonode/issues/8983 However, now I am trying to upload a ...
user avatar
0 votes
0 answers
14 views

Leaflet: Illustrate distance along path, like "measure distance" in Google Maps

In a map in a web application, I would like to illustrate distance along a path, like how it is done with the measure distance tool in Google Maps (see attached image). Is there a way to do this in ...
user avatar
0 votes
1 answer
35 views

Generating a bounding box for leaflet is inaccurate

I am trying to generate a bounding box for an image with Leaflet, based upon 3 criteria: Starting Latitude and Longitude (the center of the bounding box) My value for this is 38.9761, -77.4875 ...
user avatar
1 vote
0 answers
43 views

Leaflet t.addlayer not a function

I am trying to implement the leaflet-panel-layer plugin and customize the included overlay to my needs. The original code uses a geojson formatted as js and I use a basic js marker list (which I load ...
user avatar
  • 21
0 votes
0 answers
15 views

How can I smoothly move a marker (Feature) from one location to another with OpenLayers?

I want to move a marker (a Feature object) from one location to another with animation. So I don't want the location pops up from one place to another, because it's not userfriendly. What I hope to ...
user avatar
0 votes
1 answer
23 views

How to rotate marker or feature with OpenLayers?

I managed to add markers as Feature objects in a Vector layer. I can simply move the markers to its new locations by using Feature.setGeometry() method. Next thing is to change the marker's direction ...
user avatar
0 votes
0 answers
11 views

How to display specific attributes in web from feature layout in JavaScript

I have a feature layout with many attributes in ArcGis online. And I have project of the map that is displayed on web. I know how to filter features by attributes. But I need to display a map by ...
user avatar
  • 101
1 vote
0 answers
32 views

Custom Layercontrol Overlay Leaflet / React Leaflet [closed]

I am new to React Leaflet and have some experience with Leaflet. Now I am trying to build a custom Overlay to manage the markers in my map, and came accross this example which seems to be perfect for ...
user avatar
  • 21
0 votes
1 answer
32 views

Load Leaflet ImageOverlay with center point instead of corners

I have an image file that I am able to overlay perfectly fine onto my Leaflet map with this code: var initLat = 38.9761; var initLon = -77.4875; var imageUrl = '/weather/nexrad/radar.png'; var ...
user avatar
0 votes
1 answer
32 views

Is there a limit on the number of polygons shown by GeoJson on Leaflet?

I have 15,811 block groups of Texas converted as GeoJson. I am trying to show them using Leaflet.js. Surprisingly when I use all block groups, I cannot show them on index.html. What I get is the ...
user avatar
  • 28
0 votes
1 answer
31 views

Adding raster TIFF image directly on the map using OpenLayers without using GeoServer?

I want to know how to add an raster tif image onto map using OpenLayers var imgextent = [extent array]; var geoRasterMap = new ol.layer.Image({ //...
user avatar
  • 1
2 votes
2 answers
75 views

Changing marker icon on click and then back to original state when click elsewhere in Leaflet?

I'm trying to get this function on my custom Leaflet map https://rodadagua.netlify.app/ I've found some very close examples and questions on here but being a complete novice unfortunately I have no ...
user avatar
  • 25
1 vote
1 answer
66 views

Adding GeoJSON layer to a Layergroup so that it shows as radio button in layer control?

I want to display both the basemaps and the overlaymaps with radio buttons in my LayerControl. I tried this via Layergroups and ran into some difficulties there. I have two GeoJSON layers that get ...
user avatar
0 votes
0 answers
7 views

map icon attribute popups

I have a code that plots points on a map for an Json file. I would like to have a pop up menu with some of the other attibutes in the json file when icon is clicked. I tried several examples but can ...
user avatar
0 votes
1 answer
26 views

GeoServer layer style not updating through REST API after deploying on Ubuntu server

I am trying to update the GeoServer layer style using REST API. First I wrote a function to update the layer and SLDon GeoServer and then another function to update the default style of uploaded. this ...
user avatar
0 votes
0 answers
58 views

Export Image as CSV table in Google Earth Engine

I am new to Google Earth Engine. I am trying to export NDVI and Band 6 and Band 10 (after cloud masking) as CSV table with columns for dates and Long and Lat (x and y). Am completely lost when it ...
user avatar
  • 9
0 votes
1 answer
48 views

Sentinel 2 imagery not filling the whole square Google Earth Engine JavaScript

Sentinel 2 satellite should be able to display that region of the square too because of the way the satellite travels and scans each region. Why is this happening? var start_date = "2016-05-12&...
user avatar
  • 1
0 votes
0 answers
20 views

Openlayers ol-ext Custom Bootstrap button not working

So I created 2 bootstrap buttons, one for print/export the map canvas and the other is for Map Coordinate searching. I'm using Openlayers 3 and this extension ol-ext (http://viglino.github.io/ol-ext/) ...
user avatar
1 vote
0 answers
39 views

Load shapefile from local machine to database PostgreSQL

I have a method that imports shapefile to PostgreSQL (using GeoTools), it takes as arguments the path of the shapefile (it's working fine). The problem is I want the user to select a shapefile from ...
user avatar
0 votes
1 answer
46 views

OpenLayers 6 custom control using Vuetify and a resizable div

I am trying to understand how to extend the Control class of a OpenLayers 6 map using Vuetify components inside. I have several ideas to implement such as a collapsable search bar or a simple ...
user avatar
  • 11
0 votes
1 answer
17 views

Web AppBuilder DE - Use an uploaded shapefile to query

The shapfile is zipped and uploaded through the "Add Data" widget. I am looking to use an customized widget to read the feature layer from the upload and query another feature layer. Since ...
user avatar
  • 331
0 votes
0 answers
21 views

Append original shapefile projection definition to GeoJSON using Javascript

In our web application we upload shapefiles and convert them into geoJSON format. These shapefiles will be in different projections and I want to be able to add the original projection of the ...
user avatar
0 votes
1 answer
67 views

How to add image in Mapbox with turf.js grid

I divide the map into squares with Mapbox-GL and trufjs and the grid is created. I want to select some of these frames with the mouse and add pictures to the selected frames. The image should be above ...
user avatar
0 votes
0 answers
4 views

Errors on putting a chart for my NDVI timeseries (the error concerns the 'system: time_start'

// region of interest var Bassin = ee.FeatureCollection('projects/ee-geomatiquetech/assets/BassinVersantOER_WGS') Map.addLayer(Bassin); // image landsat var L5 = ee.ImageCollection("LANDSAT/LT05/...
user avatar
  • 1
1 vote
1 answer
20 views

How to snap a graphic to a vector basemap layer

I'm using the Sketch Wdget in a map for drawing graphics. Is it possible to snap the drawings (polygons for example) to the roads that are part of the vector tile layer i'm using as a base map?
user avatar
  • 123
1 vote
0 answers
73 views

Loading shapefile data into L.shapefile says nodebuffer is not supported by this platform

I am having a shapefile that is converted to a Base64 string. I am converting it to a file and then trying to convert to arrayBuffer using 'FileReader' to fit the data to match (L.shapefile) https://...
user avatar
0 votes
1 answer
148 views

Leaflet Map moves to opened popups when zooming in (React-leaflet)

i wanted to open the popup Markers when the MapZoom is at a certain value ,i got the mapZoom using the map.getZoom() on the zoomend Event , a state is set for the MapZoom when the user scrolls ...
user avatar
1 vote
1 answer
67 views

Toggle dark mode on and off using on and un in OpenLayers

I made this codepen where I am setting a style to a layer on an event listener. My question is simply how can I programmatically toggle the styling on and off since my attempts to unlisten to the ...
user avatar
  • 11
1 vote
1 answer
139 views

Detecting Leaflet layer type (react-Leaflet)?

I am using the EachLayer() Method to know how many and what Layers are in my Map now mapView.eachLayer(layer=>{ console.log(layer) }) const map = useMapEvents({ layeradd(e){ //...
user avatar
1 vote
2 answers
81 views

Copying the system:time_start property from a filtered Image Collection to a Mosaic/Image in GEE

I'm creating a script to do a time-series analysis over a large date range, preview/(Map.addLayer) the results on one specific day, and have that Map result be exportable. The timeseries section is ...
user avatar
0 votes
1 answer
44 views

Converting GEE Javascript to Python using geemap not working

I'm looking to convert my code to calculate the mean 30 year precipitation from ERA5 in GEE into Python so that I can run it in the ee python command line tool. I tried using the geemap conversion ...
user avatar
2 votes
2 answers
189 views

Change popup content with JavaScript

How can I dynamically change the HTML content of a Leaflet popup using JavaScript? I have text in the popup that I want to change when it's clicked: map_layer = L.geoJSON(countries, { ...
user avatar
0 votes
1 answer
48 views

How to Map.addLayer() rainfall featureCollection over globe using Google Earth Engine?

I am trying to print the precipitation imageCollection allover the whole world but I allways get only a part of the image. as you see in the image, the north of europe is empty and event when I use ...
user avatar
0 votes
0 answers
40 views

OpenLayers Google Satellite error

When I try to insert in QGIS the Google Satellite OpenLayers Plugin it gives me an error ("Printing and rotating of JavaScript API based layers is currently not supported" and the image ...
user avatar
  • 11
1 vote
0 answers
37 views

How to plot .tif file colour coding onto the map using JavaScript [closed]

I want to plot color coding from the .tif file into the map with the help of react-leaflet. How can this be done? I am open to other better suggestions. My core goal is to display color coding given ...
user avatar
0 votes
1 answer
23 views

Exporting an uploaded map from Google Earth Engine to my drive

I uploaded a map which I created of miombo woodland and added it to the Hansen gfc map layer with the idea being to export my map to my drive merged with gfc layers however I keep getting this error: ...
user avatar
2 votes
1 answer
52 views

Providing parameters in a URL to select and zoom to a feature on startup [closed]

I have a Leaflet map with GeoJSON data that shows various properties and I would like to append a parameter like "owner" to a URL (not a coordinate) and have the feature selected and zoomed ...
user avatar
  • 21
1 vote
1 answer
54 views

OpenLayers GeometryCollection styling issue

With some help, I am able to draw some custom shape on my OpenLayers project with the following code. geometryFunction = function (coordinates, geometry) { const center = coordinates[0]; ...
user avatar
1 vote
1 answer
58 views

Choropleth hover functionality is glitching using Leaflet

The basic functionality of my web map is to allow users to switch between choropleth views using a dropdown menu. This basically works, but the issue I'm now having is with the info box that allows a ...
user avatar

1
2 3 4 5
67