Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [javascript]

JavaScript is a prototype-based, object-oriented scripting language that is dynamic, weakly typed and has first-class functions.

1
vote
1answer
58 views

Can I use a browser's developer tools to see the zoom level of current map in browser?

What I'm looking for Where a map is being served by Mapbox in my browser is there anywhere within the Chrome/Firefox Developer Tools where it shows the current zoom level as displayed on screen? ...
0
votes
0answers
16 views

Google Earth Engine plots DOY chart by MODIS tile, not VI composite date

In Google Earth Engine, it is simple to access and plot time series NDVI data from MOD13Q1 using the ui.Chart.image.doySeriesByRegion() function. However, this function plots the mean NDVI value in ...
0
votes
0answers
21 views

Leaflet invalidateSize not working

I have a Leaflet map div inside another div. The map does not appear correctly (It appears correctly if Map div is not nested). I have tried several CSS options (i.e visible, display ..) to no avail. ...
0
votes
0answers
12 views

Transforming azimuth from EPSG:5514 to WGS84

While showing points on map, I also have to show their heading, given in azimuth, however S-JTSK 90° is not equal to WGS84 90° and I can't seem to find any formula, that would allow me to transform ...
0
votes
1answer
14 views

Finding centroid on multipolygon? [on hold]

I have a response in the below format. ["MULTIPOLYGON(((155883.556336412 210822.648657794,155883.596189326 210822.649920977,155883.635814866 210822.654355722,155883.674961037 210822.661933825,155883....
1
vote
0answers
10 views

Query layer with leaflet-geopackage

I'm trying to find any documentation to help me understand and use the leaflet-geopackage plugin. what I want to do is use the full potential of the .gpkg file as a database and query only part of the ...
2
votes
0answers
44 views

GeoJSON to Leaflet map using Django template

I have a view that returns this GeoJSON data {"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[-74.6739518440393, 40.7747050657312], [-...
1
vote
0answers
19 views

Pros and Cons on loading vector data from ESRI Shape file and Geoserver using OpenLayers 5 [on hold]

I am developing a web map application to show the vector data on top of Openstreet map using the open source technologies such as Openlayers v5.2.0. But bit confused to take a decision in what method ...
1
vote
0answers
12 views

Reading backscatter value of each pixel of Sentinel-1A images in Java? [on hold]

I am new to working with Sentinel-1A images but have better knowledge of Java. I want to get backscatter value of each pixel of Sentinel-1A image, store it and then get the frequency of each value. ...
1
vote
0answers
25 views

ArcGIS API for JavaScript - Search widget with external geocode service

To be brief, I want to add to my Search widget new geocode service that is not exposed by the ArcGIS Server REST API (more precisely - OneMap REST API - https://docs.onemap.sg/). I wonder if it is ...
1
vote
0answers
20 views

Dropping images coming from a certain file inside our map

I've been chraged of this yesterday : Finding a way for the user to drag a picture that he took before and dropping inside the map element this picture is coming from an outside file like D:\images\...
1
vote
1answer
20 views

Filtering earth engine image collection by image ID

I'm trying to filter an image collection using not bands within each image of the collection, but by pattern matching in the image ID. Using: var dataset_2099 = ee.ImageCollection('NASA/NEX-DCP30') ...
3
votes
1answer
40 views

Creating threshold for NDVI using Google Earth Engine?

I want to create a threshold for the NDVIs in this collection. I would like to say something along the lines of: If pixel is less than 0, assign pixel a value of 0; otherwise assign the pixel a ...
0
votes
0answers
8 views

TileLayer.WMS and Map Panes

When I am using TileLayer.WMS and Map Panes. I am trying to put a WMS loaded through TileLayer.WMS into a map pane. Whenever I do that, the WMS is not displayed. Looking at the DOM, the WMS Layer is ...
0
votes
0answers
13 views

Remove map layer when animation restarts Mapbox gl

I am having issues in 'clearing' the map from lines when the user clicks on an element. The idea is to switch between different city-animations on click. For each city, a new geojson is called. The ...
1
vote
1answer
56 views

Making one marker adjustable at a time

This screenshot is an example of what I have to do : This picture was taken on a different and older version of what I have now, since all of the present images were NOT markers bound to the map ...
0
votes
1answer
54 views

How to specify “system:time_start” in time series charts in Google Earth Engine

I want to plot mean NDVI throughout the period of interest. I have a polygon file loaded in Asset called boundary. var start = ee.Date('2017-05-01'); //Dates of interest var finish = ee.Date('...
1
vote
1answer
74 views

Constrain Moveable DND Dojo Popup Window to Map Element

I have a ArcGIS Enterprise (Portal) Web AppBuilder template that I've customized to allow for my pop-up windows to be dragged around the screen, largely using the example located here. The issue I'm ...
0
votes
0answers
9 views

How to get FeatureCollection by loading KML in Leaflet.FileLayer

I am loading a kml file into my map and after presenting this polygon using Leaflet.FileLayer plugin. I want to get all convert kml data into geojson formate. Here is my code: var layer = L.Control....
2
votes
1answer
36 views

Error on showing .js as spatial object with JSON.parse()

I have a Leaflet map exported by qgis2web plugin. The geodata is stored as (Geo-)JSON-objects inside a variable saved as .js-file. I have an attribute field ("bildpfad") with comma-separated pathes to ...
1
vote
0answers
22 views

Why does node Circle to Polygon module returns oval/ellipse instead of a shape like circle?

I'm using npm package circle-to-polygon and I wrote following code to return a polygon which is approximately like a circle. const circleToPolygon = require('circle-to-polygon'); let coordinates = [...
0
votes
0answers
13 views

Openalayers : How to know map container id's from map object

After rendering multiple maps using openlayers , I want check which map is in which div . if (!this.previewMapLoaded) { this.mapService.loadMap('previewmap', 'preview', extent); if (!this....
0
votes
2answers
45 views

GeoJSON coordinate projection

The coords variable has been tested with 3857 and 3067 data. Using the below code, I understand it should expect 3067 and output as 3857. However, 3857 code coordinates work fine (and I assume they ...
0
votes
0answers
21 views

Show / Hide GeoJSON Layers with Mapbox.js

I would like to display two GeoJSON layers on the map using the drop-down menu. In creating the right script I would like to ask for suggestions. Link to my code on JSFiddle
2
votes
0answers
15 views

Caching tiles Leaflet 0.7.7

I've searched here as best as I could, and can't find a direct answer on how I could go about caching the map to speed up loading on zoom. It seems most caching options were introduced in 1.0.0 which ...
0
votes
1answer
30 views

Code from 3067 to 3857, not drawing polygon

Below is a copy of my function, its working without errors. I consloe.log the coords and they are correct, but obviously in 3067 format. If I remove the code for projection, the 3857 coordinates ...
3
votes
0answers
67 views

Markers with customs angle values

I'm trying to make some markers spinnable using this : target = document.getElementById("mapid"); target.ondragover = function(e){ e.preventDefault(); e.dataTransfer.dropEffect = "move"; }; ...
0
votes
1answer
17 views

How to make line size scale dependent in OpenLayers webmap made using qgis2web?

I've made a map in QGIS v3.2 with a vector layer named "Roads." In QGIS, the line widths representing roads are set to "meters to scale." When viewed in QGIS, this behaves exactly as I want. When I ...
1
vote
1answer
34 views

Calculate coordinate for a point along given line

Using Openlayers or plan Javascript, how would i get the coordinate of a point that is 500 meters along this line? Im trying to calculate the coordinate (lat long) x meters along a given line Example ...
2
votes
1answer
54 views

Comparing current image in collection to previous image in collection using Google Earth Engine

I am wanting to subtract one binary raster from another, for all images in a collection. For example if I have ten images, I want to subtract image 2 from image 1, image 3 from image 2, image 4 from ...
1
vote
1answer
51 views

How to slow down mouse before modifyend with openlayers3

I have a map with a draggable marker (ol.style.icon in fact). There is a strange issue: If I try to move marker, it is like trying to reel in a marlin but after a zoomin/out, marker naturally slows ...
0
votes
0answers
13 views

Data-driven cluster colour with mapboxgl

I am trying to draw circle which colour depends on a "group" attribute in my geojson. I followed a simple example with these colours: map.addSource("data", { type: "geojson", data: url, ...
0
votes
0answers
20 views

How to add labels using featurelayer and sceneview in ArcGIS API for JavaScript 4.3

I am using using featurelayer and sceneview in ArcGIS API for JavaScript 4.3 and want to add labels. I have followed code examples from the API documentation but the labels do not show. How do I get ...
0
votes
0answers
15 views

OpenLayers 2 - Swap lines on deeper zoom for view port

Having two linestrings, one with overview path, which uses less points and draws incomplete line - Overview path. And then a detailed one where it loads a lot of points for correct route simulation. ...
0
votes
2answers
150 views

Google Earth Engine API: How to select an image from an image collection based on NDVI value?

I want to select the image with lowest median NDVI to represent bare ground cover from Sentinel-2 image collection for my region of interest (<5% cloud). I have a boundary file pre-loaded on ...
0
votes
0answers
19 views

How to export multiple files from Google Earth Engine [duplicate]

I am new in GEE, working on time series MODIS image. How can I export multiple raster (image) files to my drive from GEE?
1
vote
1answer
46 views

How to get long tap, right click or such events on OpenLayers5?

I want to get some pointer events like long tap right click Are there any examples or documentations for archive them?
-1
votes
1answer
98 views

Blocked loading mixed active content error when loading named map as layer in CARTO?

I am unable to get my layers to draw on my Carto map using https. My map is created I can see the basemap, but the layers do not draw. The layers load locally, but they won't when I host the site on ...
0
votes
1answer
33 views

Counting number of visible entries using jsTree

I'm displaying a tree via jsTree within a jQuery dialog box and that is running fine. Now I want to resize the dialog box depending on the number of visible entries of the tree. Resizing is not the ...
0
votes
1answer
50 views

Display markers and autohide them after few seconds using data of nested JSON object from an API in Leaflet Map

I'm trying to load 4 markers at a time and timeout should be 5 secs for them and then new markers should come up and old one's should be hidden automatically. I have written this code and unable to ...
-1
votes
1answer
25 views

Using html and css, what is the simplest way to create a tooltip that will display the attribute “Risk Score” from a csv called Mains?

I am looking to create a tooltip that displays attributes from a csv when the user hovers over the feature. What is the easiest way to accomplish this? For example, if the user hovers above a Gas ...
0
votes
0answers
31 views

Leaflet.js - Add a filter on a specific Key with pre-existing markers

Going back to my previous question : https://stackoverflow.com/questions/51786003/leaflet-js-create-layers-and-add-markers-depending-on-geojson-category-data (I didn't have a clear answer to resolve ...
2
votes
1answer
71 views

Avoid CORS problems using javascript code loading layers in OpenLayers

I am putting together a basic proof of concept for a client using OpenLayers to compare against Esri Javascript. I understand that the medium to a long-term solution is to enable access on the server ...
0
votes
0answers
44 views

ArcGIS: Pass in a value to an Arcade expression

Is it possible to pass in a variable to an Arcade expression? I have an expression like the following example: var myVar = 0 IIF( myVar == 0, $feature["Age0_4T"], IIF( myVar == 1, $feature["...
0
votes
0answers
30 views

How to Add Animation to ArcGIS JavaScript API Cluster Layer Breaks

Can you please take a look at this demo snippet and let me know how I can add animation to cluster breaks on zoom in out? As you can see in the demo cluster symbols disappear on zoom in, out and re ...
1
vote
0answers
112 views

Show tooltip on the D3 map

I've created a basic map using D3 with countries GeoJSON. Here is the demo. Now when the user clicks on any coordinate on the map, I am showing a weather info within a tooltip with weather icon as a ...
0
votes
1answer
34 views

ArcGIS: Adding labels to 2D FeatureLayer in JavaScript 3.25

Is it possible to add labels to a 2D FeatureLayer in ArcGIS using the JavaScript 3.25 API. I can only find examples that use Javascript 4.8 and 3D scenes. The following code doesn't show anything: ...
0
votes
1answer
39 views

How to change the border of CircleMarker in Leaflet?

I'm using Leaflet 1.3.4 and I want to change the border of CircleMarker (make it bigger). I created it in this way: var geojsonMarkerOptions = { radius: 25, fillColor: "#24D238"...
0
votes
1answer
30 views

ArcGIS: Get layer by name using Javascript API and modify it

I'm very new to ArcGIS and I'm developing a custom widget in the ArcGIS WebApp Builder that will allow me to change the style attribute of a specific layer in my map. To manually change the style ...
0
votes
1answer
46 views

Creating markers within a loop

Using OpenLayers, I want to display multiple markers over an OSM map by creating them from an array within a while loop. The code works when I hard-code a single coordinate, but not when reading the ...