We have implemented google map boundary in our site www.kozaza.com.Yesterday we noticed that multiple lines showing on region boundary.Can you help me to resolve this issue. I believe this is something related with google map code, because we haven't touched our code for last 1 month.
Sounds like google updated their map tiles. You should be able to style the map to remove the existing boundaries if you can't find data for borders that matches them.
Looks like they don't match the boundaries in the Natural Earth data set either:
Related
I'm working on a project where I am showing 8,000+ lat/long coordinates on a Google Map. Works great.
Today I uploaded another 3,000+, and now the Google Map shows a world view of the globe, repeated horizontally, with a lot of gray space on top.
I've looked through the 3,000+ entries, and do not see any where alpha characters, missing lat/long values, etc - something obvious.
The only thing that I can think of is that a lat/long entry is incorrect, and thus the Google Map zoom breaks? Reviewing questions on SO show hacks such as setting minZoom or zoom levels - but I feel that isn't the right path to go across to solve this, since it was working before and something is happening with my new records. I've checked that no pins are on the map outside USA which may cause the entire world view to show.
I'm reaching out to the community to see if anyone smarter than me has a tip or suggestion to help edge case occurrences like this, and/or if my assumption of a wrong lat/long is breaking the Map?
One of your lat/long is incorrect. Instead of Google Maps API failing and alerting, it just breaks the map. I'd advise you to run your locations to confirm decimals exists per each record.
Well I have run into a bit of a small problem and I am not sure how to approach this. I have this test map.
http://www.mesquiteweather.net/googlemap_poly.html
Which creates polygons based on data from this XML file.
http://www.mesquiteweather.net/xml/warnings.xml
It displays weather alerts/watches/warnings etc on the map from the data which makes the polygon that shows what area the alert is in and I have an array in another file that assigns the color. All that works great.
Here is my problem. The XML feed doesn't always display alerts with polygon cords that can be split to create latlng object to create the polygons, I will only get county names half the time so there may be alerts in the feed but they will never get displayed if there is no polygon cords. If you look at the feed for cap:polygon you'll see not all of them have it. Right above it though is areaDesc which is the county name. So is there an easy way to create a polygon base on the county name from that data and how?
I have been searching the web with no results. I did read about fusion tables but will that work and can I use that to draw the polygons based on the data from the feed then have fusion tables draw it out? I don't know, I am doing stuff with Google Maps I have never done before so I am out of my element and could use some guidance and assistance. Any suggestions or advice would be greatly welcomed so I can put this project to sleep.
-Thanks
You can use FusionTables to display a FusionTablesLayer with specific counties on it, and style those polygons dynamically (with up to 5 style rules).
FusionTable containing US counties
Selected counties
Example that displays the counties (using a FusionTablesLayer) on the map
Proof of concept, not sure this will be usable with this many counties.
Probably OK with a small number of counties (your original example)
I have created a map using the Google Maps API v3.
I have created a Fusion Table with a hundred locations (markers) or so and have that successfully pulling into my map.
Now I need to add a search box to this page that will allow the user to enter their zip code and have the map zoom in to that area, then only seeing the locations in that zip code or the nearest locations to that zip code. I would also like the location data to pull into a sidebar as seen with the now deprecated Local Search API.
I have read most (if not all) of the posts that seemed to be about this, but to no luck. I feel like this shouldn't be that difficult really, I mean Google does search primarily right? Yet adding a search bar to my custom map is such a difficult task.
Any help would be appreciated, I have a deadline of tomorrow. Thanks everyone, I love it here.
Ryan
You will need to geocode the zip code and use the results to center the map, then show the markers that fit the bounds of the map if they are not already shown.
See http://code.google.com/apis/maps/documentation/javascript/geocoding.html
There is an example with a search box.
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 have a Google map I have created to highlight the location of several support groups by adding my own pins using my maps and embedding this into my website.
Is there a Google widget of any description to allows people to search my custom map and find their nearest support group (or nearest pin).
I have read through the Google maps stuff but cant seem to find anything that meets my requirements.
Any help appreciated.
The map has no clue about which markers or overlays you have put on it. Therefore there are no way you can do what you want using Google Maps directly. You can however do something else.
When you create your markers/overlays and place them on the map you can add them to an array. When you users then enters a location you can search through that array to find the markers that are closest to the location the user has entered. Google Maps API has a method for getting the distance between two latlngs, but you can also use an ordinary Haversine formula for calculating it.
Once you have found the closest markers it is not hard making sure they are the only ones that are shown on the map.