How to show World Map as default view using Pronamic Google Maps plugin for WordPress

Pronamic Google Maps plugin is the best WordPress plugin for Google Maps

“With this plugin a user can easily add location (latitude, longitude) meta data to a page, post or a custom post type. This plugin adds a meta box with an Google Map to the post editor. Users can easily drag and drop a marker on the map to save location meta data for a post.”

The following code snippet allows you to show World map as default view, instead automatic scaling to the markers

if(function_exists('pronamic_google_maps_mashup')) {
    pronamic_google_maps_mashup(
        array(
            'posts_per_page' => -1 /* show unlimited posts */
        ) ,
        array(
            'height' => 395 , /* maps height */
            'map_options' => array(
                'zoom' => 2, /* showing World map as default view */
                'minZoom' => 2 /* the smallest zoom number - World Map */
             ),
       'map_type_id' => 'roadmap' ,
       'fit_bounds' => false, /* prevent automatic scaling (fitting bounds) */
       'marker_options' => array(
            'icon' => 'http://google-maps-icons.googlecode.com/files/photo.png'
        )
     )
  );
}

We are using Google Maps mashup to show maps from posts with map height set to 395px


Comments

One response to “How to show World Map as default view using Pronamic Google Maps plugin for WordPress”

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: