geojson

Scaling d3 v4 map to fit SVG (or at all)

假如想象 提交于 2019-12-27 10:39:41
问题 I am trying to make this map of the us scale smaller. Either to my SVG, or even manually. This is my code in its simplest from: function initializeMapDifferent(){ var svg = d3.select("#map").append("svg") .attr("width", 1000) .attr("height", 500); d3.json("https://d3js.org/us-10m.v1.json", function (error, us){ svg.append("g") .attr("class", "states") .selectAll("path") .data(topojson.feature(us, us.objects.states).features) .enter().append("path") .attr("fill", "gray") .attr("d", d3.geoPath(

Google Map itinerary from geoJSON file

天涯浪子 提交于 2019-12-25 18:48:32
问题 I'd like to draw an itinerary between 2 markers which are defined in this geoJSON file: { "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": {"type": "Point", "coordinates": [-73.563032, 45.495403]}, "properties": {"prop0": "value0"} }, { "type": "Feature", "geometry": {"type": "Point", "coordinates": [-73.549762, 45.559673]}, "properties": {"prop0": "value0"} } ] } The two markers are displayed well on the map. Now I want to create an itinerary (car), between those

Google Maps API: getFeatureById for feature collection not working

故事扮演 提交于 2019-12-25 08:58:42
问题 I try to change the style of a specific feature of a feature collection data overlay. This is a snippet of my json: { "type": "FeatureCollection", "features": [ { "type": "Feature", "id": 1, "properties": { "name": "1 CBD - Bankenviertel", "color": "transparent", "isHovered": false, "isActive": false }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 8.67279430349, 50.1143807311 ], [ 8.67280054398, 50.1143975981 ] ] ] } } and this is the relevant snippet from my map.js map.data

Selecting leaflet markers

强颜欢笑 提交于 2019-12-25 07:14:20
问题 I have data coming from a Json file and I created a layer based on this Json file using markerClusterGroup. I am hitting the wall trying to do this: 1 - Select some markers based on some Json's feature ("temperatura", "salinidade","corrente", "profundidade" e "geofisico") in xbt.json and using a select list in the HTML: <select name="sometext" > <option value="temperatura">temperatura</option> <option value="salinidade">salinidade</option> <option value="corrente">corrente</option> <option

Loading polygons from MongoDB that entirely contain a known polygon

对着背影说爱祢 提交于 2019-12-25 04:26:11
问题 We have a set of GeoJsonPolygons stored in MongoDB and we're using C# to interact with Mongo. Previously we were loading polygons which contained a GeoJson.Point by using: var point = GeoJson.Point(GeoJson.Geographic(known.Longitude, known.Latitude)); var query = Query<OurStoredPolygons>.GeoIntersects(x => x.Polygon, point); var polygonsThatContainTheKnownPoint = collection.FindAs<OurStoredPolygons>(query); Now I want to load polygons if another known polygon is entirely within them. I can do

Turf.buffer and a draggable marker

删除回忆录丶 提交于 2019-12-25 02:06:37
问题 So far I have created a marker, transfered it to geoJSON, and created a buffer around it with Turf.buffer. How can I get this buffer to "stick" to the marker as I drag it around the map? <script> L.mapbox.accessToken = 'fg.eyJ1IjoisdflksdaklsjZWwiLCJhIjoiRHNwX0ZWNCJ9.Ov2O5sslkdqV93_R0lq3Q'; var map = L.mapbox.map('map', 'example.kf6j9ec4') .setView([38.633, -90.319],12); var marker = L.marker(new L.LatLng(38.633, -90.319), { icon: L.mapbox.marker.icon({ 'marker-color': '1B05E3', "marker

Convert Mongodb schema including nested Object

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-25 01:55:13
问题 Suppose a mongodb collection schema like this: { "_id" : ObjectId("5a5b2657a19692e18a3792ad"), "Toponym" : "Climate station Stavenhagen", "Lat" : 53.33333, "Lon" : "13.99999", "SensorMaker" : "Hitachi", "SensorClass" : "Thermometer", "Dimension" : "SoilTemperature_0.05mSensor1", "Gauge" : "degC" } And I would like to change the complete collection (~ 90k items) to this, to conform to minimal GeoJson: { "_id" : ObjectId("5a5b2657a19692e18a3792ad"), "Toponym" : "Climate station Stavenhagen",

Polygon layer has a white background which covers base maps

帅比萌擦擦* 提交于 2019-12-25 00:43:17
问题 I am currently creating a webmap with leaflet. I used leaflet.ajax to import polygons from a geojson. But the new polygon layer covers the basemap, resulting in the polygons on a white background. https://virgilxw.github.io/Singapore_Election_1955/ If you go the github page and navigate to the layer menu, you can find the polygon layer under "Data". I have tried re-ordering the layers, but moving the base map above the polygons just result in the polygons being covered. // Default base Map

GeoJson/Mapbox markers: let users change their attributes (e.g. color) via a button [EDITED]

余生长醉 提交于 2019-12-24 19:31:34
问题 (EDIT:I received some thumbs down because accidentally posted the question with an unfinished name, please don't be deterred) As in the example of https://www.mapbox.com/mapbox.js/example/v1.0.0/change-marker-color-click/ I'm trying to let the user change attributes (in this example the color) of markers. In this example of Mapbox the attribute of a marker is changed when the user clicks on the marker. However, I would like to change the attribute of markers when the user clicks on one of the

Leaflet geojson update draggable state or marker

拥有回忆 提交于 2019-12-24 18:45:23
问题 I would like to know if it's possible to update the draggable event of a marker inside a GEOJSON layer in leaflet, I know I can do this by adding: layer.options.draggable = True Inside the onEachFeature function, what I'm trying to achieve is, to update the draggable options on an element click, something like: $(document).on('click','#someButton',function(){ layer.options.draggable = True; //Only one specific marker }); This way I would like to have all my marker with draggable options