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

Leaflet VectorGrid interactivity doesn't work if Leaflet.markercluster is used

This is a cross-post from SO. I am trying to use Leaflet VectorGrid interactivity option for click and mouse events: const vectorGrid = L.vectorGrid.slicer(geoJsonDocument, { rendererFactory: L....
3
votes
1answer
33 views

How to load external SLD in Leaflet?

I am trying to style my WMS map using sld_body parameter as explained in GeoServer working with SLD docs. I tested with simple SLD file as below, var sld = `<?xml version="1.0" encoding=&...
1
vote
1answer
14 views

Unable to add new points to the existent geometry - [Download function is returning the original empty geometry]

Everything was going well with the app, except for this part, and after hours and hours of investigations, I couldn't find the reason for this apparently simple problem. Why the new points are not ...
0
votes
0answers
22 views

Leaflet marker shakes on move

Here is the case: Im creating a new marker on map: centeredMarker = L.marker(map.layerPointToLatLng([mapCenterXPx, mapCenterYPx]), markerOptions).addTo(map); And then it should center and stay fixed ...
1
vote
1answer
23 views

Location Based KNN script on Leaflet works for Chrome but other browsers and mobiles cause parse error - invalid geometry

As many of you know I have been producing a Leaflet map with a KNN function to show the closest pubs to a user's location. Live example to test for yourself: https://ces-web2.southwales.ac.uk/students/...
0
votes
0answers
12 views

How to display Markers within the given radius in Folium maps using Python

I'm having a Python Folium map with 100 meters radius and there are few markers within that radius. Now how to display those markers within the given range and how to make it dynamically works and ...
1
vote
1answer
23 views

Mixed SRID's when using users Lat & Lon coordinates to perform KNN through PostGIS when building points to jsonp

I have managed to create a script that passes the users lat and lon to a postgres query that finds the nearest 5 pubs to a users location. However, on execution I realised no matter what lat and long ...
0
votes
0answers
11 views

Complex Categorical Filter on Carto.js

The project I am working on currently contains 10+ boolean features and I would like to create an interactive checkbox SQL filter where only the features checked are applied as AND filters. For ...
0
votes
1answer
16 views

How can I generate a multiband tif image using getDonwloadUrl?

I use the GEE API in a Python environment and I want to upload numerous small image to my local machine. I try to implement the solution suggested here. Before upgrading my code I wanted to do some ...
1
vote
1answer
29 views

Passing location data to a global variable in JavaScript

I am trying to pass the lat and lon of a user location to a global variable within JavaScript. The variable is instantiated at the top of the script and given value within the location function. //lat ...
0
votes
0answers
21 views

Uncaught syntax error whilst trying to get data from a PostGIS server

I am currently getting the below syntax error whilst trying to send data to a PostGIS server and retrieve the data back to a Leaflet map: Uncaught SyntaxError: Unexpected token < in JSON at ...
0
votes
0answers
16 views

Where to find US National Park Service basemap as WMTS?

I'd like to locate the US National Park Service basemap, ideally as a WMS or WMTS to use in a leaflet map. While browsing the NPS docs: https://www.nps.gov/maps/tools/npmap.js/api/#wms I am repeatedly ...
0
votes
0answers
26 views

Display table in .csv in GEE

I have calculated mean,mode,median of all bands of an image and I want to display the bandname (B1,B2...) and their respective mean, mode,median in .csv but, I am having an issue with how to display ...
0
votes
0answers
42 views

Live waypoints update on Leaflet map

I have an application that uses my Leaflet map. I want to use it like navigation. But the path is not updated. Where is the problem? setInterval(livetrack, 5000); function livetrack() { $.get("/...
1
vote
1answer
30 views

Error while exporting from Google Earth Engine

I run an unsupervised classification with Google Earth Engine using this code: // UNSUPERVISED classification of Conifers// var input = ee.ImageCollection("COPERNICUS/S2_SR"); var ...
0
votes
0answers
21 views

Intersection with turf.js [duplicate]

This is my full code for intersection of a drawn line with polygon feature class. I am not getting any error on console neither getting the required output. What is the problem with my code? Here is ...
0
votes
0answers
19 views

Getting a GeoServer created style to Leaflet markers via PHP

How can I use a point/marker style created on GeoServer within my Leaflet map when I am drawing data from the server using PHP. I am currently PHP to draw geodata from my GIS server, however I would ...
0
votes
0answers
26 views

How to show the horizontal zoom slider on the top right of the map

The below posted code is to show a map with zoom bar or slider. The code is taken from here: https://openlayers.org/en/latest/examples/zoomslider.html I attempt to show the zoom slider number three, ...
0
votes
0answers
8 views

LineString JSON load with timedimension

I am trying to load geojson data with timedimension plugin as shown here with difference I am loading line objects. This is what I did: var timeSeriesGeoJSON = { "features": [{ "...
0
votes
0answers
33 views

Getting next lat,lon on OL Map 3

I have the following 2 points on the map: point A lat1 / long1 and point B lat2 / long2 in OL map I have distance, arrived_time, speed. With these data how can I get a estimated latitude, longitude ...
1
vote
0answers
22 views

Intersection using turf js [duplicate]

I am giving this for intersection of a polyline using Leaflet draw plugin with polygons feature class. Here is my code function intersectPolyByPolyFC(poly,fcPoly){ var fgp=[];//variable for ...
1
vote
0answers
32 views

Show Label on Map in Open Layers

I am working on a process to show location on the map along with its label. I have figured out the way to show the marker location but not the but I cannot figure out the way to show the label. Here ...
0
votes
0answers
38 views

ReactLeaflet Returning GeoJson

I'm new to Webmapping I already create a map with ReactLeaflet and ReactLeaflet Draw, but I can't imagine how can I get the geoJSON from the polygon and just send to a database or an API export ...
1
vote
0answers
32 views

What controls the coordinate value in the singleclick MapBrowserEvent argument?

I am trying to understand what is affecting the "singleclick" callback argument: MapBrowserEvent in my OpenLayers map (v6.4.3). While I always receive the pixel coordinates back, I don't ...
2
votes
1answer
64 views

If-statement in Google Earth Engine is not working properly

In the following link, is a code where I'm trying to build a simple Google Earth Engine app where a button control's a selector's status. The button when clicked, it should check whether a predefined ...
1
vote
0answers
21 views

Defining zoom on tileset extents using CesiumJS

I work on windows 10 with Cesium 1.72. NodeJS and Cesium work well. I succeed in adding a tileset format3D tiles (Meshs + associated texture). However, I would like to define a zoom on my tileset ...
1
vote
2answers
35 views

Dictionary.get: Dictionary does not contain key: precipitation

I am trying to get 3 hourly rainfall data for my region using TRMM/3B42. There seems to be an error but I am unable to find it. var rain = ee.ImageCollection("TRMM/3B42").select("...
1
vote
0answers
35 views

Resampling Sentinel-2 ImageCollection on GEE having the bands with the same spatial resolution

I'm a beginner at Google Earth Engine. I've seen on previous topics that resampling can be made on single images, like in this topic on downscaling raster images. I have an ImageCollection of Sentinel-...
0
votes
0answers
30 views

Getting latLngBounds for tile based on its tile coordinate using Leaflet

I would like to download raster image data in a leaflet / esri-leaflet context. To provide a little backround info: When you add an esri-leaflet raster layer to a leaflet map, you can see that on map ...
0
votes
0answers
52 views

Leaflet markers not displaying

What is wrong with my code? Template = { render : function(){ if (!Map.map){ Map.create_map(); Map.set_tile_layer(); } API....
0
votes
0answers
34 views

Returning polygon attributes intersecting a buffer

I am trying to return attributes of polygons (from the SAC feature) that intersect the buffer created around the route, but I keep getting: Uncaught Error: geojson must be a valid Feature or Geometry ...
1
vote
0answers
24 views

GEE: How to iterate through a feature collection to calculate annual average indices from MODIS for each feature

I am trying to calculate the average annual vegetation condition index from MODIS data for a set of raions (districts) for spring months (march, april and may). I am wanting to export this data to a ...
0
votes
0answers
12 views

Using a dropdown to change the fill-color of a single feature

I have a geojson layer I am bringing into my Mapbox app: var states = { "type":"FeatureCollection", "features": [ {"type":"Feature","id":&...
0
votes
1answer
57 views

Passing a Python list of coordinates to add as markers to web map (Flask)

In my flask GIS app, I am passing my web map a list of coordinates from a route in my Python backend, which works as I expect it to. When I print the list it looks like this. [['53.792614', '-1.789202'...
0
votes
0answers
14 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
38 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
32 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
1answer
24 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
21 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
13 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
37 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
47 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
42 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
30 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
45 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
27 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
1answer
46 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
1answer
34 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
45 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
2 3 4 5
63