Plugin Directory

Changeset 2481787


Ignore:
Timestamp:
02/25/2021 08:58:08 PM (5 years ago)
Author:
intelchip
Message:

Bugfixes & Feature updates

  • NEW: Zoom Control toggle
  • NEW: Scroll Zoom toggle
  • NEW: Pan control toggle
  • NEW: tooltip / popup behavior for markers
  • Bugfix to accent / apostrophes breaking marker renderings
Location:
osm-map-elementor
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • osm-map-elementor/tags/1.0.5/osm-map-elementor.php

    r2451082 r2481787  
    33 * Plugin Name:     OSM Map Widget for Elementor
    44 * Description:     A free Elementor Map Widget that Utilizes Open Street Map. Comes with features like adding multiple markers, and choosing from a library of custom tiles to change the look and feel.
    5  * Author:          ACT Innovate, James Arama, Alex Hooten
     5 * Author:          ACT Innovate
    66 * Author URI:      https://github.com/flopperj/elementor-osm-map
    77 * Version:         1.0.5
  • osm-map-elementor/tags/1.0.5/readme.txt

    r2451404 r2481787  
    22Plugin Name: OSM Map Widget for Elementor
    33Version: 1.0.5
    4 Author: ACT Innovate, James Arama, Alex Hooten
     4Author: ACT Innovate
    55Author URI: https://github.com/flopperj/osm-map-elementor
    66Tags: elementor, elementor widget, map widget, open street map, addons
  • osm-map-elementor/trunk/README.md

    r2451062 r2481787  
    22A free Elementor Map Widget that utilizes [Open Street Map](https://www.openstreetmap.org/). Comes with features like adding multiple markers, and choosing from a library of custom tiles to change the look and feel. Requires [Elementor Page Builder](https://wordpress.org/plugins/elementor/) Plugin Version: 3.0.5+
    33
    4 This plugin is [open sourced](https://github.com/flopperj/osm-map-elementor) so feel free to contribute to it :)
     4This plugin is [open sourced](https://github.com/flopperj/osm-map-elementor) so feel free to contribute to it by:
     51. Adding a topic/issue [here](https://github.com/flopperj/osm-map-elementor/issues)
     62. Submitting a pull request with any well-written code that implements the desired feature.
    57
    68## Usage
  • osm-map-elementor/trunk/osm-map-elementor.php

    r2451062 r2481787  
    33 * Plugin Name:     OSM Map Widget for Elementor
    44 * Description:     A free Elementor Map Widget that Utilizes Open Street Map. Comes with features like adding multiple markers, and choosing from a library of custom tiles to change the look and feel.
    5  * Author:          ACT Innovate, James Arama, Alex Hooten
     5 * Author:          ACT Innovate
    66 * Author URI:      https://github.com/flopperj/elementor-osm-map
    7  * Version:         1.0.5
     7 * Version:         1.0.6
    88 */
    99
     
    122122                                <input type="checkbox" name="osm_widget[enable_fontawesome]"
    123123                                       value="1"
    124                                        <?php echo !array_key_exists('enable_fontawesome', $osm_settings) || !empty($osm_settings['enable_fontawesome']) ? "checked='checked'" : null; ?>>
     124                                    <?php echo is_array($osm_settings) && !array_key_exists('enable_fontawesome', $osm_settings) || !empty($osm_settings['enable_fontawesome']) ? "checked='checked'" : null; ?>>
    125125                                <span class="slider round"></span>
    126126                            </label>
  • osm-map-elementor/trunk/osm-map.php

    r2451082 r2481787  
    183183
    184184        $repeater->add_control(
     185            'marker_behavior',
     186            [
     187                'label' => __('Behavior', self::$slug),
     188                'type' => \Elementor\Controls_Manager::SELECT,
     189                'default' => 'popup',
     190                'options' => [
     191                    'popup' => 'Popup',
     192                    'tooltip' => 'Tooltip',
     193                    'none' => 'None'
     194                ]
     195            ]
     196        );
     197
     198        $repeater->add_control(
    185199            'show_button',
    186200            [
     
    225239        );
    226240
     241
    227242        $this->start_controls_section(
    228243            'section_map',
     
    244259            'zoom',
    245260            [
    246                 'label' => __('Zoom', self::$slug),
     261                'label' => __('Zoom Level', self::$slug),
    247262                'type' => \Elementor\Controls_Manager::SLIDER,
    248263                'default' => [
     
    256271                ],
    257272                'separator' => 'before',
     273            ]
     274        );
     275
     276        $this->add_control(
     277            'zoom_control',
     278            [
     279                'label' => __('Zoom Control', self::$slug),
     280                'type' => \Elementor\Controls_Manager::SWITCHER,
     281                'label_on' => __('Enable', self::$slug),
     282                'label_off' => __('Disable', self::$slug),
     283                'return_value' => 'yes',
     284                'default' => 'yes'
     285            ]
     286        );
     287
     288        $this->add_control(
     289            'scroll_zoom',
     290            [
     291                'label' => __('Scroll Zoom', self::$slug),
     292                'type' => \Elementor\Controls_Manager::SWITCHER,
     293                'label_on' => __('Enable', self::$slug),
     294                'label_off' => __('Disable', self::$slug),
     295                'return_value' => 'yes',
     296                'default' => 'yes'
     297            ]
     298        );
     299
     300
     301        $this->add_control(
     302            'pan_control',
     303            [
     304                'label' => __('Pan Control', self::$slug),
     305                'type' => \Elementor\Controls_Manager::SWITCHER,
     306                'label_on' => __('Enable', self::$slug),
     307                'label_off' => __('Disable', self::$slug),
     308                'return_value' => 'yes',
     309                'default' => 'yes',
     310                'separator' => 'after'
    258311            ]
    259312        );
     
    13271380        class="osm-map-container"
    13281381        data-center="' . implode(',', $center_coords) . '"
    1329         data-zoom="' . $settings['zoom']['size'] . '"
    1330         data-markers=\'' . json_encode($coords) . '\'></div>';
     1382        data-zoom="' . $settings['zoom']['size'] . '"></div>';
    13311383        ?>
    13321384        <script type="text/javascript">
     
    13431395                }
    13441396
    1345                 const map = L.map(mapId);
     1397                const map = L.map(mapId, {
     1398                    scrollWheelZoom: <?php echo !empty($settings['scroll_zoom']) ? 'true' : 'false'; ?>,
     1399                    zoomControl: <?php echo !empty($settings['zoom_control']) ? 'true' : 'false'; ?>,
     1400                    dragging: <?php echo !empty($settings['pan_control']) ? 'true' : 'false'; ?>
     1401                });
    13461402
    13471403                if (center) {
     
    13671423
    13681424                // add available markers
    1369                 const markers = jQuery(mapContainer).data('markers');
     1425                const markers = <?php echo json_encode($coords); ?>;
    13701426                let markerIcon = null;
    13711427                let markerOptions = {};
     
    15141570                        tooltipContent += '</div>';
    15151571
    1516                         // add tooltip to marker
     1572                        // add tooltip / popup to marker
    15171573                        if (this.marker.marker_title || this.marker.marker_description || this.marker.button_text && this.marker.show_button) {
    1518                             marker.bindPopup(tooltipContent);
     1574                            let markerBehavior = this.marker.hasOwnProperty('marker_behavior') ? this.marker.marker_behavior : null;
     1575                            switch (markerBehavior) {
     1576                                case 'popup':
     1577                                    marker.bindPopup(tooltipContent);
     1578                                    break;
     1579                                case 'tooltip':
     1580
     1581                                    let tooltipOptions = {};
     1582
     1583                                <?php if($icon_type == 'fontawesome'): ?>
     1584                                    // update offset for fontawesome markers
     1585                                    tooltipOptions.direction = "top";
     1586                                    tooltipOptions.offset = [0, -50];
     1587                                <?php  endif; ?>
     1588
     1589                                    marker.bindTooltip(tooltipContent, tooltipOptions);
     1590                                    break;
     1591
     1592                            }
    15191593                        }
    15201594                    });
     
    15831657            'mapbox-gl' => plugins_url('/osm-map-elementor/assets/css/mapbox-gl.css'),
    15841658            'leaflet-fa-markers' => plugins_url('/osm-map-elementor/assets/leaflet-fa-markers/L.Icon.FontAwesome.css'),
     1659            'osm-map-elementor' => plugins_url('/osm-map-elementor/assets/css/osm-map-elementor.css')
    15851660        ];
    15861661
  • osm-map-elementor/trunk/readme.txt

    r2451404 r2481787  
    11=== OSM Map Widget for Elementor ===
    22Plugin Name: OSM Map Widget for Elementor
    3 Version: 1.0.5
    4 Author: ACT Innovate, James Arama, Alex Hooten
     3Version: 1.0.6
     4Author: ACT Innovate
    55Author URI: https://github.com/flopperj/osm-map-elementor
    66Tags: elementor, elementor widget, map widget, open street map, addons
     
    1515A free Elementor Map Widget that utilizes [Open Street Map](https://www.openstreetmap.org/). Comes with features like adding multiple markers, and choosing from a library of custom tiles to change the look and feel. Requires [Elementor Page Builder](https://wordpress.org/plugins/elementor/) Plugin Version: 3.0.5+
    1616
    17 This plugin is [open sourced](https://github.com/flopperj/osm-map-elementor) so feel free to contribute to it :)
     17This plugin is [open sourced](https://github.com/flopperj/osm-map-elementor) so feel free to contribute to it by:
     181. Adding a topic/issue [here](https://github.com/flopperj/osm-map-elementor/issues)
     192. Submitting a pull request with any well-written code that implements the desired feature.
    1820
    1921### Usage
Note: See TracChangeset for help on using the changeset viewer.