HOW TO add random markers to a map BUT avoiding the sea?

前端 未结 3 1688
感动是毒
感动是毒 2020-12-29 16:54

The Google Ajax API playground (http://code.google.com/apis/ajax/playground/?exp=maps#map_markers) provides a nice exemple to add random markers to any map:

         


        
相关标签:
3条回答
  • 2020-12-29 17:28

    One possibility would be to send a reverse geocode request for every point you generate. Points over water would return a "G_GEO_UNKNOWN_ADDRESS" (602) status code. However, you'll need to test it thoroughly to make sure that it will work. It's possible that a few locations on land might be returned as unknown.

    0 讨论(0)
  • 2020-12-29 17:41

    I'm creating a C# program that takes the users input as where they want to go and then based on that, it points them to a random location that matches their specifications.

    "http://maps.google.com/maps/geo?q=29,-55" is the webpage that i'll use to determine if it's on land or not.. take a look at the specific "Accuracy: 0" string of the results of a page. If it's accuracy 0 then it's in the ocean. If it's 1 or higher then it's on land.

    0 讨论(0)
  • 2020-12-29 17:43

    I don't know about the Google Earth API but you can achieve this another way. Download the Nasa blue marble bathymetry map and create a bitmap of sea areas. Then map these coords to long/lat and you have a way to test for seas and lakes that you can use in conjunction with the google maps api.

    0 讨论(0)
提交回复
热议问题