Re: Data Driven Google Map V2 issue with zoom and focus
Your code is a bit of a mess. It looks like someone may have migrated
from v1 to v2 of the APi without cleaning things up. Or it could be an
attempt at obfuscation. In any case you can get the result you want by
editing the external js file gmaps.js
Change line 86 to
this.map.setCenter(new GLatLng(-41,145.6));
and add this line
this.map.setZoom(10);
and comment out lines 103 and 104
//
this.map.setZoom(Math.min(this.map.getBoundsZoomLevel(map_bounds),
10));
//this.map.setCenter(map_bounds.getCenter());
On Jul 19, 3:53 pm, CoCainUs <cain.laze...@gmail.com> wrote:
> Hi Guys,
>
> this is second attempt at a post regarding a issue I am having with a
> google map I am trying to use within the business catalyst system.
>
> Problem page :http://webitforward.nicheobs.com.au/static_list_demo.html
>
> The map is showing data base markers as it is supposed to in the north
> of Tasmania where I want them but for some reason it does not zoom and
> focus around them.
>
> I am a novice when it comes to javascript and I have stumbling in the
> dark.
>
> What I need is for someone to explain clealy how I can specify how to
> set the zoom level, and the position of a map via the code:
>
> is it something to do with the following lines?
>
> map.setCenter(new GLatLng(-30.4693, 150.0179), 13);
> map.addControl(new GLargeMapControl());
> map.addControl(new GMapTypeControl());
> geocoder = new GClientGeocoder();
>
> or is it something to do with this line of code I keep reading about?
>
> var center = bounds.getCenter();
>
> all the code is viewable within the address supplied above.
>
> The Need - I wish the map to either zoom in a defined area within the
> map window. or simply focuss on the map markers displayed on my map -
> which are called from the listings below displayed on the same page.
>
> I hope someone can help, as I think my free site is starting to look
> good, just don't have the knowledge to follow through it seems.
>
> thanks in advance if some decides to help
> kind regards
> Cain Lazenby
--
You received this message because you are subscribed to the Google Groups "Google Maps API" group.
To post to this group, send email to google-maps-api@googlegroups.com.
To unsubscribe from this group, send email to google-maps-api+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-api?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home