• I’ve made a small hack to functions.js to automatically center and zoom the map to the extents of the available markers.

    After:
    $.bgmp.infoWindowContent = {};
    Add:
    $.bgmp.bounds = new google.maps.LatLngBounds();

    After:

    parseInt( bgmpData.markers[ m ][ 'zIndex' ] )
    					);
    				}

    Add:
    $.bgmp.map.fitBounds($.bgmp.bounds);

    After:
    longitude = parseFloat( longitude.replace( ',', '.' ) );
    Add:

    var latlon = new google.maps.LatLng(latitude, longitude);
    				$.bgmp.bounds.extend(latlon);

    Change:
    'position' : new google.maps.LatLng( latitude, longitude ),
    To:
    'position' : latlon,

    https://wordpress.org/plugins/basic-google-maps-placemarks/

Viewing 1 replies (of 1 total)
  • Thread Starter 74gee

    (@74gee)

    Formatting didn’t work I see!

    The reson for this was to show only the markers in the current category with a small edit to archive.php in my template

    <?
    			$category = $wp->query_vars['bgmp-category'];
    			echo do_shortcode('[bgmp-map categories="'. $category .'"]');
    		?>

    And this at the end of my template’s functions.php

    add_filter('bgmp_map-shortcode-called', '__return_true' );

Viewing 1 replies (of 1 total)
  • The topic ‘Set Center on Markers’ is closed to new replies.