4

From the doc: getFeatures(): Get all features on the source in random order.


3

To access features in order you would need a features collection: var Source = new ol.source.Vector({ features: new ol.Collection() }); Source.addFeatures(new ol.format.GeoJSON().readFeatures(geojsonObject)); console.log(Source.getFeaturesCollection().getArray());


3

Calling map.updateSize() is the right solution, but it's not enough. It has to be called at the right time, after side menu animation is finished. The simples solution is to use setTimeout call with the proper delay. Code would then look something like this: function w3_open() { document.getElementById("main").style.marginLeft = "25%"; document....


2

If you use document.getElementById method to get HTML element, then you must use it's innerHTML property to change it's content. This should work without need for jQuery: map.on('pointermove', function(event) { var coord3857 = event.coordinate; var coord4326 = ol.proj.transform(coord3857, 'EPSG:3857', 'EPSG:4326'); document.getElementById('...


2

Try using image operator, like: water = evi.lt(0.1).and(mndvi.gt(evi).or(mndvi.gt(ndvi)))


2

IvanSanchez is rigt about first problem: layer with markers has to be added to the map inside the (async) callback function for the $.getJSON call. Bill Chappell is right about danger of using absolute path to resources. Paths should be always relative to the main HTML page with the map. Best practice is to put them in subfolders of folder with map HTML ...


2

This is also an issue: <script src="C:\ICBHI\test\leaflet.ajax.min.js"></script> <script src="C:\ICBHI\test\jquery-1.9.1.min.js"></script> <script src="C:\ICBHI\test\leaflet-providers.js"></script> These should be off a web site. I'm betting if I view the site from another PC, those files are not on my C:\ drive, so ...


1

Obligatory XKCD reference: More detailed answer


1

I'm not exactly sure what you're looking for, but if it is to pare down the landcover layer to only water/not water, then you can do something like the following, which selects only the LC_Type1 band, loops through each image in the image collection and creates a boolean output for whether or not the band value equals 17. var Landcover = ee.ImageCollection("...


1

In terms of syntax, the request would be curl --header "api-key: xI234fg543example23" -X GET "https://api-hazards.atcouncil.org/public/v1/[load_category].json?lat=[lat]&lng=[lng]" If you want to pass the API key in, you can concatenate the key variable with your string, something like: var curlrequest = 'curl --header "api-key: ' + key + '" -X GET "...


1

First it has to be noted that solution below is modification of Leaflet.CountrySelect plugin, written by Anika S. Halota. Requirement that control would work with any JSON file is to broad, since file must have defined structure that plugin can work with. Since file has to include geometries, the obvious candidate is then GeoJSON feature collection, where ...


1

You can use sum() reducer to compute frequency. I took your code to reduce it and change the approach. As I said to you in another post, reducers need to be applied as the last process. The process itself is just: var decision_tree = function(image){ var mndwi = image.normalizedDifference(['B3', 'B6']); var evi = image.expression( '(NIR - RED)/(NIR+...


1

You probably just want to chart trendlines in your graph: // Make a band correlation chart. var chart = ui.Chart.array.values(yValues, 0, xValues) .setSeriesNames(['B5', 'B6']) .setOptions({ title: 'LC8 TOA B4 vs. {B5,B6}', hAxis: {'title': 'B4'}, vAxis: {'title': '{B5,B6}'}, pointSize: 3, trendlines: { 0: {showR2: true,...


1

Since you have already compiled your values in yValues object, you can use the linear fit reducer to obtain the constants. print(yValues.reduce(ee.Reducer.linearFit(),[0],1)) The above line should get you the value of constants for the linear fit. The reducer takes 3 parameters among which first is the reducer, second is the axis (or axes) of features and ...


1

Simple using nominalScale() e.g. https://code.earthengine.google.com/1a0a8d7c5076009238bcf23000174698


1

Note that the return value of aggregate_array() is an ee.List(), which you can discover by printing it (the docs are not obvious about this). The ee.Feature constructor expects an ee.Geometry and optionally properties. You're not supplying that, which is why it's not working. Here's an example of how to fix that: var s2aprop = ee.FeatureCollection([ ee....


1

You may use just an empty style as map option, there is no need for mapboxgl.accessToken = 'myToken'; : <script> var map = new mapboxgl.Map({ container: 'map', style: { version: 8, sources: {}, layers: [] }, center: [-87.61694, 41.86625], zoom: 15.99, pitch: 40, bearing: 20 });


1

You can skip the query and use definitionExpression if you want to filter the displayed data. Here's a working example - based on your code.


Only top voted, non community-wiki answers of a minimum length are eligible