On Oct 13, 5:43 pm, "[email protected]" <[email protected]> wrote: > On Oct 13, 5:21 pm, john <[email protected]> wrote: > > > The east tip is about (-170 degree) and I simply make it (+180) to > > solve my problem. > > I was just curious. Also looking for a better way (instead of finding > > the box with my naked eyes). > > The v2 geocoder returns the LatLonBox, that is what I would use (I > haven't looked at the v3 geocoder, but I would imagine it does the > same...) > And look... it even returns a google.maps.LatLngBounds called > "viewport":http://code.google.com/apis/maps/documentation/javascript/services.ht...
Simple extension of the example referenced in that page: http://www.geocodezip.com/v3_GoogleEx_geocoding-simple-bounds.html -- Larry > > > > > > Thanks. > > > John > > > On Oct 13, 5:53 pm, "[email protected]" <[email protected]> > > wrote: > > > > On Oct 13, 1:34 pm, john <[email protected]> wrote: > > > > > Hi, there, > > > > > Here is what I am doing now: > > > > Manually collect the bounds of the country (latNorth, lngEast, > > > > latSouth, lngWest) and save it in my country database. And with > > > > following (easy) > > > > > var ne = new google.maps.LatLng(latNorth, lngEast); > > > > var sw = new google.maps.LatLng(latSouth, lngWest); > > > > var bounds = new google.maps.LatLngBounds(sw, ne); > > > > > map.fitBounds(bounds); > > > > > Now I want to show Russia. It's east end is actually belong to the > > > > other side of the world. So, my box can only extend east to 180, which > > > > is practically fine. I just curious if there a better way to do this. > > > > > I saw a post (in v2) using GeoCoder but I failed to convert it to v3. > > > > Below is what the geocoder returns for russia. What happens if you > > > use the coordinates from the "LatLonBox" for your bounds? (worked for > > > me...) > > > > -- Larry > > > > { > > > "id": "p1", > > > "address": "Russia", > > > "AddressDetails": { > > > "Accuracy": 1, > > > "Country": { > > > "CountryName": "Russia", > > > "CountryNameCode": "RU" > > > } > > > }, > > > "ExtendedData": { > > > "LatLonBox": { > > > "north": 76.9609558, > > > "south": 31.2057644, > > > "east": 170.8851638, > > > "west": 39.7523482 > > > } > > > }, > > > "Point": { > > > "coordinates": [ > > > 105.318756, > > > 61.52401, > > > 0 > > > ] > > > } > > > > } > > > > > Thanks. > > > > > John- Hide quoted text - > > > - Show quoted text -- Hide quoted text - > > - Show quoted text - -- You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.
