function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
grahamroygrahamroy 

zoom level and default map type in Salesforce International Mapping using Google Maps

Hi.

 

I have added the 'Salesforce International Mapping using Google Maps' package from Force.com labs and I am using the embedded content in the page rather than the button. I was wondering wether there was a way to change the default map type (to satelite) and the zoom level. 

 

The only settings I can see are for the background colour, height, width etc.

 

Cheers,

 

Graham

Best Answer chosen by Admin (Salesforce Developers) 
grahamroygrahamroy

I've figured this out. Just in case anyone else needs to do this, take the following steps:

 

Go to your name -> set up -> static resources

 

download the zip file called 'GoogleMapsInternational'

 

unzip the file and locate the section shown below and add the two lines I have highlighted

 

// plot address using geocode from Google

map.setCenter(point, 15);

var marker = new GMarker(point, icon);

map.addOverlay(marker);

map.setZoom(21);

map.setMapType(G_SATELLITE_MAP);

// create information window when user clicks on marker

GEvent.addListener(marker,"click", function()

 

save and zip the file

 

click edit within the static resources section where the file was downloaded from

 

upload the file you have just amended

 

The map should now be a satellite one that is very close up.

 

There are several options you can use for the map types

 

map type can be: 

G_NORMAL_MAP displays the default road map view.

G_SATELLITE_MAP displays Google Earth satellite images.

G_HYBRID_MAP displays a mixture of normal and satellite views.

G_DEFAULT_MAP_TYPES contains an array of the above three types, useful for iterative processing.

G_PHYSICAL_MAP displays a physical map based on terrain information.

 

see here: http://code.google.com/apis/maps/documentation/javascript/v2/introduction.html#MapTypes

 

and the zoom level between 1 (very far out) and 21+ (very close): http://code.google.com/apis/maps/documentation/staticmaps/#Zoomlevels

All Answers

grahamroygrahamroy

I've figured this out. Just in case anyone else needs to do this, take the following steps:

 

Go to your name -> set up -> static resources

 

download the zip file called 'GoogleMapsInternational'

 

unzip the file and locate the section shown below and add the two lines I have highlighted

 

// plot address using geocode from Google

map.setCenter(point, 15);

var marker = new GMarker(point, icon);

map.addOverlay(marker);

map.setZoom(21);

map.setMapType(G_SATELLITE_MAP);

// create information window when user clicks on marker

GEvent.addListener(marker,"click", function()

 

save and zip the file

 

click edit within the static resources section where the file was downloaded from

 

upload the file you have just amended

 

The map should now be a satellite one that is very close up.

 

There are several options you can use for the map types

 

map type can be: 

G_NORMAL_MAP displays the default road map view.

G_SATELLITE_MAP displays Google Earth satellite images.

G_HYBRID_MAP displays a mixture of normal and satellite views.

G_DEFAULT_MAP_TYPES contains an array of the above three types, useful for iterative processing.

G_PHYSICAL_MAP displays a physical map based on terrain information.

 

see here: http://code.google.com/apis/maps/documentation/javascript/v2/introduction.html#MapTypes

 

and the zoom level between 1 (very far out) and 21+ (very close): http://code.google.com/apis/maps/documentation/staticmaps/#Zoomlevels

This was selected as the best answer
TellAsiaTellAsia
hi, I can't find a static resource called GoogleMapsInternational - do you have any updated instructions on how to set the zoom level of the Google Map so it's not zoomed in so far?