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.

0
votes
1answer
19 views

OpenLayers/Geoserver rendering transformation is failing at the Prime Meridian

I have a layer that represents surface pressure in GeoServer. I am using a rendering transformation SLD to generate the contours. When I try to map it in OpenLayers, the contours show up fine when ...
0
votes
2answers
22 views

Convert a list into ee.FeatureCollection in Google Earth Engine

Starting with this, I have // load var landCover = ee.ImageCollection('MODIS/006/MCD12Q1'); var country = ee.FeatureCollection('USDOS/LSIB_SIMPLE/2017'); // filter // filter on image for 2017 and ...
2
votes
2answers
110 views

Import local GeoJSON file into Leaflet

I just used a leaflet. From the geoJSON demo page I saw if you want to include data you have to use <script src="data/us-states.geojson"></script> and if you open the files looks like ...
0
votes
0answers
16 views

Determine if markers are inside of the circles array?

I have a problem in determining if markers are inside of the circle array or not. The code that I have provided manages to know the markers only for one to two circles while the rest does not know. ...
0
votes
1answer
16 views

Get tiles to appear after fitBounds call on one marker on mobile only

I am making a Leaflet 1.3.4 map. When I added fitBounds to the code, I experience a problem when viewing the map on my iPhone XS. Map displays fine on the desktop but regardless of browser (I have ...
0
votes
1answer
15 views

maskClouds vs filter clouds on Google Earth Engine

On Lab 6: Time series analysis from https://developers.google.com/earth-engine/edu, there is maskClouds: var maskClouds = function(image) { var quality = image.select('BQA'); var cloud01 = ...
0
votes
0answers
16 views

Masking clouds on Landsat8 vs Sentinel2

https://code.earthengine.google.com/dff0d955447b5f0e94998ed2fcd0cf29 Thinking about an adaptation of Landsat time series example to Sentinel 2 instead, I'll say that code has three parts which appear ...
0
votes
1answer
27 views

Display leaflet layerswitcher on click event

I would like to click on a sidebar/menu icon, and when I do the layerswitcher Icon should appear. Right now the layerswitcher is always displayed. I know how to make it disappear with the command ...
0
votes
1answer
39 views

FitBounds after L.GeoJSON.AJAX has loaded

I am making a Leaflet 1.3.4 map that will show members based on category. I have a php file "cs.php" that queries a MySQL and returns an option menu of distinct categories. When a category is selected ...
0
votes
0answers
22 views

Using GEE to create graphs of population density vs. anything else? [closed]

This is my first time experimenting with GIS data. I have been trying to produce a graph of population density a function of temperature using Google Earth engine. Is that even possible? If so, I'd ...
0
votes
1answer
13 views

Removing leaflet Tooltip from L.geoJSON layer

I'm aware that there is unbindTooltip(). But I am not sure if that will work in my case. The first problem may be the fact that I need to convert it out leaflets geojson format? The second problem ...
0
votes
1answer
28 views

Why am I unable to display attribute data in map?

In the JSON file I have an attribute called FairValue which belongs to the polygon feature class. Similarly there is another attribute called Survey_Num. I want to display both these attributes on ...
0
votes
1answer
19 views

Adding markers to a layer at runtime

I would like to use two layers (units, calls) over the streets base map. I have a timer loop that runs every 30 seconds and I would like to clear the units layer, then add the new unit markers to the ...
0
votes
0answers
25 views

Accuracy in meters to decimal offset for navigator.geolocation data

I'm collecting data from the navigator.geolocation api. The data returned includes not only lat/long in decimal but also an integer value, accuracy, to express the accuracy of the data in meters. ...
1
vote
1answer
27 views

Toggling leaflet controls ON and OFF?

I want to toggle the Leaflet layer control when the user clicks in a button. var layerControl = L.control.layers( { '<i class="fas fa-map-marked"></i>': OSM, '<i class="fas ...
0
votes
1answer
26 views

Principal Component Analysis (PCA) issue on Spectral indices and transformations of Earth Engine

Following the Principal Component Analysis (PCA) section on Lab 4: Spectral indices and transformations from https://developers.google.com/earth-engine/edu I reached a point which its not clear, in ...
0
votes
0answers
18 views

How do I call point marker icons from geojson data in leaflet

I am trying to make a map for school with unique icons for each point which I have stored in my geoJSON under "iconURL" as .png. I don't exactly know how to add them to my map. The following code ...
5
votes
2answers
72 views

What are the min and max values of Map.addLayer on Google Earth Engine?

I'm starting to play with Google Earth Engine. Following https://developers.google.com/earth-engine/image_visualization I see its possible to set min/max values. May I ask the meaning of this and ...
1
vote
1answer
45 views

Geting fitBounds and removeLayers to work in Leaflet

I am making a Leaflet map that gets its marker and popup information from a database. I have a dropdown that allows me to retrieve a subset of the entire database based on category. The drop-down and ...
0
votes
1answer
21 views

Google Earth Engine filterdate ignored by plot?

I'm starting with Earth Engine (EE) coding. Following instructions from https://developers.google.com/earth-engine/tutorial_api_07 I was able to put together some code and get a plot. But why the ...
1
vote
0answers
11 views

Open Layers squished tiles until page zoomed

Upon initial load the map tiles are squished or sometimes do not appear properly as per image below. This is fixed when the page is zoomed in and out (not the map). This is when the page is viewed on ...
0
votes
0answers
10 views

Getting Error, “Cannot read property '0' of undefined” when try to bind ajax() data into Grid

code-Js:... map.on("load", initToolbar); function initToolbar(evtObj) { map.graphics.clear(); tb = new Draw(evtObj.map); tb.on("draw-end", doBuffer); //click handler for the draw ...
0
votes
1answer
16 views

Customize behaviour of Ol.interaction.draw.createbox() geometryFunction?

I'd like to enable a draw function in an Openlayers 3 application for drawing a rectangle - up to a certain size (in the defined projected coordinate system, in square meters). For this ol....
-1
votes
1answer
25 views

Exclude specific GeoJSON data by polygon [closed]

Given geospatial data as GeoJSON, how can I filter this data to exclude geometries within a specified polygon? I need this to work in JavaScript. Example: function filter(featureCollection, ...
0
votes
1answer
56 views

How to temporary disable map click event in OpenLayers

How can I disable map click event? My idea is to disable it when I am positioned with mouse over my popup container. After I move mouse out of it, I want that event is enabled again. Something like ...
11
votes
5answers
1k views

Calculating correct longitude when it's over |180|?

I'm trying to develop a "formula" to correct the lat-lng values. I'm using vue-leaflet but when you pan outside the "first" world you get big numbers. Over +180 or under -180. For example: when I ...
0
votes
1answer
27 views

Hide null value attributes in Leaflet popup

I have marker properties which are fetched from the database and displayed as a table. I want to hide the "reply" feature property when it's null and display it only when there is a text entry against ...
0
votes
0answers
71 views

Making Leaflet map or satellite view like Google Maps using JavaScript?

I'm looking for a solution to create a box to switch between map / satellite layers, like Google Maps has. Could someone help in creating this switch style like Google Maps? What I have using Leaflet ...
1
vote
1answer
32 views

Clipping/cropping/masking a raster tile layer in Mapbox GL JS

I'm loading Landsat tiles into a Mapbox GL JS map via an AWS S3 tile server, and this is working OK, but what I'd really like to do is clip the tile layer to a GeoJSON polygon which is loaded in ...
0
votes
0answers
16 views

Earth Engine: Entering the time period in the panel

Good day everybody! I am working with MODIS NDVI and I made a script which is exporting as a chart (in panel) the NDVI values of given coordinates (with cursor) for given period in the script. I was ...
0
votes
1answer
55 views

Why is my openlayers map not showing?

I'm trying to create a plunker to find out a solution when adding projection list in Openlayers. But when I add a sample map, it's not showing the map and there is no error in the console either. ...
0
votes
0answers
26 views

Get coordinates from the OpenLayers drawn feature and redraw it again in OpenLayers?

I am drawing a polygon a extracting it feature coordiantes on "drawend" using the code var feature = evt.feature; var featureArray = feature.getGeometry().getCoordinates(); and it is giving me an ...
3
votes
1answer
75 views

Problems using a “custom” projection with Leaflet

I'm currently trying to display a dataset on a webapp using Leaflet. All the dataset is projected into French projection Lambert II ESPG 27572. Instead of converting coordinates, I'm trying to setup ...
1
vote
0answers
22 views

Dynamic colouring of SVG-icons in OpenLayers 2

I've got an OpenLayers 2 map with a lot of point features that need to be represented using a number of different SVG-symbols. Unfortunately, the marker icons need to be displayed in different ...
1
vote
1answer
39 views

Extracting mean values in Earth Engine

I am trying to extract the dates and mean NDVI values of a processed Google Earth Engine image collection thru Python. All goes well until I try to use getInfo(), where I always encounter this error: ...
0
votes
1answer
51 views

Earth Engine chart image series by region tripped up by geometry

ui.Chart.image seems to get tripped up by Landsat data. I've encountered the same error using Landsat 5, 7, and 8 and with several shapefiles so I'm confident it isn't a problem with the regions I'm ...
4
votes
1answer
40 views

How to change attributes of leaflet-sidebar-v2 based on 'id'?

I using leaflet-sidebar-v2 and I'm wondering how can I change the attribute of a tab based on their id: ctlSidebar = L.control.sidebar({container:'sidebar_div'}).addTo(mymap); ctlSidebar....
0
votes
1answer
53 views

How to highlight marker dynamically with leaflet and leaflet draw

I am trying to make a selection via drawing a rectangle (or any shape) with leaflet draw. The selected features should be highlighted. I saw that there are various functions within the leaflet source ...
1
vote
1answer
37 views

Google Earth Engine Modis Data Scaling

I'm new to GEE. I'm currently working on NDVI data analysis. So this is my code for MODIS Ndvi. I want to know how to divide all the images there inside ImageCollection by 10000 to get real NDVI ...
1
vote
1answer
19 views

Mapping a function over a Collection

I would like to calculate a MSI index for the each image of the collection and I developed below presented script. But, somehow it is not working and it says "midir.divade is not a function". Can ...
0
votes
1answer
48 views

GetFeatureInfo from Image WMS

I have a problem with GetFeatureInfo (I'm working with openlayers). In my HTML file I have this: <div id="map" class="jumbotron"> <h1>Sieraków <span class="badge badge-...
1
vote
0answers
29 views

Algorithm to cluster coordinates within a maximum radius [closed]

I am looking for an algorithm that will allow me to find the centers of clusters of an arbitrary radius, such that all coordinates are covered. Currently, I am doing a very basic routine where I ...
0
votes
2answers
58 views

How to fit bounds after adding multiple markers

I am using this piece of code to display map markers pulled from a MySQL database using leaflet js on an open street map, but the map bounds are obviously hard coded at the top (with setView), and I ...
0
votes
0answers
29 views

How can I generate the default gmaps heatmap gradient?

I used the gmaps library in Python to plot latitude and longitude values to generate a heatmap which looks like this Image. I used the default gmaps gradient - red, yellow, green. I searched the ...
0
votes
0answers
37 views

Monthly NDVI image using Collection Slider program in Google Earth Engine

I can get yearly ndvi image but unable to do the same on monthly basis. Slider is not giving the option to extract image monthly. code link: https://code.earthengine.google.co.in/...
0
votes
0answers
21 views

ArcGIS JSAPI Dynamically update 'isEditable' property on AttibuteInspector FieldInfo

I'm using the ArcGIS Javascript API 3.26. I'm trying to dynamically update the 'isEditable' property on a fieldInfo. I want to set the 'isEditable' property to true when a user selects a certain ...
1
vote
0answers
7 views

AngularJS Leaflet plot and remove markers via options

I have something that look like below, and when a user clicks on "View on Map" it changes to "Remove Markers". So the problem I am having now is that, when a user clicks on all three View on Map items,...
0
votes
0answers
46 views

How to update the markers in real-time using ajax

I am facing some problem where the markers is not being updated when the values in the database changes(i am using a stored procedure which get the latest location based on the timestamp). ...
1
vote
1answer
30 views

OpenLayers 4 popup from multiple layers with different source

When I click on the map I need to create a popup and query the 3 layers (at the time I'm writing I have just 2 but they will be 3). Here my code: amfeatlayer = new ol.layer.Tile({ extent: ext, ...
0
votes
0answers
20 views

Get lat-lng after popup drag end

How can I get location of popup aftar drag event ends in this code. layer.on("click", function(e) { let popup = L.popup() .setLatLng(e.latlng) .setContent("sample popup") .openOn(map); ...