• I would like to contribute to your plugin with a little code.
    on blueocean-woo-order-map/core/class/Map.php
    AFTER this code
    // full screen map
    i added
    document.querySelector(‘button.findme_bo_woo_order_map’).addEventListener(‘click’, (e) => {

    if (navigator.geolocation) {
    navigator.geolocation.getCurrentPosition(showPosition);
    }

    function showPosition(position) {
    setTimeout(() => app.setView([position.coords.latitude, position.coords.longitude], 16), 300)
    if (marker !== undefined)
    marker.remove();
    marker = L.marker([position.coords.latitude, position.coords.longitude], {
    icon: L.icon({
    iconUrl: “<?= plugins_url(‘assets/images/icon-marker-map.svg’, BO_WOO_ORDER_MAP) ?>”,
    iconSize: [40, 40], // size of the icon
    iconAnchor: [20, 40], // point of the icon which will correspond to marker’s location
    })
    }).addTo(app);
    }
    });
    “AND ALSO ADDED in these file, in function: private static function html($checkout)”
    <button class=”findme_bo_woo_order_map”
    type=”button”><?= __(‘Find-me’, ‘bo_woo_order_map’) ?></button>

    “AND ALSO ADDED in file blueocean-woo-order-map/assets/css/site/core.css these”
    button.findme_bo_woo_order_map{height:20px;font-size:12px;font-weight:100;padding:0 10px;border-radius:5px;position:absolute;top:10px;right:130px;z-index:33334;background-color:#fff;color:#000}button.findme_bo_woo_order_map:hover,button.findme_bo_woo_order_map:focus{background-color:#fff}

  • The topic ‘Geolocation contribution’ is closed to new replies.