Title: Offset Map Center
Last modified: February 23, 2017

---

# Offset Map Center

 *  Resolved [tag101](https://wordpress.org/support/users/tag101/)
 * (@tag101)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/offset-map-center/)
 * Hi just wondering if I can offset the center of a map to show the marker towards
   the bottom because its mostly ocean when its centered on the marker itself in
   the case of my map.
 * Jimmy

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [tag101](https://wordpress.org/support/users/tag101/)
 * (@tag101)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/offset-map-center/#post-8839564)
 * Hi I think I sorted this, sorry for bothering you.
 * In plugin folder in the file called simple-google-map-short-code.php I changed
   some javascript as below.
 *     ```
       var map_<?php echo $map_id; ?>;
       function pw_run_map_<?php echo $map_id ; ?>(){
       var location = new google.maps.LatLng("<?php echo $coordinates['lat']; ?>", "<?php echo $coordinates['lng']; ?>");
   
       // Added a new variable (set your own lat and long)
       var latlng = new google.maps.LatLng(52.0,  -7.0);
   
       var map_options = {
       zoom: <?php echo $atts['zoom']; ?>,
   
       Original //center: location,
       // New to call variables
       center: latlng,
   
       scrollwheel: <?php echo 'true' === strtolower( $atts['enablescrollwheel'] ) ? '1' : '0'; ?>,
       disableDefaultUI: <?php echo 'true' === strtolower( $atts['disablecontrols'] ) ? '1' : '0'; ?>,
       mapTypeId: google.maps.MapTypeId.ROADMAP
       }
       map_<?php echo $map_id ; ?> = new google.maps.Map(document.getElementById("<?php echo $map_id ; ?>"), map_options);
       				var marker = new google.maps.Marker({
       				position: location,
       				map: map_<?php echo $map_id ; ?>
       				});
       			}
       			pw_run_map_<?php echo $map_id ; ?>();
       ```
   
 * Might help someone.
 * Jimmy
    -  This reply was modified 9 years, 3 months ago by [tag101](https://wordpress.org/support/users/tag101/).
 *  Moderator [Pippin Williamson](https://wordpress.org/support/users/mordauk/)
 * (@mordauk)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/offset-map-center/#post-8840302)
 * Hi Jimmy,
 * There is not an option for this, sorry.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Offset Map Center’ is closed to new replies.

 * ![](https://ps.w.org/simple-google-maps-short-code/assets/icon-256x256.png?rev
   =1868328)
 * [Simple Shortcode for Google Maps](https://wordpress.org/plugins/simple-google-maps-short-code/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/simple-google-maps-short-code/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/simple-google-maps-short-code/)
 * [Active Topics](https://wordpress.org/support/plugin/simple-google-maps-short-code/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/simple-google-maps-short-code/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/simple-google-maps-short-code/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Pippin Williamson](https://wordpress.org/support/users/mordauk/)
 * Last activity: [9 years, 3 months ago](https://wordpress.org/support/topic/offset-map-center/#post-8840302)
 * Status: resolved