user756476
user756476

Reputation: 83

KML getting viewport LAT-LONG via NETWORK LINK

I've got all my data sorted and formatted in KML using placemark tags. Because my database is quite large I would like to get the LAT LONG of the top left and bottom right of the users VIEWPORT. Or something like that so I can return an only a small section of my data.

I'm using PHP and guess somehow I can get Google Earth (NOT Google Maps) to GET, POST or PUT something in the Request so that I can process it and return a KML.

I hope thats clear. Thanks

P.S I've got lost a few times in the docs.

Upvotes: 0

Views: 762

Answers (1)

jlivni
jlivni

Reputation: 4779

You can use the BBOX parameter in the <ViewFormat> element -- see http://code.google.com/apis/kml/documentation/kmlreference.html#viewformat for specifics and alternatives, and a more detailed example (the one below is simplified to emphasize the <ViewFormat> tag).

<NetworkLink>
  <name>NE US Radar</name>
  <flyToView>1</flyToView>
  <Link>
    <href>http://www.example.com/geotiff/NE/MergedReflectivityQComposite.kml</href>
    <viewFormat>BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]</viewFormat>
  </Link>
</NetworkLink> 

Upvotes: 1

Related Questions