Plugin Directory

Changeset 1771098


Ignore:
Timestamp:
11/20/2017 04:44:10 AM (8 years ago)
Author:
ankurk91
Message:

trunk 2.6.2

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

Legend:

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

    r1768082 r1771098  
    77 * Plugin URI: https://github.com/ankurk91/wp-google-map
    88 * Description: Simple, light weight and non-bloated Google Map Plugin. Short code : <code>[ank_google_map]</code>
    9  * Version: 2.6.1
     9 * Version: 2.6.2
    1010 * Author: Ankur Kumar
    1111 * Author URI: https://ankurk91.github.io/
     
    2020if (!defined('ABSPATH')) die;
    2121
    22 define('AGM_PLUGIN_VERSION', '2.6.1');
     22define('AGM_PLUGIN_VERSION', '2.6.2');
    2323define('AGM_BASE_FILE', __FILE__);
    2424
  • ank-google-map/trunk/inc/class-frontend.php

    r1768082 r1771098  
    4545                'lng' => $db['map_Lng'],
    4646                'zoom' => $db['map_zoom'],
    47                 'type' => $this->get_map_types()[$db['map_type']],
     47                'type' => $this->get_map_types($db['map_type']),
    4848                'styles' => $this->util->get_style_by_id($db['map_style'])
    4949            ),
    5050            'marker' => array(
    5151                'enabled' => absint($db['marker_on']),
    52                 'animation' => $this->get_marker_animations()[$db['marker_anim']],
     52                'animation' => $this->get_marker_animations($db['marker_anim']),
    5353                'title' => esc_js($db['marker_title']),
    5454                'color' => $this->util->get_marker_url($db['marker_color']),
     
    9090        $db = $this->db;
    9191
    92         // Write canvas html always
     92        // Print canvas html
    9393        $width_unit = ($db["div_width_unit"] === 1) ? 'px' : '%';
    9494        $border_color = ($db["div_border_color"] === '') ? '' : 'border:1px solid ' . esc_attr($db["div_border_color"]);
     
    116116
    117117
    118     protected function get_map_types()
     118    protected function get_map_types($id)
    119119    {
    120         return array(
     120        $styles = array(
    121121            1 => 'ROADMAP',
    122122            2 => 'SATELLITE',
     
    124124            4 => 'TERRAIN',
    125125        );
     126
     127        if (array_key_exists($id, $styles)) {
     128            return $styles[$id];
     129        } else {
     130            return false;
     131        }
    126132    }
    127133
    128     protected function get_marker_animations()
     134    protected function get_marker_animations($id)
    129135    {
    130         return array(
     136        $anims = array(
    131137            1 => 'NONE',
    132138            2 => 'BOUNCE',
    133139            3 => 'DROP',
    134140        );
     141
     142        if (array_key_exists($id, $anims)) {
     143            return $anims[$id];
     144        } else {
     145            return false;
     146        }
    135147    }
    136148
  • ank-google-map/trunk/inc/class-util.php

    r1768082 r1771098  
    6161
    6262        $base_url = 'https://maps.gstatic.com/intl/en_us/mapfiles/';
    63         $path = array(
     63        $urls = array(
    6464            // Key 1 is reserved for default
    6565            '2' => $base_url . 'marker.png',
     
    7272            '9' => $base_url . 'marker_green.png',
    7373        );
    74         if (array_key_exists($id, $path)) {
    75             return $path[$id];
     74
     75        if (array_key_exists($id, $urls)) {
     76            return $urls[$id];
    7677        } else {
    7778            return false;
  • ank-google-map/trunk/readme.txt

    r1768082 r1771098  
    33Requires at least: 4.0.0
    44Tested up to: 4.9.0
    5 Stable tag: 2.6.1
     5Stable tag: 2.6.2
    66License: MIT
    77License URI: https://opensource.org/licenses/MIT
     
    165165== Changelog ==
    166166
     167= 2.6.2 =
     168* Fix: php v5.3 related [issue](https://stackoverflow.com/questions/16358973/parse-error-syntax-error-unexpected-with-php-5-3)
     169
    167170= 2.6.1 =
    168171* Compatible with WP v4.9.0
Note: See TracChangeset for help on using the changeset viewer.