Hello I have a array of coordinates that look something like this: [14.540536348680394,65.03068471588048,18.945463651319603,66.82731528411952] I need to properly display it on my openlayers map but it seems like I must convert the bbox to a valid geoJSON object first. Is there a fuction I can write or a library that can do this for me? Or is there any work arounds
Tag: geojson
Group GeoJson features by property value in JavaScript
I have a list of geojson features that each have an asset ID in their properties. I want to manipulate the geojson so I am left with only a single feature per asset ID, with the properties from each feature found added to the feature properties. As an example, the following geojson has 4 features; 2 of them have an
leaflet load markers and pop ups from external file
I am currently building a leaflet map where I will implement a bunch of markers with popups. I want all of my markers and popups stored in an external file to keep the code as clean as possible. My question is, how can I achieve this? Do I create a geojson file with the markers and popups and if so,
Mapbox JS GL: Filter points by features
I have a mapbox map that displays a number of points from a GEOJson source with several features and independent categories. I want to be able to filter by these features. Ideally when I click on a checkbox filter only the relevant points should remain visible on the layer. So I guess after a click on a checkbox the map
How can you combine GeoJson features by their property value?
TLDR: Can you join together GeoJSON features that have a common property, such that the final polygon is a combination of the smaller features? I’m building a web application that requires me to modify some existing GeoJSON by removing lines between counties, essentially creating larger polygons out of smaller ones. Here’s what the GeoJSON looks like: In this dummy example,
How does one merge coordinate values of an array of geojson items?
Hello I am working with a large geojson dataset, and I am trying to see if I can merge the coordinate values of each entry based on entries that share the same “User_ID”. My dataset look like this: I have tried to merge the entries using the method shown in mwarren’s answer, url: “https://stackoverflow.com/questions/29244116/merge-geojson-based-on-unique-id”. Yet this comes with the small
Dynamically Loading multiple External GeoJson data files and calling multiple layers dynamically using Leaflet
I have about 50 different map layers to be added on a map. Each map layer data is stored as separate JS file (lay1.js, lay2.js, …… lay50.js). Each layer have its own different properties also like Some layers may be polygons, some may be markers etc. My code is almost like as given below. Is there any way to add
How to make to drawing a SVG with D3.js?
I’m trying to draw a map in an SVG with the GEOJSON data that I bring from this API, the SVG paths are filled with the data, however, the SVG is blank, as can be seen when executing the code below. Notice the document.write, the data is returned correctly. I tested it with another GEOJSON file, and managed to draw
GeoJSON file: Refused to execute script from because its MIME type (”) is not executable, and strict MIME type checking is enabled
My web application has a folder named “data” which has .geojson files. When I tried to access my website from Chrome I can see all .geojson files loaded with “200 OK response” Please find below screenshot. But when I see console logs I am getting “Refused to execute script from because its MIME type (”) is not executable, and strict
Is it possible to determine if a GeoJSON point is inside a GeoJSON polygon using JavasScript?
Is it possible to determine whether a GeoJSON point at a given lat,lon lies within a given GeoJSON polygon using only JavaScript (either through d3, topojson, or any other way)? For example, I can draw a map showing countries in the UK based on the tutorial here. I then have a some points which have coordinates but no indication as