I am having some strange behavior with my leafletjs map. I've tried plotting a few polylines between north america and asia, but get the polyline split into two pieces.
Is there a way to fix this?
You did not add any code with your request so it is no easy to respond you correctly
Likely you need to split each polyline in two parts, else they directly jump to the other part of the world passing over the europe. Then try to center the map on the pacific ocean and not in the europe in order to get a better map.
Related
I have longitude and latitude coordinates which represent different types of geometry shapes (point, multi-point, polygon, multi-polygon and line string etc) that are stored in MongoDB. I'd like plot them (say each shape as a layer) using JavaScript. Map is not needed as a background although these coordinates represent building etc in the real world. I understand there are calculations as such are involved to convert coordinates to x and y on graph/canvas but not sure where to begin tbh. I'm very new to GIS and JavaScript so go easy on me please. I know this question sounds a bit vague but bottom line is I have coordinates that represent real world elements and want to plot them without a map background. I'd appreciate advises and suggestions. Many thanks.
The easiest way to do it is to use a Javascript mapping library such as OpenLayers or Leaflet. You could also do it with D3, although should you want to make your map more full-featured later, it will be much easier with a library that was designed for that type of thing.
If you are storing your data in Mongo as GeoJSON (GeoJSON website), you can add it to OpenLayers as a GeoJSON layer.
Disclaimer- My opinions might be slightly biased because I used to work for Boundless
I have a geoJson data layer of the world from naturalearthdata.com and a working map based on countries (features) with hover colors setup. I want to group the data on continents, so I'd end up with Europe, Americas, Aftrica and Middle East, Asia & Australia.
There doesn't seem to be any examples of this - I wouldn't think I need to change the data since all countries have the continent property. Whats best practice to achieve this?
Just to update, I decided to alter the .shp file in QGIS and merge the individual features to make these larger regions. Took a load of tidying up stray lines with the Node tool but this produced what I needed.
So, I'm trying to draw google maps's polygon for every states in the US.
It's quite simple for colorado but it's getting more complicated for coast states or Hawaii.
I basically need to to draw multiple polygons in one. The idea is to add an opacity on mouse over. So for example when someone mouse over one of the islands of Hawaii, I want to add opacity on all the islands.
Any idea how to do this ?
A google.maps.Polygon takes an array of paths.
example using geoxml3 to create a multi-part polygon of Hawaii
I was trying to create custom overlay for south pole on google map. However, it was not possible to create accurate overlay. I am working on a project where i need to plot many marks on south pole. We will be getting series of longitude and latitude of south pole and we need to plot that into a map. As google does not have a map for south pole, we need to create a overlay or tiles on google. I have tried both of them however, not successful. Please let me know any idea. I can send you some example that i have done. I have followed this example below. However, can't get what we need because of destortion as well south pole right at the bottom of the map where it is completely grayed out on google map.
https://developers.google.com/maps/documentation/javascript/examples/maptype-image
https://maps.google.co.uk/maps?q=google+map&oe=utf-8&client=firefox-a&ie=UTF-8&ei=5UBVUrm1OITI0QXJ6IGwBw&ved=0CAoQ_AUoAg
The map projection from Google doesn't work for the poles. In my opinion you need a transverse mercator projection. It uses the great circle.
What I'm trying to do is finding an elegant way of dealing with multiple markers on the exact same spot on a google map. Possible scenarios are when your geo data just isn't accurate enough to distinguish two markers from one another (say 3 people live in the same house and all you have is an address) or you only have city information of a couple of shops.
Now there is the Clusterer of course, everybody is saying that, but that won't help here as the markers have the exact same location. They will stay clustered regardless of zoom level.
I like the way Google Earth does it. Here is an example. But so far I have not discovered a way to have this behavior in Google Maps. I would be pleased if someone can show me how to do this.
So perhaps as you are looping through your coordinates adding all the markers, you could check if any previous marker has the same latlng. If it has you could use a different marker, e.g one numbered '2'. Or to do the Google Earth thing, offset each marker slightly, and draw a polyline from the markers to the original location.