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
138 votes
16 answers
89k views

Comparing various JavaScript mapping libraries?

I am working on a web-based mapping system and I'm trying to figure out which library to use. These are links to comparisons of available libraries: Laurent Jegou's benchmark (from 2010) is a global ...
14 votes
3 answers
52k views

Add GeoJSON layer to OpenLayers 3

I have a GeoJSON file called mygeojson.json and I want to add it as a layer in OpenLayers 3 on top of an openstreetmap layer. So far I could display the openstreetmap world including zoom etc. but for ...
Selphiron's user avatar
  • 775
8 votes
2 answers
44k views

Calculate bearing between two decimal GPS coordinates

I'm building a virtual tour application that uses custom panoramas in conjunction with Google's StreetView service. With StreetView, you can have 1 to n links at each particular location to move to, ...
Jason's user avatar
  • 289
4 votes
2 answers
4k views

Smoothing/interpolating across images in an ImageCollection to remove missing data

I have some code that is working properly to calculate the monthly NDVI averages for the previous two years from a date but I sometimes have missing data in some of the months and I would like to get ...
clifgray's user avatar
  • 409
1 vote
1 answer
1k views

Getting Temperature Data of Given Point Using MODIS LST Data?

I am trying to get MODIS satellite data with Google Earth Engine to find temperature data of given points on a map. I would like to get an array of all the points in an area (every 1km square in ...
GGamer's user avatar
  • 57
13 votes
4 answers
21k views

How to overlay lat/lon points on a Google layer in OpenLayers 2?

I'm stuck adding a vector point in lat/lon on top of a Google layer in OpenLayers. The point is moving when I pan the map. This doesn't happen if I replace the Google layer with a layer in WGS84. How ...
underdark's user avatar
  • 83.8k
6 votes
1 answer
9k views

Multiple on-the-fly filtering based on markers' features on leaflet

I would like to filter the markers on my (geojson) layer according to two features: year and type of event, ideally using both filters (year and eventType) as check-boxes without using layerGroup at ...
user134763's user avatar
5 votes
1 answer
1k views

Making a 3D map with shapefiles, lidar and aerial image data

I want to try to make a simple 3D map for a small area (10 square miles) with some housing, some roads and some vegetation on it. My geodata is as follows: shapes with houses/roads/vegetation. ...
DOMINUS MIHI ADIUTOR's user avatar
4 votes
0 answers
2k views

Extract complete pixel values inside a geometry [duplicate]

I'm trying to write an earth engine script which extracts the pixel band values inside a polygon. (geometry) Only for pixels completely within the polygon. The polygons will be quite small. (field ...
Sean Roulet's user avatar
  • 2,170
4 votes
1 answer
6k views

Google earth engine:SST by month per year

I'm trying to plot a chart and get data from Google Earth Engine. I'm using MODIS-Aqua/L3SMI data in Earth Engine. I have used Earth Engines in built functions to compare average sea surface ...
mikejwilliamson's user avatar
1 vote
1 answer
4k views

How to add a bounding box filter to this leaflet WFS request?

I use this function to add an interactive layer to my leaflet application. It works great in most browsers, but fails due to time-out error on certain networks and browsers. The solution I think is to ...
Ilona Kemeling's user avatar
0 votes
1 answer
2k views

Turf intersect point with Leaflet GeoJSON error

Leaflet and Turf. I am trying find all the layers on a Leaflet map that intersect a point when the user clicks on the map. I am using the turf library to test for this. In the console when I click on ...
ziggy's user avatar
  • 4,460
0 votes
1 answer
13k views

Earth engine error: Error: Invalid argument: 'image' must be of type Image

I'm trying to export an image for some SST temperatures for a given region ( and imported table EEZ) but I'm getting the error; Error: Invalid argument: 'image' must be of type Image Map.addLayer(...
mikejwilliamson's user avatar
13 votes
4 answers
5k views

Which framework is best to implement an application robustly, using ArcGIS Server JS API?

Over on the Esri forum, user Matt Moyles suggested that the approach used in the Esri JS samples isn't suitable for robust development of a web mapping application using HTML, JavaScript and CSS: ...
Stephen Lead's user avatar
  • 21.1k
9 votes
1 answer
17k views

OpenLayers 3 create bounding extent which includes two points

I'm working with openlayer3 in my ionic application and am stucked with the problem with creating a bounding extent to get a few points in the viewport. My code looks like this: var destLoc = [6....
Kingalione's user avatar
7 votes
4 answers
19k views

How to get JSON from Geoserver using AJAX request

I am building a web mapping application using Leaflet and a sort of customized WFS-T API to place and retrieve features from PostGIS. I have the script for putting features in PostGIS tables down ...
northlandiguana's user avatar
6 votes
1 answer
7k views

Sketch event in Openlayers 3 drawing interaction

For drawing Polygon in OpenLayers 2 we could use as follow: function drawEnd(){ ... } function putPoint(){ ... } function sketchModified(){ ... } function cancel(){ ... } var ...
Morteza Malvandi's user avatar
5 votes
1 answer
5k views

Earth Engine convert list with coordinates and values into a feature collection for export

I need to create a feature collection from a list containing coordinates and band values. These are extracted from a landsat image as shown in this linked script. Extract complete pixel values ...
Sean Roulet's user avatar
  • 2,170
4 votes
2 answers
16k views

Sending xml post request to geoserver

This may be simple question but I can't get started. This tutorial from pen state university has xml request <wfs:GetFeature service="WFS" version="1.0.0" outputFormat="GML2" – we would like ...
kinkajou's user avatar
  • 4,386
4 votes
1 answer
2k views

Cartodb - SQL query of public visualization of a private table

The team at CartoDB have recently(last few days) made some useful updates that now allow public visualisation maps to reference data in private tables. The change has only been made in the last day ...
user25558's user avatar
3 votes
2 answers
2k views

OpenLayers: Smoothly change tile source on zoom

I'm trying to load tiles from different subdomains depending on my current viewZoom level (i. e. all possible zoom steps). The resolutions for each step are calculated from the user's screen size. ...
Moehrengulasch's user avatar
2 votes
2 answers
3k views

Add a legend in an ArcGIS Javascript API

I am quite new to Javascript. I have made a html script that includes services I published to ArcGIS for server. It all does exactly what I want and I made it by copying working scripts together and ...
Zuenie's user avatar
  • 585
2 votes
1 answer
1k views

Syntax of WFS request in OpenLayers

I am in need of the correct syntax for loading WFS layer using OpenLayers. I have gone through many examples on the OpenLayers site and other examples, but can't figure out how to use the necessary ...
neogeomat's user avatar
  • 8,320
2 votes
1 answer
1k views

Leaflet side by side plugin is not working with imageOverlay

I'm trying to use the side by side plugin. I already check in the issues and change the getContainter() with getPane() in the .js file. this._divider.style.left = dividerX + 'px' this.fire('...
Micmic's user avatar
  • 103
0 votes
1 answer
112 views

Population in upstream area (looping over FeatureCollection)

I want to calculate the sum of the population living in the upstream area of stations using the hydro package by gena. I think I will have to loop over the stations (using the identifier "GEMS_Stati")....
Sven Christens's user avatar
0 votes
1 answer
3k views

Displaying selected layers depending on zoom in Leaflet

It looks like I found the problem between the document.querySelector and map.on('zoomend') function. I was going to set the zoom level for switching off some layers, what has been raised here: ...
Geographos's user avatar
  • 4,005
15 votes
2 answers
8k views

OpenLayers alternatives supporting more client-side features [closed]

I am considering different architectures for a system that will ideally use client-side rendering for point features and must be plugin-free. I have been using this application developed in response ...
tomfumb's user avatar
  • 3,668
12 votes
6 answers
30k views

Openlayers v4.0.1 support Google Maps Javascript API?

I want to know if the latest version of Openlayers (v4.0.1) supports Google Maps as a Tile Layer. I can't find any document ion about this. If Openlayers doesn't support Google Maps, could someone ...
E. Silveira's user avatar
11 votes
2 answers
35k views

Fly To Location in Leaflet

Is it possible to 'fly to location' in Leaflet in the same way as this Mapbox GL example?
Joshua Dickerson's user avatar
11 votes
1 answer
29k views

Convert Multipolygon Geojson to multiple geojson polygons?

I see a lot of questions going from Polygons to MultiPolygon, but is there some easy way to go the other way around? It would also be useful to preserve the attributes from the MultiPolygon to apply ...
Ouwen Huang's user avatar
10 votes
4 answers
18k views

How to display mouse position as tooltip in OpenLayers-2?

I want map coordinates as mouse over effect in OpenLayers. I am using the following code. However it is showing pixel coordinates: map.events.register("mousemove", map, function(e) { ...
thelastray's user avatar
  • 2,864
10 votes
3 answers
5k views

Restrict pan and zoom in ArcGIS Javascript API? [duplicate]

I'm creating a web map of a university campus. I have the map functioning, but I don't want to be able to pan off of the basemap, into whitespace. Do you know of a function that will auto-pan the ...
Tanner's user avatar
  • 7,345
8 votes
5 answers
12k views

How to get a Leaflet app with a big GeoJSON file to work on mobile devices?

I have a leaflet app which displays a GeoJSON file as a layer. It works fine in the web browser. On the mobile browser it starts up, but quits after panning around on the map. I think the reason for ...
ustroetz's user avatar
  • 7,924
7 votes
1 answer
440 views

Find turns in GPS coordinates

Given coordinates, I would like to find jibes/gybes in the coordinates. I will use it to calculate how fast the jibe was. If we look at this file, visualized below, shortened from this GeoJSON file, ...
webjay's user avatar
  • 121
7 votes
2 answers
10k views

How to get layer type in OpenLayers 3?

I would like to iterate through all of the added layers in an ol.Map instance and only select the vector layers. So far I could get the individual layers with the a property of the resulting object of ...
Gabor Farkas's user avatar
  • 4,578
6 votes
4 answers
25k views

Using the Proj4js library to convert from Google Maps to projected values

I'm using the proj4s javascript library (based on advice from this question I asked previously) to convert lat/long values on my webpage. This page receives the lat/long values from google maps and ...
djq's user avatar
  • 16.2k
6 votes
1 answer
6k views

Transparent NoData through WMS in Leaflet

I'm trying to create a Leaflet map with an OpenStreetMap as a basemap and a layer from a GeoServer WMS. I use: var wmsLayer = L.tileLayer.wms('http://localhost:8080/geoserver/workspace/wms', { ...
unnic's user avatar
  • 360
5 votes
4 answers
13k views

How to use Google Maps V3 Geocode with Openlayers

How to use Google Maps V3 Geocode with Openlayers. Below is my code but the function does not execute when I try to integrate it with Openlayers. This works with my original google v3 file. Below is 2 ...
Blake Loizides's user avatar
5 votes
2 answers
20k views

Calculating LST from Landsat 8 in Google Earth Engine?

I'm trying to write a code for Land Surface Temperature (LST) from Landsat 8 images in google earth engine. I'm using the code of this question as a guide and I succeeded at intermediate steps but I ...
pgalansino's user avatar
5 votes
3 answers
18k 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 ...
AdityaDees's user avatar
4 votes
2 answers
4k views

Hiding infoWindow of ArcGIS API for JavaScript while using measure tool?

In my Javascript API Web application I'm using the infoWindow to query a parcel layer and display display information in a popup when I click the parcel. I've set this functionality to turn on and off ...
AlexGilvarry's user avatar
4 votes
2 answers
4k views

Leaflet Sidebar - set content depending on clicked GeoJSON feature

My goal is to set the content of the sidebar depending on what GeoJSON feature was clicked on. For example when clicked on polygon A the content of the sidebar is: "This is A" and when clicked on ...
obrob's user avatar
  • 857
3 votes
1 answer
334 views

leaflet GeoJSON value not variable name

I have a GeoJSON file that has fields of the days of the week like "Monday" with values 'Y' or 'N'. So I want to get today's day value, using something like var theDayValue = 'feature.properties + ...
Bill Chappell's user avatar
3 votes
1 answer
906 views

Error loading geoJSON into map using OpenLayers v4.2.0

I could not get my geoJSON loaded into the map. I used an example code from the web and replaced the coordinates from my geoJSON file. The geometries from the OpenLayers example are shown, but I ...
JAT86's user avatar
  • 922
3 votes
1 answer
5k views

Exporting data with different data types in Google Earth Engine. How to make data consistent to download?

I am working with Sentinel-2 data in GEE and I added NDVI and a specific SAVI as new bands to an Image. I had an error downloading 6 bands (RGBI, and VIs) because the data type is not the same: Error:...
Josep Pinyol's user avatar
3 votes
2 answers
7k views

Leaflet MarkerCluster custom info window instead of spiderfy effect

So I have been experimenting with the Leaflet Marker Cluster and was wondering if there is a way to disable the spiderfy animation and change the event when cluster is clicked on? Instead the clicking ...
Diffusion_net's user avatar
3 votes
1 answer
955 views

Line Layer seems to be floating and shifted after adding terrain effect in Cesium

I had made add a line layer using cesium. In which i had added a terrain effect using the standard cesium terrain provider as below var dataSource1 = new Cesium.GeoJsonDataSource(); var roads = ...
User123's user avatar
  • 2,966
3 votes
0 answers
2k views

Writing code to add calculated image to display in Google Earth Engine?

I wrote a code for Land Surface Temperature (LST) from Landsat 8 images in google earth engine. I have successfully calculated the following steps, NDVI, fractional vegetation (fv), emissivity (EM), ...
Anuruddha Marambe's user avatar
3 votes
1 answer
2k views

Problems with gxp Print plugin via opengeosuite sdk

I am trying to import the print plugin within an application built using the Opengeo Suite sdk and I have run into issues as is described in the following thread https://getsatisfaction.com/opengeo/...
k9ty's user avatar
  • 201
2 votes
2 answers
1k views

OL3: data from WFS is added multiple times

I added a ol.source.Vector to my map which receives data from a wfs. Currently I am using ol.loadingstrategy.bbox because there is a lot of vector data and it would take too much time to load it all ...
smartwepa's user avatar
  • 239

1
2 3 4 5
7