Plugin Directory

Changeset 1678260


Ignore:
Timestamp:
06/14/2017 11:29:58 AM (9 years ago)
Author:
ankurk91
Message:

trunk 2.6.0

Location:
ank-google-map/trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • ank-google-map/trunk/ank-google-map.php

    r1607007 r1678260  
    66     * Plugin URI: https://github.com/ankurk91/wp-google-map
    77     * Description: Simple, light weight and non-bloated Google Map Plugin. Short code : <code>[ank_google_map]</code>
    8      * Version: 2.5.0
     8     * Version: 2.6.0
    99     * Author: Ankur Kumar
    1010     * Author URI: https://ankurk91.github.io/
     
    1919if (!defined('ABSPATH')) die;
    2020
    21 define('AGM_PLUGIN_VERSION', '2.5.0');
     21define('AGM_PLUGIN_VERSION', '2.6.0');
    2222define('AGM_BASE_FILE', __FILE__);
    2323
    2424// @link https://developers.google.com/maps/documentation/javascript/releases
    25 define('AGM_API_VER', '3.27');
     25define('AGM_API_VER', '3.28');
    2626
    2727// Include required class files
  • ank-google-map/trunk/assets/frontend.js

    r1607007 r1678260  
    11(function (window, document) {
    2     'use strict';
     2  'use strict';
    33
    4     // Grab options from dumped JS on html
    5     var opt = window._agmOpt;
    6     // Expose some vars to a global namespace
    7     var AGM = window.AGM = {};
     4  // Grab options from dumped JS on html
     5  var opt = window._agmOpt;
     6  // Expose some vars to a global namespace
     7  var AGM = window.AGM = {};
    88
    9     function loadGoogleMap() {
    10         var width = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
    11         var mapCenter = new google.maps.LatLng(parseFloat(opt.map.lat), parseFloat(opt.map.lng));
     9  function loadGoogleMap() {
     10    var mapCenter = new google.maps.LatLng(parseFloat(opt.map.lat), parseFloat(opt.map.lng));
    1211
    13         var mapOptions = {
    14             zoomControl: !opt.controls.zoomControl,
    15             zoomControlOptions: {
    16                 position: google.maps.ControlPosition.RIGHT_CENTER
    17             },
    18             mapTypeControl: !opt.controls.mapTypeControl,
    19             streetViewControl: !opt.controls.streetViewControl,
    20             scrollwheel: !opt.mobile.scrollwheel,
    21             draggable: (width > 480) || !isTouchDevice(),
    22             center: mapCenter,
    23             zoom: parseInt(opt.map.zoom),
    24             mapTypeId: google.maps.MapTypeId[opt.map.type],
    25             mapTypeControlOptions: {
    26                 style: google.maps.MapTypeControlStyle.DROPDOWN_MENU,
    27                 position: google.maps.ControlPosition.TOP_LEFT
    28             },
    29             styles: opt.map.styles,
    30             fullscreenControl: !opt.controls.fullscreenControl,
    31             fullscreenControlOptions: {
    32                 position: google.maps.ControlPosition.RIGHT_TOP
    33             },
    34             gestureHandling: opt.mobile.gestureHandling || 'auto',
    35         };
    36         var map = new google.maps.Map(mapCanvas, mapOptions);
     12    var mapOptions = {
     13      zoomControl: !opt.controls.zoomControl,
     14      zoomControlOptions: {
     15        position: google.maps.ControlPosition.RIGHT_CENTER
     16      },
     17      mapTypeControl: !opt.controls.mapTypeControl,
     18      streetViewControl: !opt.controls.streetViewControl,
     19      scrollwheel: !opt.mobile.scrollwheel,
     20      center: mapCenter,
     21      zoom: parseInt(opt.map.zoom),
     22      mapTypeId: google.maps.MapTypeId[opt.map.type],
     23      mapTypeControlOptions: {
     24        style: google.maps.MapTypeControlStyle.DROPDOWN_MENU,
     25        position: google.maps.ControlPosition.TOP_LEFT
     26      },
     27      styles: opt.map.styles,
     28      fullscreenControl: !opt.controls.fullscreenControl,
     29      fullscreenControlOptions: {
     30        position: google.maps.ControlPosition.RIGHT_TOP
     31      },
     32      gestureHandling: opt.mobile.gestureHandling || 'auto',
     33    };
     34    var map = new google.maps.Map(mapCanvas, mapOptions);
    3735
     36    /**
     37     * If marker is enabled
     38     */
     39    if (opt.marker.enabled === 1) {
     40      var marker = new google.maps.Marker({
     41        position: mapCenter,
     42        map: map,
     43        optimized: false,
     44        title: opt.marker.title,
     45        icon: opt.marker.file || opt.marker.color || ''
     46      });
     47
     48      if (opt.marker.animation !== 'NONE') {
     49        marker.setAnimation(google.maps.Animation[opt.marker.animation])
     50      }
     51
     52      /**
     53       * Info window needs marker to be enabled first
     54       */
     55      if (opt.info_window.enabled === 1) {
     56        var infoWindow = new google.maps.InfoWindow({content: opt.info_window.text});
    3857        /**
    39          * If marker is enabled
     58         * Clicking on map will close info-window
    4059         */
    41         if (opt.marker.enabled === 1) {
    42             var marker = new google.maps.Marker({
    43                 position: mapCenter,
    44                 map: map,
    45                 optimized: false,
    46                 title: opt.marker.title,
    47                 icon: opt.marker.file || opt.marker.color || ''
    48             });
    49 
    50             if (opt.marker.animation !== 'NONE') {
    51                 marker.setAnimation(google.maps.Animation[opt.marker.animation])
    52             }
    53 
    54             /**
    55              * Info window needs marker to be enabled first
    56              */
    57             if (opt.info_window.enabled === 1) {
    58                 var infoWindow = new google.maps.InfoWindow({content: opt.info_window.text});
    59                 /**
    60                  * Clicking on map will close info-window
    61                  */
    62                 google.maps.event.addListener(map, 'click', function () {
    63                     infoWindow.close();
    64                 });
    65             }
    66         }
    67 
    68         if (opt.marker.enabled === 1 && opt.info_window.enabled === 1) {
    69             /**
    70              * Clicking on marker will show info-window
    71              */
    72             google.maps.event.addListener(marker, 'click', function () {
    73                 infoWindow.open(map, marker);
    74                 marker.setAnimation(null);
    75             });
    76             /**
    77              * If info window enabled by default
    78              */
    79             if (opt.info_window.state === 1) {
    80                 window.setTimeout(function () {
    81                     infoWindow.open(map, marker);
    82                     marker.setAnimation(null);
    83                 }, 2000);
    84             }
    85 
    86         }
    87 
    88 
    89         var timeout;
    90         /**
    91          * Resize event handling, make map more responsive
    92          * Center map after 300 ms
    93          */
    94         google.maps.event.addDomListener(window, 'resize', function () {
    95             if (timeout) {
    96                 clearTimeout(timeout);
    97             }
    98             timeout = window.setTimeout(function () {
    99                 map.setCenter(mapCenter);
    100             }, 300);
     60        google.maps.event.addListener(map, 'click', function () {
     61          infoWindow.close();
    10162        });
    102 
    103         // Lets expose them
    104         AGM.map = map;
    105         AGM.marker = marker;
    106         AGM.infoWindow = infoWindow;
    107         window.dispatchEvent(new Event('agm.loaded'));
     63      }
    10864    }
    10965
    110     var mapCanvas = document.getElementById('agm-canvas');
    111     if (typeof mapCanvas !== 'undefined' && mapCanvas) {
    112         if (typeof google == 'object' && google.maps) {
    113             google.maps.event.addDomListener(window, 'load', loadGoogleMap)
    114         }
    115         else {
    116             mapCanvas.innerHTML = '<p class="map-not-loaded" style="text-align: center">Failed to load Google Map.<br>Please try again.</p>';
    117             mapCanvas.style.height = 'auto';
    118         }
    119     }
     66    if (opt.marker.enabled === 1 && opt.info_window.enabled === 1) {
     67      /**
     68       * Clicking on marker will show info-window
     69       */
     70      google.maps.event.addListener(marker, 'click', function () {
     71        infoWindow.open(map, marker);
     72        marker.setAnimation(null);
     73      });
     74      /**
     75       * If info window enabled by default
     76       */
     77      if (opt.info_window.state === 1) {
     78        window.setTimeout(function () {
     79          infoWindow.open(map, marker);
     80          marker.setAnimation(null);
     81        }, 2000);
     82      }
    12083
    121     /**
    122      * Detect if touch enabled device
    123      * @link http://stackoverflow.com/questions/4817029/whats-the-best-way-to-detect-a-touch-screen-device-using-javascript
    124      * @returns {boolean|*}
    125      */
    126     function isTouchDevice() {
    127         return 'ontouchstart' in window        // works on most browsers
    128             || navigator.maxTouchPoints;       // works on IE10/11 and Surface
    12984    }
    13085
    13186
     87    var timeout;
     88    /**
     89     * Resize event handling, make map more responsive
     90     * Center map after 300 ms
     91     */
     92    google.maps.event.addDomListener(window, 'resize', function () {
     93      if (timeout) {
     94        clearTimeout(timeout);
     95      }
     96      timeout = window.setTimeout(function () {
     97        map.setCenter(mapCenter);
     98      }, 300);
     99    });
     100
     101    // Lets expose them
     102    AGM.map = map;
     103    AGM.marker = marker;
     104    AGM.infoWindow = infoWindow;
     105    window.dispatchEvent(new Event('agm.loaded'));
     106  }
     107
     108  var mapCanvas = document.getElementById('agm-canvas');
     109  if (typeof mapCanvas !== 'undefined' && mapCanvas) {
     110    if (typeof google === 'object' && google.maps) {
     111      google.maps.event.addDomListener(window, 'load', loadGoogleMap)
     112    }
     113    else {
     114      mapCanvas.innerHTML = '<p class="map-not-loaded" style="text-align: center">Failed to load Google Map.<br>Please try again.</p>';
     115      mapCanvas.style.height = 'auto';
     116    }
     117  }
     118
    132119})(window, document);
  • ank-google-map/trunk/assets/frontend.min.js

    r1607007 r1678260  
    1 !function(o,e){"use strict";function n(){var n=Math.max(e.documentElement.clientWidth,o.innerWidth||0),r=new google.maps.LatLng(parseFloat(a.map.lat),parseFloat(a.map.lng)),s={zoomControl:!a.controls.zoomControl,zoomControlOptions:{position:google.maps.ControlPosition.RIGHT_CENTER},mapTypeControl:!a.controls.mapTypeControl,streetViewControl:!a.controls.streetViewControl,scrollwheel:!a.mobile.scrollwheel,draggable:n>480||!t(),center:r,zoom:parseInt(a.map.zoom),mapTypeId:google.maps.MapTypeId[a.map.type],mapTypeControlOptions:{style:google.maps.MapTypeControlStyle.DROPDOWN_MENU,position:google.maps.ControlPosition.TOP_LEFT},styles:a.map.styles,fullscreenControl:!a.controls.fullscreenControl,fullscreenControlOptions:{position:google.maps.ControlPosition.RIGHT_TOP},gestureHandling:a.mobile.gestureHandling||"auto"},m=new google.maps.Map(i,s);if(1===a.marker.enabled){var p=new google.maps.Marker({position:r,map:m,optimized:!1,title:a.marker.title,icon:a.marker.file||a.marker.color||""});if("NONE"!==a.marker.animation&&p.setAnimation(google.maps.Animation[a.marker.animation]),1===a.info_window.enabled){var g=new google.maps.InfoWindow({content:a.info_window.text});google.maps.event.addListener(m,"click",function(){g.close()})}}1===a.marker.enabled&&1===a.info_window.enabled&&(google.maps.event.addListener(p,"click",function(){g.open(m,p),p.setAnimation(null)}),1===a.info_window.state&&o.setTimeout(function(){g.open(m,p),p.setAnimation(null)},2e3));var d;google.maps.event.addDomListener(o,"resize",function(){d&&clearTimeout(d),d=o.setTimeout(function(){m.setCenter(r)},300)}),l.map=m,l.marker=p,l.infoWindow=g,o.dispatchEvent(new Event("agm.loaded"))}function t(){return"ontouchstart"in o||navigator.maxTouchPoints}var a=o._agmOpt,l=o.AGM={},i=e.getElementById("agm-canvas");"undefined"!=typeof i&&i&&("object"==typeof google&&google.maps?google.maps.event.addDomListener(o,"load",n):(i.innerHTML='<p class="map-not-loaded" style="text-align: center">Failed to load Google Map.<br>Please try again.</p>',i.style.height="auto"))}(window,document);
     1!function(o,e){"use strict";function n(){var e=new google.maps.LatLng(parseFloat(t.map.lat),parseFloat(t.map.lng)),n={zoomControl:!t.controls.zoomControl,zoomControlOptions:{position:google.maps.ControlPosition.RIGHT_CENTER},mapTypeControl:!t.controls.mapTypeControl,streetViewControl:!t.controls.streetViewControl,scrollwheel:!t.mobile.scrollwheel,center:e,zoom:parseInt(t.map.zoom),mapTypeId:google.maps.MapTypeId[t.map.type],mapTypeControlOptions:{style:google.maps.MapTypeControlStyle.DROPDOWN_MENU,position:google.maps.ControlPosition.TOP_LEFT},styles:t.map.styles,fullscreenControl:!t.controls.fullscreenControl,fullscreenControlOptions:{position:google.maps.ControlPosition.RIGHT_TOP},gestureHandling:t.mobile.gestureHandling||"auto"},i=new google.maps.Map(l,n);if(1===t.marker.enabled){var r=new google.maps.Marker({position:e,map:i,optimized:!1,title:t.marker.title,icon:t.marker.file||t.marker.color||""});if("NONE"!==t.marker.animation&&r.setAnimation(google.maps.Animation[t.marker.animation]),1===t.info_window.enabled){var s=new google.maps.InfoWindow({content:t.info_window.text});google.maps.event.addListener(i,"click",function(){s.close()})}}1===t.marker.enabled&&1===t.info_window.enabled&&(google.maps.event.addListener(r,"click",function(){s.open(i,r),r.setAnimation(null)}),1===t.info_window.state&&o.setTimeout(function(){s.open(i,r),r.setAnimation(null)},2e3));var m;google.maps.event.addDomListener(o,"resize",function(){m&&clearTimeout(m),m=o.setTimeout(function(){i.setCenter(e)},300)}),a.map=i,a.marker=r,a.infoWindow=s,o.dispatchEvent(new Event("agm.loaded"))}var t=o._agmOpt,a=o.AGM={},l=e.getElementById("agm-canvas");"undefined"!=typeof l&&l&&("object"==typeof google&&google.maps?google.maps.event.addDomListener(o,"load",n):(l.innerHTML='<p class="map-not-loaded" style="text-align: center">Failed to load Google Map.<br>Please try again.</p>',l.style.height="auto"))}(window,document);
  • ank-google-map/trunk/assets/option-page.css

    r1503318 r1678260  
    11
    22.tab-content {
    3     display: none
     3  display: none
    44}
    55
    66.tab-content.active {
    7     display: block
     7  display: block
    88}
    99
    1010.wp-editor-wrap {
    11     width: 50%;
     11  width: 50%;
    1212}
    1313
    1414.agm-search {
    15     padding: 6px;
    16     top: 9px !important;
    17     text-overflow: ellipsis;
    18     border-radius: 2px 0 0 2px;
    19     width: 300px;
    20     border: 1px solid transparent !important;
    21     box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
     15  padding: 6px;
     16  top: 9px !important;
     17  text-overflow: ellipsis;
     18  border-radius: 2px 0 0 2px;
     19  width: 300px;
     20  border: 1px solid transparent !important;
     21  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
    2222}
    2323
    2424.agm-canvas {
    25     height: 300px;
    26     width: 550px;
    27     border: 1px solid #bcbcbc;
     25  height: 300px;
     26  width: 550px;
     27  border: 1px solid #bcbcbc;
    2828}
    2929
    3030@media screen and (max-width: 782px) {
    31     .agm-canvas, .wp-editor-wrap {
    32         width: 99%;
    33     }
     31  .agm-canvas, .wp-editor-wrap {
     32    width: 99%;
     33  }
    3434
    35     .agm-search {
    36         width: 33% !important;
    37     }
     35  .agm-search {
     36    width: 33% !important;
     37  }
    3838}
    3939
     
    4242*/
    4343.gmnoprint img {
    44     max-width: none;
     44  max-width: none;
    4545}
  • ank-google-map/trunk/assets/option-page.js

    r1600600 r1678260  
    11(function (window, document, $) {
    2     'use strict';
    3 
    4     // Get requested tab from url
    5     var requestedTab = window.location.hash.replace('#top#', '');
    6 
     2  'use strict';
     3
     4  // Get requested tab from url
     5  var requestedTab = window.location.hash.replace('#top#', '');
     6
     7  /**
     8   * Cache DOM elements for later use
     9   */
     10  var $tabs = $('h2#wpt-tabs'),
     11    $input = $('form#agm-form').find('input:hidden[name="_wp_http_referer"]'),
     12    $sections = $('section.tab-content');
     13
     14  // If there no active tab found , set first tab as active
     15  if (requestedTab === '' || $('#' + requestedTab).length === 0) requestedTab = $sections.attr('id');
     16  // Notice: we are not using cached DOM in next line
     17  $('#' + requestedTab).addClass('active');
     18  $('#' + requestedTab + '-tab').addClass('nav-tab-active');
     19  // Set return tab on page load
     20  setRedirectURL(requestedTab);
     21
     22  // Bind a click event to all tabs
     23  $tabs.find('a.nav-tab').on('click.agm', (function (e) {
     24    e.stopPropagation();
     25    // Hide all tabs
     26    $tabs.find('a.nav-tab').removeClass('nav-tab-active');
     27    $sections.removeClass('active');
     28    // Activate only clicked tab
     29    var id = $(this).attr('id').replace('-tab', '');
     30    $('#' + id).addClass('active');
     31    $(this).addClass('nav-tab-active');
     32    // Set return tab url
     33    setRedirectURL(id);
     34  }));
     35
     36  /**
     37   * Set redirect url into form's input:hidden
     38   * Note: Using hardcoded plugin option page slug
     39   * @param url String
     40   */
     41  function setRedirectURL(url) {
     42    var split = $input.val().split('?', 1);
     43    //Update the tab id at last while preserving keeping base url
     44    $input.val(split[0] + '?page=agm_settings#top#' + url);
     45  }
     46
     47
     48  // Google Map related stuff start
     49  var opt = window._agmOpt, map, mapCenter, mapOptions = {};
     50
     51  /**
     52   * Find and return styles from styles json
     53   * @param id
     54   * @returns {Array}
     55   */
     56  function getStyleByID(id) {
     57    var found = opt.styles.filter(function (s) {
     58      return (parseInt(s.id) === parseInt(id));
     59    });
     60    return (found.length) ? found[0].style : [];
     61  }
     62
     63  function loadGoogleMap() {
     64    mapCenter = new google.maps.LatLng(parseFloat(opt.map.lat), parseFloat(opt.map.lng));
     65
     66    mapOptions = {
     67      center: mapCenter,
     68      streetViewControl: true,
     69      zoom: parseInt(opt.map.zoom),
     70      mapTypeId: google.maps.MapTypeId.ROADMAP,
     71      zoomControl: true,
     72      zoomControlOptions: {
     73        position: google.maps.ControlPosition.RIGHT_BOTTOM
     74      },
     75      mapTypeControl: true,
     76      mapTypeControlOptions: {
     77        style: google.maps.MapTypeControlStyle.DROPDOWN_MENU,
     78        position: google.maps.ControlPosition.TOP_LEFT
     79      },
     80      styles: getStyleByID(opt.map.style),
     81      fullscreenControl: true,
     82      fullscreenControlOptions: {
     83        position: google.maps.ControlPosition.RIGHT_TOP
     84      },
     85      gestureHandling: 'auto',
     86    };
     87    map = new google.maps.Map(mapCanvas, mapOptions);
     88
     89    // jQuery DOM
     90    var agmLat = $('#agm-lat'),
     91      agmLng = $('#agm-lng'),
     92      agmZoom = $('#agm-zoom'),
     93      agmZoomVal = $('#agm-zoom-val');
     94
     95    var marker = new google.maps.Marker({
     96      draggable: true,
     97      position: mapCenter,
     98      optimized: false,
     99      map: map,
     100      title: 'Current Location',
     101      icon: opt.marker.file || opt.marker.color || ''
     102    });
     103
     104    google.maps.event.addListener(map, 'rightclick', function (event) {
     105      agmLat.val(event.latLng.lat());
     106      agmLng.val(event.latLng.lng());
     107      marker.setTitle('Selected Location');
     108      marker.setPosition(event.latLng);
     109    });
     110
     111    google.maps.event.addListener(marker, 'dragend', function (event) {
     112      agmLat.val(event.latLng.lat());
     113      agmLng.val(event.latLng.lng());
     114    });
     115
     116    google.maps.event.addListener(map, 'zoom_changed', function () {
     117      agmZoom.val(map.getZoom());
     118      agmZoomVal.html(map.getZoom());
     119    });
     120
     121    google.maps.event.addListener(map, 'center_changed', function () {
     122      var location = map.getCenter();
     123      agmLat.val(location.lat());
     124      agmLng.val(location.lng());
     125    });
     126
     127    google.maps.event.addListener(map, 'idle', function () {
     128      google.maps.event.trigger(map, 'resize');
     129    });
     130
     131    var timeout;
    7132    /**
    8      * Cache DOM elements for later use
     133     * Resize event handling, make map more responsive
     134     * Center map after 300 ms
    9135     */
    10     var $tabs = $('h2#wpt-tabs'),
    11         $input = $('form#agm-form').find('input:hidden[name="_wp_http_referer"]'),
    12         $sections = $('section.tab-content');
    13 
    14     // If there no active tab found , set first tab as active
    15     if (requestedTab === '' || $('#' + requestedTab).length == 0) requestedTab = $sections.attr('id');
    16     // Notice: we are not using cached DOM in next line
    17     $('#' + requestedTab).addClass('active');
    18     $('#' + requestedTab + '-tab').addClass('nav-tab-active');
    19     // Set return tab on page load
    20     setRedirectURL(requestedTab);
    21 
    22     // Bind a click event to all tabs
    23     $tabs.find('a.nav-tab').on('click.agm', (function (e) {
    24         e.stopPropagation();
    25         // Hide all tabs
    26         $tabs.find('a.nav-tab').removeClass('nav-tab-active');
    27         $sections.removeClass('active');
    28         // Activate only clicked tab
    29         var id = $(this).attr('id').replace('-tab', '');
    30         $('#' + id).addClass('active');
    31         $(this).addClass('nav-tab-active');
    32         // Set return tab url
    33         setRedirectURL(id);
    34     }));
    35 
    36     /**
    37      * Set redirect url into form's input:hidden
    38      * Note: Using hardcoded plugin option page slug
    39      * @param url String
    40      */
    41     function setRedirectURL(url) {
    42         var split = $input.val().split('?', 1);
    43         //Update the tab id at last while preserving keeping base url
    44         $input.val(split[0] + '?page=agm_settings#top#' + url);
    45     }
    46 
    47 
    48     // Google Map related stuff start
    49     var opt = window._agmOpt, map, mapCenter, mapOptions = {};
    50 
    51     /**
    52      * Find and return styles from styles json
    53      * @param id
    54      * @returns {Array}
    55      */
    56     function getStyleByID(id) {
    57         var found = opt.styles.filter(function (s) {
    58             return (s.id == id);
    59         });
    60         return (found.length) ? found[0].style : [];
    61     }
    62 
    63     /**
    64      * Get DOM element by ID
    65      * @param a
    66      * @returns {Element}
    67      */
    68     function getElementById(a) {
    69         return document.querySelector('#' + a) || document.getElementById(a);
    70     }
    71 
    72     function loadGoogleMap() {
    73         var width = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
    74         mapCenter = new google.maps.LatLng(parseFloat(opt.map.lat), parseFloat(opt.map.lng));
    75 
    76         mapOptions = {
    77             draggable: (width > 480) || !isTouchDevice(),
    78             center: mapCenter,
    79             streetViewControl: true,
    80             zoom: parseInt(opt.map.zoom),
    81             mapTypeId: google.maps.MapTypeId.ROADMAP,
    82             zoomControl: true,
    83             zoomControlOptions: {
    84                 position: google.maps.ControlPosition.RIGHT_BOTTOM
    85             },
    86             mapTypeControl: true,
    87             mapTypeControlOptions: {
    88                 style: google.maps.MapTypeControlStyle.DROPDOWN_MENU,
    89                 position: google.maps.ControlPosition.TOP_LEFT
    90             },
    91             styles: getStyleByID(opt.map.style),
    92             fullscreenControl: true,
    93             fullscreenControlOptions: {
    94                 position: google.maps.ControlPosition.RIGHT_TOP
    95             },
    96             gestureHandling: 'auto',
    97         };
    98         map = new google.maps.Map(mapCanvas, mapOptions);
    99 
    100         // jQuery DOM
    101         var agmLat = $('#agm-lat'),
    102             agmLng = $('#agm-lng'),
    103             agmZoom = $('#agm-zoom'),
    104             agmZoomVal = $('#agm-zoom-val');
    105 
    106         var marker = new google.maps.Marker({
    107             draggable: true,
    108             position: mapCenter,
    109             optimized: false,
    110             map: map,
    111             title: 'Current Location',
    112             icon: opt.marker.file || opt.marker.color || ''
    113         });
    114 
    115         google.maps.event.addListener(map, 'rightclick', function (event) {
    116             agmLat.val(event.latLng.lat());
    117             agmLng.val(event.latLng.lng());
    118             marker.setTitle('Selected Location');
    119             marker.setPosition(event.latLng);
    120         });
    121 
    122         google.maps.event.addListener(marker, 'dragend', function (event) {
    123             agmLat.val(event.latLng.lat());
    124             agmLng.val(event.latLng.lng());
    125         });
    126 
    127         google.maps.event.addListener(map, 'zoom_changed', function () {
    128             agmZoom.val(map.getZoom());
    129             agmZoomVal.html(map.getZoom());
    130         });
    131 
    132         google.maps.event.addListener(map, 'center_changed', function () {
    133             var location = map.getCenter();
    134             agmLat.val(location.lat());
    135             agmLng.val(location.lng());
    136         });
    137 
    138         google.maps.event.addListener(map, 'idle', function () {
    139             google.maps.event.trigger(map, 'resize');
    140         });
    141 
    142         var timeout;
    143         /**
    144          * Resize event handling, make map more responsive
    145          * Center map after 300 ms
    146          */
    147         google.maps.event.addDomListener(window, 'resize', function () {
    148             if (timeout) {
    149                 clearTimeout(timeout);
    150             }
    151             timeout = window.setTimeout(function () {
    152                 map.setCenter(mapCenter);
    153             }, 300);
    154         });
    155 
    156         // Zoom slider control
    157         agmZoom.on('input.agm click.agm', function () {
    158             agmZoomVal.html(this.value);
    159             map.setZoom(parseInt(agmZoom.val()));
    160         });
    161 
    162         // Auto-complete feature
    163         var searchInput = getElementById('agm-search');
    164         var locSearch = new google.maps.places.Autocomplete(searchInput);
    165         map.controls[google.maps.ControlPosition.TOP_LEFT].push(searchInput);
    166 
    167         google.maps.event.addListener(locSearch, 'place_changed', function () {
    168             var place = locSearch.getPlace();
    169             if (place.geometry) {
    170                 map.panTo(place.geometry.location);
    171                 marker.setPosition(place.geometry.location);
    172                 map.setZoom(15);
    173                 marker.setTitle(place.formatted_address);
    174             }
    175         });
    176 
    177     }
    178 
    179 
    180     // Prepare to load google map
    181     var mapCanvas = getElementById('agm-canvas');
    182     if (typeof google == 'object' && google.maps) {
    183         google.maps.event.addDomListener(window, 'load', loadGoogleMap)
    184     }
    185     else {
    186         mapCanvas.innerHTML = '<h4 class="map-not-loaded" style="text-align: center;color: #ba060b">Failed to load Google Map.<br>Refresh this page and try again.<br>Check your internet connection as well.</h4>'
    187     }
    188 
    189     /**
    190      * Workaround to fix Map not loaded properly when canvas is hidden initially
    191      */
    192     $('#wpt-loc-tab').one('click.agm', function () {
    193         try {
    194             google.maps.event.trigger(map, 'resize');
    195             map.setCenter(mapCenter);
    196         } catch (e) {
    197             console.error('Google map not loaded yet');
    198         }
    199 
    200     });
    201 
    202     /**
    203      * Dynamically change the map style
    204      */
    205     $('#agm-map-style').on('change.agm', function (e) {
    206         e.preventDefault();
    207         try {
    208             map.setOptions({styles: getStyleByID($(this).val())});
    209         } catch (e) {
    210             console.error('Google map not loaded yet');
    211         }
    212     });
    213 
    214     /**
    215      * Prevent form submission when user press enter key in auto-complete
    216      * Note: event not namespaced
    217      */
    218     $("#agm-search").on('keydown', function (e) {
    219         if (e.keyCode == 13 || e.which == 13) {
    220             e.preventDefault();
    221             e.stopPropagation();
    222             return false;
    223         }
    224     });
    225 
    226     /**
    227      * Load color picker, but be fail safe
    228      */
     136    google.maps.event.addDomListener(window, 'resize', function () {
     137      if (timeout) {
     138        clearTimeout(timeout);
     139      }
     140      timeout = window.setTimeout(function () {
     141        map.setCenter(mapCenter);
     142      }, 300);
     143    });
     144
     145    // Zoom slider control
     146    agmZoom.on('input.agm click.agm', function () {
     147      agmZoomVal.html(this.value);
     148      map.setZoom(parseInt(agmZoom.val()));
     149    });
     150
     151    // Auto-complete feature
     152    var searchInput = document.querySelector('#agm-search');
     153    var locSearch = new google.maps.places.Autocomplete(searchInput);
     154    map.controls[google.maps.ControlPosition.TOP_LEFT].push(searchInput);
     155
     156    google.maps.event.addListener(locSearch, 'place_changed', function () {
     157      var place = locSearch.getPlace();
     158      if (place.geometry) {
     159        map.panTo(place.geometry.location);
     160        marker.setPosition(place.geometry.location);
     161        map.setZoom(15);
     162        marker.setTitle(place.formatted_address);
     163      }
     164    });
     165
     166  }
     167
     168
     169  // Prepare to load google map
     170  var mapCanvas = document.querySelector('#agm-canvas');
     171  if (typeof google === 'object' && google.maps) {
     172    google.maps.event.addDomListener(window, 'load', loadGoogleMap)
     173  }
     174  else {
     175    mapCanvas.innerHTML = '<h4 class="map-not-loaded" style="text-align: center;color: #ba060b">Failed to load Google Map.<br>Refresh this page and try again.<br>Check your internet connection as well.</h4>'
     176  }
     177
     178  /**
     179   * Workaround to fix Map not loaded properly when canvas is hidden initially
     180   */
     181  $('#wpt-loc-tab').one('click.agm', function () {
    229182    try {
    230         $('#agm-border-color').wpColorPicker();
     183      google.maps.event.trigger(map, 'resize');
     184      map.setCenter(mapCenter);
    231185    } catch (e) {
    232         console.error('WP Color Picker not loaded');
    233     }
    234 
    235     var uploadFrame;
    236     /**
    237      * Media uploader
    238      * @link https://codex.wordpress.org/Javascript_Reference/wp.media
    239      */
    240     $('#agm-marker-file').on('click.agm', function (e) {
    241         e.preventDefault();
    242         var $vm = $(this);
    243 
    244         // If the media frame already exists, reopen it.
    245         if (uploadFrame) {
    246             uploadFrame.open();
    247             return;
    248         }
    249 
    250         // Create a new media frame
    251         uploadFrame = wp.media({
    252             //frame: 'image',
    253             title: 'Choose Marker',
    254             button: {
    255                 text: 'Choose Image'
    256             },
    257             library: {type: 'image'},
    258             multiple: false
    259         });
    260 
    261         // When an image is selected in the media frame...
    262         uploadFrame.on('select', function () {
    263             $vm.prev('input').val(uploadFrame.state().get('selection').first().toJSON().url);
    264         });
    265 
    266         // Finally, open the modal on click
    267         uploadFrame.open();
    268 
    269     });
    270 
    271     /**
    272      * Detect if touch enabled device
    273      * @link http://stackoverflow.com/questions/4817029/whats-the-best-way-to-detect-a-touch-screen-device-using-javascript
    274      * @returns {boolean|*}
    275      */
    276     function isTouchDevice() {
    277         return 'ontouchstart' in window        // works on most browsers
    278             || navigator.maxTouchPoints;       // works on IE10/11 and Surface
    279     }
     186      console.error('Google map not loaded yet');
     187    }
     188
     189  });
     190
     191  /**
     192   * Dynamically change the map style
     193   */
     194  $('#agm-map-style').on('change.agm', function (e) {
     195    e.preventDefault();
     196    try {
     197      map.setOptions({styles: getStyleByID($(this).val())});
     198    } catch (e) {
     199      console.error('Google map not loaded yet');
     200    }
     201  });
     202
     203  /**
     204   * Prevent form submission when user press enter key in auto-complete
     205   * Note: event not namespaced
     206   */
     207  $("#agm-search").on('keydown', function (e) {
     208    if (e.keyCode === 13 || e.which === 13) {
     209      e.preventDefault();
     210      e.stopPropagation();
     211      return false;
     212    }
     213  });
     214
     215  /**
     216   * Load color picker, but be fail safe
     217   */
     218  try {
     219    $('#agm-border-color').wpColorPicker();
     220  } catch (e) {
     221    console.error('WP Color Picker not loaded');
     222  }
     223
     224  var uploadFrame;
     225  /**
     226   * Media uploader
     227   * @link https://codex.wordpress.org/Javascript_Reference/wp.media
     228   */
     229  $('#agm-marker-file').on('click.agm', function (e) {
     230    e.preventDefault();
     231    var $vm = $(this);
     232
     233    // If the media frame already exists, reopen it.
     234    if (uploadFrame) {
     235      uploadFrame.open();
     236      return;
     237    }
     238
     239    // Create a new media frame
     240    uploadFrame = wp.media({
     241      //frame: 'image',
     242      title: 'Choose Marker',
     243      button: {
     244        text: 'Choose Image'
     245      },
     246      library: {type: 'image'},
     247      multiple: false
     248    });
     249
     250    // When an image is selected in the media frame...
     251    uploadFrame.on('select', function () {
     252      $vm.prev('input').val(uploadFrame.state().get('selection').first().toJSON().url);
     253    });
     254
     255    // Finally, open the modal on click
     256    uploadFrame.open();
     257
     258  });
    280259
    281260})(window, document, jQuery);
  • ank-google-map/trunk/assets/option-page.min.js

    r1600600 r1678260  
    1 !function(e,t,o){"use strict";function a(e){var t=c.val().split("?",1);c.val(t[0]+"?page=agm_settings#top#"+e)}function n(e){var t=v.styles.filter(function(t){return t.id==e});return t.length?t[0].style:[]}function l(e){return t.querySelector("#"+e)||t.getElementById(e)}function r(){var a=Math.max(t.documentElement.clientWidth,e.innerWidth||0);d=new google.maps.LatLng(parseFloat(v.map.lat),parseFloat(v.map.lng)),u={draggable:a>480||!i(),center:d,streetViewControl:!0,zoom:parseInt(v.map.zoom),mapTypeId:google.maps.MapTypeId.ROADMAP,zoomControl:!0,zoomControlOptions:{position:google.maps.ControlPosition.RIGHT_BOTTOM},mapTypeControl:!0,mapTypeControlOptions:{style:google.maps.MapTypeControlStyle.DROPDOWN_MENU,position:google.maps.ControlPosition.TOP_LEFT},styles:n(v.map.style),fullscreenControl:!0,fullscreenControlOptions:{position:google.maps.ControlPosition.RIGHT_TOP},gestureHandling:"auto"},p=new google.maps.Map(f,u);var r=o("#agm-lat"),s=o("#agm-lng"),g=o("#agm-zoom"),c=o("#agm-zoom-val"),m=new google.maps.Marker({draggable:!0,position:d,optimized:!1,map:p,title:"Current Location",icon:v.marker.file||v.marker.color||""});google.maps.event.addListener(p,"rightclick",function(e){r.val(e.latLng.lat()),s.val(e.latLng.lng()),m.setTitle("Selected Location"),m.setPosition(e.latLng)}),google.maps.event.addListener(m,"dragend",function(e){r.val(e.latLng.lat()),s.val(e.latLng.lng())}),google.maps.event.addListener(p,"zoom_changed",function(){g.val(p.getZoom()),c.html(p.getZoom())}),google.maps.event.addListener(p,"center_changed",function(){var e=p.getCenter();r.val(e.lat()),s.val(e.lng())}),google.maps.event.addListener(p,"idle",function(){google.maps.event.trigger(p,"resize")});var h;google.maps.event.addDomListener(e,"resize",function(){h&&clearTimeout(h),h=e.setTimeout(function(){p.setCenter(d)},300)}),g.on("input.agm click.agm",function(){c.html(this.value),p.setZoom(parseInt(g.val()))});var y=l("agm-search"),C=new google.maps.places.Autocomplete(y);p.controls[google.maps.ControlPosition.TOP_LEFT].push(y),google.maps.event.addListener(C,"place_changed",function(){var e=C.getPlace();e.geometry&&(p.panTo(e.geometry.location),m.setPosition(e.geometry.location),p.setZoom(15),m.setTitle(e.formatted_address))})}function i(){return"ontouchstart"in e||navigator.maxTouchPoints}var s=e.location.hash.replace("#top#",""),g=o("h2#wpt-tabs"),c=o("form#agm-form").find('input:hidden[name="_wp_http_referer"]'),m=o("section.tab-content");""!==s&&0!=o("#"+s).length||(s=m.attr("id")),o("#"+s).addClass("active"),o("#"+s+"-tab").addClass("nav-tab-active"),a(s),g.find("a.nav-tab").on("click.agm",function(e){e.stopPropagation(),g.find("a.nav-tab").removeClass("nav-tab-active"),m.removeClass("active");var t=o(this).attr("id").replace("-tab","");o("#"+t).addClass("active"),o(this).addClass("nav-tab-active"),a(t)});var p,d,v=e._agmOpt,u={},f=l("agm-canvas");"object"==typeof google&&google.maps?google.maps.event.addDomListener(e,"load",r):f.innerHTML='<h4 class="map-not-loaded" style="text-align: center;color: #ba060b">Failed to load Google Map.<br>Refresh this page and try again.<br>Check your internet connection as well.</h4>',o("#wpt-loc-tab").one("click.agm",function(){try{google.maps.event.trigger(p,"resize"),p.setCenter(d)}catch(e){console.error("Google map not loaded yet")}}),o("#agm-map-style").on("change.agm",function(e){e.preventDefault();try{p.setOptions({styles:n(o(this).val())})}catch(e){console.error("Google map not loaded yet")}}),o("#agm-search").on("keydown",function(e){return 13==e.keyCode||13==e.which?(e.preventDefault(),e.stopPropagation(),!1):void 0});try{o("#agm-border-color").wpColorPicker()}catch(h){console.error("WP Color Picker not loaded")}var y;o("#agm-marker-file").on("click.agm",function(e){e.preventDefault();var t=o(this);return y?void y.open():(y=wp.media({title:"Choose Marker",button:{text:"Choose Image"},library:{type:"image"},multiple:!1}),y.on("select",function(){t.prev("input").val(y.state().get("selection").first().toJSON().url)}),void y.open())})}(window,document,jQuery);
     1!function(e,o,t){"use strict";function a(e){var o=s.val().split("?",1);s.val(o[0]+"?page=agm_settings#top#"+e)}function n(e){var o=m.styles.filter(function(o){return parseInt(o.id)===parseInt(e)});return o.length?o[0].style:[]}function l(){p=new google.maps.LatLng(parseFloat(m.map.lat),parseFloat(m.map.lng)),d={center:p,streetViewControl:!0,zoom:parseInt(m.map.zoom),mapTypeId:google.maps.MapTypeId.ROADMAP,zoomControl:!0,zoomControlOptions:{position:google.maps.ControlPosition.RIGHT_BOTTOM},mapTypeControl:!0,mapTypeControlOptions:{style:google.maps.MapTypeControlStyle.DROPDOWN_MENU,position:google.maps.ControlPosition.TOP_LEFT},styles:n(m.map.style),fullscreenControl:!0,fullscreenControlOptions:{position:google.maps.ControlPosition.RIGHT_TOP},gestureHandling:"auto"},c=new google.maps.Map(v,d);var a=t("#agm-lat"),l=t("#agm-lng"),r=t("#agm-zoom"),i=t("#agm-zoom-val"),s=new google.maps.Marker({draggable:!0,position:p,optimized:!1,map:c,title:"Current Location",icon:m.marker.file||m.marker.color||""});google.maps.event.addListener(c,"rightclick",function(e){a.val(e.latLng.lat()),l.val(e.latLng.lng()),s.setTitle("Selected Location"),s.setPosition(e.latLng)}),google.maps.event.addListener(s,"dragend",function(e){a.val(e.latLng.lat()),l.val(e.latLng.lng())}),google.maps.event.addListener(c,"zoom_changed",function(){r.val(c.getZoom()),i.html(c.getZoom())}),google.maps.event.addListener(c,"center_changed",function(){var e=c.getCenter();a.val(e.lat()),l.val(e.lng())}),google.maps.event.addListener(c,"idle",function(){google.maps.event.trigger(c,"resize")});var g;google.maps.event.addDomListener(e,"resize",function(){g&&clearTimeout(g),g=e.setTimeout(function(){c.setCenter(p)},300)}),r.on("input.agm click.agm",function(){i.html(this.value),c.setZoom(parseInt(r.val()))});var u=o.querySelector("#agm-search"),f=new google.maps.places.Autocomplete(u);c.controls[google.maps.ControlPosition.TOP_LEFT].push(u),google.maps.event.addListener(f,"place_changed",function(){var e=f.getPlace();e.geometry&&(c.panTo(e.geometry.location),s.setPosition(e.geometry.location),c.setZoom(15),s.setTitle(e.formatted_address))})}var r=e.location.hash.replace("#top#",""),i=t("h2#wpt-tabs"),s=t("form#agm-form").find('input:hidden[name="_wp_http_referer"]'),g=t("section.tab-content");""!==r&&0!==t("#"+r).length||(r=g.attr("id")),t("#"+r).addClass("active"),t("#"+r+"-tab").addClass("nav-tab-active"),a(r),i.find("a.nav-tab").on("click.agm",function(e){e.stopPropagation(),i.find("a.nav-tab").removeClass("nav-tab-active"),g.removeClass("active");var o=t(this).attr("id").replace("-tab","");t("#"+o).addClass("active"),t(this).addClass("nav-tab-active"),a(o)});var c,p,m=e._agmOpt,d={},v=o.querySelector("#agm-canvas");"object"==typeof google&&google.maps?google.maps.event.addDomListener(e,"load",l):v.innerHTML='<h4 class="map-not-loaded" style="text-align: center;color: #ba060b">Failed to load Google Map.<br>Refresh this page and try again.<br>Check your internet connection as well.</h4>',t("#wpt-loc-tab").one("click.agm",function(){try{google.maps.event.trigger(c,"resize"),c.setCenter(p)}catch(e){console.error("Google map not loaded yet")}}),t("#agm-map-style").on("change.agm",function(e){e.preventDefault();try{c.setOptions({styles:n(t(this).val())})}catch(e){console.error("Google map not loaded yet")}}),t("#agm-search").on("keydown",function(e){return 13===e.keyCode||13===e.which?(e.preventDefault(),e.stopPropagation(),!1):void 0});try{t("#agm-border-color").wpColorPicker()}catch(u){console.error("WP Color Picker not loaded")}var f;t("#agm-marker-file").on("click.agm",function(e){e.preventDefault();var o=t(this);return f?void f.open():(f=wp.media({title:"Choose Marker",button:{text:"Choose Image"},library:{type:"image"},multiple:!1}),f.on("select",function(){o.prev("input").val(f.state().get("selection").first().toJSON().url)}),void f.open())})}(window,document,jQuery);
  • ank-google-map/trunk/inc/class-frontend.php

    r1607007 r1678260  
    8181            'mobile' => array(
    8282                'scrollwheel' => absint($db['disable_mouse_wheel']),
    83                 'draggable' => absint($db['disable_drag_mobile']),
    8483                'gestureHandling' => esc_js($db['gesture_handling']),
    8584            )
  • ank-google-map/trunk/inc/class-settings.php

    r1600600 r1678260  
    11<?php
     2
    23namespace Ankur\Plugins\Ank_Google_Map;
    34/**
     
    6566            'info_state' => '0',
    6667            'disable_mouse_wheel' => '0',
    67             'disable_drag_mobile' => '1',
    6868            'api_key' => '',
    6969            'map_style' => 0, //disabled
     
    166166        $out['gesture_handling'] = sanitize_text_field($in['gesture_handling']);
    167167
    168         $choices_array = array('disable_mouse_wheel', 'disable_drag_mobile', 'map_control_2', 'map_control_3', 'map_control_4', 'map_control_5', 'marker_on', 'info_on', 'info_state');
     168        $choices_array = array('disable_mouse_wheel', 'map_control_2', 'map_control_3', 'map_control_4', 'map_control_5', 'marker_on', 'info_on', 'info_state');
    169169
    170170        foreach ($choices_array as $choice) {
  • ank-google-map/trunk/languages/ank-google-map.pot

    r1607007 r1678260  
    55"Project-Id-Version: Ank Google Map\n"
    66"Report-Msgid-Bugs-To: https://github.com/ankurk91/wp-google-map/issues\n"
    7 "POT-Creation-Date: 2017-03-03 12:35+0530\n"
     7"POT-Creation-Date: 2017-06-14 11:04+0530\n"
    88"PO-Revision-Date: 2016-01-13 17:06+0530\n"
    99"Last-Translator: ankurk91\n"
     
    113113
    114114#: views/settings.php:77
    115 msgid "Disable Dragging on Mobile Devices"
    116 msgstr ""
    117 
    118 #: views/settings.php:83
    119115msgid "Scrolling and Panning Behavior"
    120116msgstr ""
    121117
     118#: views/settings.php:82
     119msgid "None"
     120msgstr ""
     121
     122#: views/settings.php:84
     123msgid "Auto (recommended)"
     124msgstr ""
     125
     126#: views/settings.php:86
     127msgid "Greedy"
     128msgstr ""
     129
    122130#: views/settings.php:88
    123 msgid "None"
    124 msgstr ""
    125 
    126 #: views/settings.php:90
    127 msgid "Auto (recommended)"
     131msgid "Cooperative"
    128132msgstr ""
    129133
    130134#: views/settings.php:92
    131 msgid "Greedy"
    132 msgstr ""
    133 
    134 #: views/settings.php:94
    135 msgid "Cooperative"
    136 msgstr ""
    137 
    138 #: views/settings.php:98
    139135msgid "Applies to mobile devices"
    140136msgstr ""
    141137
    142 #: views/settings.php:102
     138#: views/settings.php:96
    143139msgid "Map Language"
    144140msgstr ""
    145141
    146 #: views/settings.php:117
     142#: views/settings.php:111
    147143msgid "Latitude"
    148144msgstr ""
    149145
    150 #: views/settings.php:122
     146#: views/settings.php:116
    151147msgid "Longitude"
    152148msgstr ""
    153149
    154 #: views/settings.php:127
     150#: views/settings.php:121
    155151msgid "Zoom Level"
    156152msgstr ""
    157153
    158 #: views/settings.php:137
     154#: views/settings.php:131
    159155msgid "Disable Controls"
    160156msgstr ""
    161157
     158#: views/settings.php:135
     159msgid "Disable Zoom Control"
     160msgstr ""
     161
     162#: views/settings.php:138
     163msgid "Disable MapType Control"
     164msgstr ""
     165
    162166#: views/settings.php:141
    163 msgid "Disable Zoom Control"
     167msgid "Disable StreetView Control"
    164168msgstr ""
    165169
    166170#: views/settings.php:144
    167 msgid "Disable MapType Control"
    168 msgstr ""
    169 
    170 #: views/settings.php:147
    171 msgid "Disable StreetView Control"
    172 msgstr ""
    173 
    174 #: views/settings.php:150
    175171msgid "Disable FullScreen Control"
    176172msgstr ""
    177173
    178 #: views/settings.php:154
     174#: views/settings.php:148
    179175msgid "Map Type"
    180176msgstr ""
    181177
     178#: views/settings.php:152
     179msgid "ROADMAP"
     180msgstr ""
     181
     182#: views/settings.php:155
     183msgid "SATELLITE"
     184msgstr ""
     185
    182186#: views/settings.php:158
    183 msgid "ROADMAP"
     187msgid "HYBRID"
    184188msgstr ""
    185189
    186190#: views/settings.php:161
    187 msgid "SATELLITE"
    188 msgstr ""
    189 
    190 #: views/settings.php:164
    191 msgid "HYBRID"
    192 msgstr ""
    193 
    194 #: views/settings.php:167
    195191msgid "TERRAIN"
    196192msgstr ""
    197193
    198 #: views/settings.php:172
     194#: views/settings.php:166
    199195msgid "Map Style"
    200196msgstr ""
    201197
    202 #: views/settings.php:183
     198#: views/settings.php:177
    203199msgid "Styles taken from"
    204200msgstr ""
    205201
    206 #: views/settings.php:188
     202#: views/settings.php:182
    207203msgid "Set Location"
    208204msgstr ""
    209205
    210 #: views/settings.php:192
     206#: views/settings.php:186
    211207msgid "Right click on map to set that point as new center of map"
    212208msgstr ""
    213209
    214 #: views/settings.php:201
     210#: views/settings.php:195
    215211msgid "Enable Marker"
    216212msgstr ""
    217213
    218 #: views/settings.php:205 views/settings.php:283
     214#: views/settings.php:199 views/settings.php:277
    219215msgid "Check to enable"
    220216msgstr ""
    221217
    222 #: views/settings.php:208
     218#: views/settings.php:202
    223219msgid "Marker Title"
    224220msgstr ""
    225221
    226 #: views/settings.php:212
     222#: views/settings.php:206
    227223msgid "Don't use html tags here"
    228224msgstr ""
    229225
    230 #: views/settings.php:216
     226#: views/settings.php:210
    231227msgid "Marker Animation"
    232228msgstr ""
    233229
     230#: views/settings.php:214
     231msgid "NONE"
     232msgstr ""
     233
     234#: views/settings.php:217
     235msgid "BOUNCE"
     236msgstr ""
     237
    234238#: views/settings.php:220
    235 msgid "NONE"
    236 msgstr ""
    237 
    238 #: views/settings.php:223
    239 msgid "BOUNCE"
    240 msgstr ""
    241 
    242 #: views/settings.php:226
    243239msgid "DROP"
    244240msgstr ""
    245241
     242#: views/settings.php:225
     243msgid "Marker Color"
     244msgstr ""
     245
     246#: views/settings.php:229
     247msgid "Default"
     248msgstr ""
     249
    246250#: views/settings.php:231
    247 msgid "Marker Color"
    248 msgstr ""
    249 
    250 #: views/settings.php:235
    251 msgid "Default"
    252 msgstr ""
    253 
    254 #: views/settings.php:237
    255251msgid "Light Red"
    256252msgstr ""
    257253
     254#: views/settings.php:233
     255msgid "Black"
     256msgstr ""
     257
     258#: views/settings.php:236
     259msgid "Gray"
     260msgstr ""
     261
    258262#: views/settings.php:239
    259 msgid "Black"
     263msgid "Orange"
    260264msgstr ""
    261265
    262266#: views/settings.php:242
    263 msgid "Gray"
     267msgid "White"
    264268msgstr ""
    265269
    266270#: views/settings.php:245
    267 msgid "Orange"
     271msgid "Yellow"
    268272msgstr ""
    269273
    270274#: views/settings.php:248
    271 msgid "White"
     275msgid "Purple"
    272276msgstr ""
    273277
    274278#: views/settings.php:251
    275 msgid "Yellow"
    276 msgstr ""
    277 
    278 #: views/settings.php:254
    279 msgid "Purple"
     279msgid "Green"
    280280msgstr ""
    281281
    282282#: views/settings.php:257
    283 msgid "Green"
     283msgid "Marker File URL"
    284284msgstr ""
    285285
    286286#: views/settings.php:263
    287 msgid "Marker File URL"
    288 msgstr ""
    289 
    290 #: views/settings.php:269
    291287msgid "Select from Media Library"
    292288msgstr ""
    293289
    294 #: views/settings.php:272
     290#: views/settings.php:266
    295291msgid "Full URL to marker icon image file"
    296292msgstr ""
    297293
    298 #: views/settings.php:280
     294#: views/settings.php:274
    299295msgid "Enable Info Window"
    300296msgstr ""
    301297
    302 #: views/settings.php:284
     298#: views/settings.php:278
    303299msgid "Needs marker to be enabled"
    304300msgstr ""
    305301
    306 #: views/settings.php:288
     302#: views/settings.php:282
    307303msgid "Info Window State"
    308304msgstr ""
    309305
    310 #: views/settings.php:292
     306#: views/settings.php:286
    311307msgid "Shown by default"
    312308msgstr ""
    313309
    314 #: views/settings.php:295
     310#: views/settings.php:289
    315311msgid "Info Window Text"
    316312msgstr ""
    317313
    318 #: views/settings.php:307
     314#: views/settings.php:301
    319315msgid "HTML allowed"
    320316msgstr ""
  • ank-google-map/trunk/readme.txt

    r1607007 r1678260  
    22Tags: google map, map, responsive, light weight, free, easy
    33Requires at least: 4.0.0
    4 Tested up to: 4.7.2
    5 Stable tag: 2.5.0
     4Tested up to: 4.8.0
     5Stable tag: 2.6.0
    66License: MIT
    77License URI: https://opensource.org/licenses/MIT
     
    6363= Why did you call it Light Weight ? =
    6464
    65 Because it is minimum of JavaScript.<br>
    6665It utilize WordPress dash-icons, color picker, and text editor on plugin Options Page.<br>
    6766It does not create additional tables in your database, uses inbuilt 'wp_options' table.<br>
     
    165164
    166165== Changelog ==
     166
     167= 2.6.0 =
     168* Compatible with WP v4.8.0
     169* Update: Google Map API v3.28
     170* Remove: [draggable](https://developers.google.com/maps/documentation/javascript/reference#MapOptions) option
    167171
    168172= 2.5.0 =
  • ank-google-map/trunk/views/settings.php

    r1600600 r1678260  
    7272                            <td><input <?php checked($db['disable_mouse_wheel'], '1') ?>
    7373                                        type="checkbox" name="ank_google_map[disable_mouse_wheel]">
    74                             </td>
    75                         </tr>
    76                         <tr>
    77                             <th scope="row"><?php _e('Disable Dragging on Mobile Devices', 'ank-google-map'); ?></th>
    78                             <td><input <?php checked($db['disable_drag_mobile'], '1') ?>
    79                                         type="checkbox" name="ank_google_map[disable_drag_mobile]">
    8074                            </td>
    8175                        </tr>
Note: See TracChangeset for help on using the changeset viewer.