I'd like to colorize russian map with leaflet.But there is a problem with a region (Chukotka Autonomous Okrug), that is placed on the "bend" line of the map. Part of the region appears on the other part of the map (here's a link to the picture http://i.stack.imgur.com/cQSlG.png). I've already tried to use noWrap option, but it didn't help. Any help will be highly appreciated!
That happens when you cross the international dataline. What you want can be done but you've got to edit your geometries. In your case you would need to add 360 to every coordinate you encounter that's left of the prime meridian, thus every negative longitude. Mapbox has a nice example on the matter:
https://www.mapbox.com/mapbox.js/example/v1.0.0/cross-date-line/
Related
I have an image (represented as green) overlaying a box (represented as blue), and the image is going to be transform: scale()ing in size. When this happens I need all edges of the image to complete their transformation at the same time.
To do this I need to calculate the transform-origin based on where the image is located overtop of the bounding box, using JavaScript. Assume I know all the coordinates that getBoundingClientRect() provides, for both elements.
In the six examples below I’ve placed a red dot where the transform-origin percentages should intersect.
I just can’t figure out the math to get there. The closest I've come to finding an answer is with this question, but it's a little vague and I'm not sure I fully understand the answer itself. I would greatly appreciate help with this, and will happily provide more details if I'm missing something.
After fiddling around, I figured out the formula is:
(
(box.left - image.left) /
(image.width - box.width)
) * 100
I'm using iOS-Charts with Swift to draw line charts, and I'm looking for a way to place a gap between the data points (circles) and the lines themselves.
Something like this: example
I've tried playing around with some values under the drawLinear section of LineChartRenderer.swift, but I don't know enough about Core Graphics to do anything useful.
Having a white outline for the circles is unfortunately not an option, since I'm displaying multiple datasets with images containing transparent layers, and the datasets need to be able to overlap (as in the example image)
Any help would be greatly appreciated - thanks :)
Has anyone had issues with Tableau Maps displaying backwards? I believe the only workaround for this would be to have my own custom background image and supply the min/max lat/lon.
My data is outlined as the following, and is plotted using the lat/lon in the data.
City | Latitude_DC | Longitude_DC
The not-so-evident and not-the-best solution that pops to mind is the one provided in the comments, simply dragging/moving the map using the mouse and publishing the dashboard without resetting the axis.
In your dashboard you can even create a small floating text-box alerting people to not pin the map if it's something you might be concerned.
I'm not sure about how Tableau's algorithm works to decide that the best map position for your data is putting the United States at right, and I don't think there's a real fix for that (if it's considered a bug to be fixed).
I am using Mapbox to build a multiple choropleth map.
Something along the lines of this example, https://www.mapbox.com/mapbox.js/example/v1.0.0/choropleth-joined-data-multiple-variables/
I am using countries instead of US states however.
I've got the map working and I can switch between layers
I have an extra requirement however to add a marker in each country that displays how many projects are active in that country.
I found out how I can add custom markers to the map with this example, https://www.mapbox.com/mapbox.js/example/v1.0.0/divicon/
The problem is I need to put a marker in the center of each country.
Does anybody know a way to put a marker in the middle of each country?
I tried to use the natural earth admin 0 label points data but that has multiple points per country. It looked like the 'scalerank=0' points were the middle of the countries but if I filter on these points, I still get multiple points for some countries (russia has 4 for instance, but Belgium has 4 as well).
If you plot all scalerank 0 points on a map you get the following result:
https://a.tiles.mapbox.com/v4/persyval.jg5p7gm7/page.html?access_token=pk.eyJ1IjoicGVyc3l2YWwiLCJhIjoiX3lrSTNYYyJ9.6Ps4OlBCYmlkxQksKsGb7A#6/45.159/12.206
Does anybody know about a dataset that has one point per country or another way to put a marker in the center of each country with mapbox?
It seems it's hard to find a list of country points for the placing of markers.
So I took the mentioned admin labal 0 points and tried to sanitize it to have only one appropiate marker per country.
The result can be downloaded here in GEOJSON format:
https://drive.google.com/file/d/0B6IQhfb-UYeUYk1mcUZaMmV0S1U/edit?usp=sharing
If you want to have a visual representation of the points take a look at this map:
https://a.tiles.mapbox.com/v4/persyval.jgk4767c/page.html?access_token=pk.eyJ1IjoicGVyc3l2YWwiLCJhIjoiX3lrSTNYYyJ9.6Ps4OlBCYmlkxQksKsGb7A#4/36.49/34.32
I needed this points for a proof of concept project so I haven't checked all markers meticulously, I also haven't taken account some of the more political sensitive country borders.
If you have a project in which this is of importance please check the file before using, but the points in this file can be easily edited to your own preferences.
I tried to display a lot of marker on a leaflet map. The data of the marker - coordinates, text... - are stored in a text file.
I made a parser who parse the text, put the data in a big array and then i loop on this array to display each marker.
My problem here is that i got many markers - more than 200, and many of them got the same coordinates.
My code loops well but display only the last marker with each coordinates, how can i display them all properly?
After digging the web around i find a solution which seems to pretty fit my issue.
Leaflet allows you to create "markercluster" which can gather marker together.
Here is a live example : http://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-realworld.388.html