Objective: I'm trying to trace the NYC Boroughs in an overlay to google maps.
Issue: I can't find a proper shape. If i go to google maps and search for Bronx, I will get a nice outline of the Bronx. My problem is none of the shapes in the google documentation seem to fit with what i'm trying to do. The best match looks like a polygon, but that doesn't work well with all of the borders because of all the jaggedness. I'm trying to use overlays because I need them to be clickable
https://maps.google.com/maps?q=manhattan&ie=UTF-8&hq=&hnear=0x89c2588f046ee661:0xa0b3281fcecc08c,Manhattan,+New+York,+NY&gl=us&ei=thEQUISLBO610AG4qYDYCA&ved=0CKkBELYD
vs
http://jsfiddle.net/xHKB7/5/
I don't need to individually trace each island, as what I'm doing is not that precise - but if you look at queens i don't see how i can reasonably use a polygon to capture this shape
https://maps.google.com/maps?q=manhattan&ie=UTF-8&hq=&hnear=0x89c2588f046ee661:0xa0b3281fcecc08c,Manhattan,+New+York,+NY&gl=us&ei=thEQUISLBO610AG4qYDYCA&ved=0CKkBELYD
I've tried starting at the center, and then tracing the border because i've found this to give me the best detail from all sides, but it obviously leaves this ugly line.
http://jsfiddle.net/xHKB7/6/
FusionTables contains some data that might be useful to you:
Bronx - from New York State counties
Richmond Cty (Staten Island) - from New York State counties
(from this page)
Not sure if this is any better than the one you drew.
Related
I have a custom map from a client. They want to either use Mapbox or google maps to add markers to it. The problem is they've customized how the world map actually looks. It doesn't show on the map image attached, but they cut off Alaska, and want to show it directly under Texas as a floating state. They also want to show so other states in an odd order. To the right of Alaska they want Hawaii, Puerto Rico, US Virgin Islands.
Two issues here:
1) Can this be done? I can't find any information about cutting pieces of a map up by moving states around.
2) If I CAN do this, will the geocoding still work for the map? Cause now Alaska is way the heck down there.
As far as I know, yes to both of your issues.
Now, to answer your issues:
1) Can this be done? I can't find any information about cutting pieces of a map up by moving states around.
As discussed in Translate your project from Google to Mapbox, you have options to customize maps and features. Then, any customized project created in the Mapbox Editor or uploaded from Mapbox Studio Classic will have a Map ID. Use the Map ID when initializing the map to add it as the active layer.
2) If I CAN do this, will the geocoding still work for the map? Cause now Alaska is way the heck down there.
Yes, geocoding will still work. With Mapbox, L.mapbox.geocoder() will gladly geocode your addresses.
Please try going through the given documentation for more information and for sample codes. Hope that helps!
Is there a way to insert the image overlay a layer below the streets but on top of the map background? The roads can be individually styled, so it should technically work, but I haven't been able to find the option for it.
The only lead I have found so far is this question: Google Maps API - Overlay Custom Roads
Which unfortunately doesn't really solve the problem of having to manually enter the street info.
I'm currently working on a custom map for a whole city and manually illustrate all the streets and enter the street names would take an enormous amount of time.
Any info would be very appreciated, thanks!
Try to check this documentation about Styled Maps. Styled maps allow you to customize the presentation of the standard Google base maps, changing the visual display of such elements as roads, parks, and built-up areas.
Here you can also find some sample code that you can use in your sample code.
Also you can find here the Styled Map Wizard.
Creating styles by hand and testing your code to see how they look is potentially time-consuming. Instead, you can use the Styled Map Wizard to set up the JSON for your map's styles. The wizard allows you to select features and their elements, apply operations to those features, and save the styles to JSON, which you can copy and paste into your application.
I am doing some research for what Map API to use for a coming project.
The main requirement is the ability to lock a map, and the ability to disable parts of the map.
Think about a special purpose map for Europe where I would like to disable and gray out the non-european countries.
A click on those grayed out areas should do nothing, meaning for all of the world except for Europe.
So, is it possible to disable large portions of the map?
Is it possible to add layers for the borders for each country, that is clickable, for instance on Germany?
I am looking at Bing or Google Maps at this point. Which one is more developer friendly one?
Bing looks so much nicer with the birds eye, much easier to read out the map and know what you are looking at. I find Googles full of clutter and always have problem knowing what I am looking at.
Possible approach(google-Maps): use a Polygon with multiple paths.
1 path for the entire world(vertices defined in clockwise order)
other paths for the enabled area(vertices defined in opposite clockwise order)
The result will be a polygon that covers the entire world with a hole for the enabled area. The map will not respond to click-events outside the enabled area(because it's covered by the polygon). The map will still respond to dblclick and zoom in, but this may be avoided by cancelling the propagation of the dblclick-event of the polygon.
It wouldn't be possible to gray out the dissabled area, but you could use the fillColor of the polygon to signalize which part of the map is disabled.
I have the following kml polygon:
<Polygon><outerBoundaryIs><LinearRing><coordinates>20.002,80.002 20,80.002 20,80.004 20.006,80.004 20.006,80.001 20.002,80.001 20.002,80.002 20.004,80.002 20.004,80.003 20.002,80.003 </coordinates></LinearRing></outerBoundaryIs></Polygon>
If I view this polygon in a cell in my fusion table, in the Table View of Google Fusion Maps, it looks like this:
However, in the actual google map, in the Map View, it looks like this:
The duplicate point has been rather annoyingly dropped. I want what's shown in the first diagram above, but how should I change my polygon to get the same shape in google maps?
I also tried with an inner bound, but no luck there either:
<Polygon><outerBoundaryIs><LinearRing><coordinates>20.002,80.002 20,80.002 20,80.004 20.006,80.004 20.006,80.001 20.002,80.001 20.002,80.002 20.004,80.002 20.004,80.003 20.002,80.003 </coordinates></LinearRing></outerBoundaryIs></Polygon>
Thanks,
Barry
Self-intersecting polygons require quite a bit of extra power to draw correctly, so they are not widely supported in all 2d rendering APIs / implementations.
I suggest you work around the problem by splitting your polygon into two pieces.
Ok, I think I have the answer. I can add a tiny offset (jitter) to one of the two duplicate points in the polygon. However I must add the jitter in the correct direction otherwise the polygon becomes invalid and google no longer draws it. Looking at the previous points in the polygon loop, I should be able to establish in which direction I need to apply the jitter in.
<Polygon><outerBoundaryIs><LinearRing><coordinates>20.002,80.002 20,80.002 20,80.004 20.006,80.004 20.006,80.001 20.002,80.001 20.002000001,80.002 20.004,80.002 20.004,80.003 20.002,80.003 </coordinates></LinearRing></outerBoundaryIs></Polygon>
I am using the following hyperlink to display a set of coordinates in Google Maps. It is working great. However, is there a way to have it display the road labels as well?
I do realize that if i change it to hybrid instead of earth, (by changing the "e" to an "h") it will, but our customers are liking the earth view.
http://maps.google.com/maps?f=q&hl=en&geocode=&q=36.070690,-95.807090%28LineStat%29&t=e
Thank you very much
If you link to -
http://maps.google.com/maps?f=q&hl=en&geocode=&q=36.070690,-5.807090%28LineStat%29&lci=transit
You get the option to switch to earth mode - and when you do the road labels are present...
AFAIK there is no way to enter the earth view with the road layer toggled.
You can see a pretty good list of the available parameters here.
http://mapki.com/wiki/Google_Map_Parameters