• Hiya – hope you can help..

    I’m using the excellent Pronamic Google Maps plugin but no matter what I do I can’t figure out how to get the mashup map to centre on coordinates of my choice.

    The is the code I’ve used:

    <?php
    $iconurl = get_bloginfo('template_directory').'/library/images/emw-icon.png';
    
    if(function_exists('pronamic_google_maps_mashup')) {
    	pronamic_google_maps_mashup(
    		array(
    			'post_type' => 'branches'
    		) ,
    		array(
    			'width' => 300 ,
    			'height' => 450 ,
    			'zoom' => 5 ,
    			'latitude' => 21.414145 ,
    			'longitude' => -10.414145 ,
    			'fit_bounds' => false ,
    			'map_type_id' => 'terrain' ,
    			'marker_options' => array(
    			    'icon' => $iconurl
    			),
    			'map_options' => array(
    				'streetViewControl' => false,
    				'disableDefaultUI' => true,
    				'draggable' => false,
    				'disableDoubleClickZoom' => true
    							)
    	));
    } ?>

    As you can see I’m using a custom post type and my own icon, which both work fine.
    I want the map to be completely static so have removed user controls.

    Setting the zoom level works, but I’m stuck trying to get the map to centre on my chosen location. Where am i going wrong?

    Thanks in advance!
    Stef

Viewing 2 replies - 1 through 2 (of 2 total)
  • Centering doesn’t seem to work in the current version. Pretty frustrating. I am working on finding a way myself. If I come across it, I will let you know…

    I think this has worked, but it is weird, because it centered for me previously, but not for others.

    jQuery(document).ready(function($) {
    	// Mashup
    	jQuery(".pgmm").bind("pronamic-google-maps-ready", function(event, map){
    		map.setCenter(new google.maps.LatLng(34.452218, -83.320312));
    	});
    });

    Add that to your javascript to force it to center on the lat/lon. Add it after the code that adds your map. Hopefully that works.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Pronamic Google Maps] Lat and Long position for Mashup view’ is closed to new replies.