From 77df0bbf0daf2bc1ae2b03e1b6f4070df156aedb Mon Sep 17 00:00:00 2001 From: Christiano Milfont Date: Thu, 13 Apr 2017 14:31:55 -0300 Subject: [PATCH] [#master] Including onAfterLoad listener to plug native google features when loaded --- dist/react-leaflet-google.js | 4 ++++ dist/react-leaflet-google.min.js | 2 +- src/leaflet.google.js | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/dist/react-leaflet-google.js b/dist/react-leaflet-google.js index de81d19..074d343 100644 --- a/dist/react-leaflet-google.js +++ b/dist/react-leaflet-google.js @@ -218,6 +218,10 @@ return /******/ (function(modules) { // webpackBootstrap self._initMutant(); self._update(); + if (options.onAfterLoad) { + options.onAfterLoad(google); + } + //this._ready = google.maps.Map !== undefined; //if (!this._ready) L.Google.asyncWait.push(this); }); diff --git a/dist/react-leaflet-google.min.js b/dist/react-leaflet-google.min.js index 368dd02..190e46f 100644 --- a/dist/react-leaflet-google.min.js +++ b/dist/react-leaflet-google.min.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("react-leaflet")):"function"==typeof define&&define.amd?define(["react","react-leaflet"],e):"object"==typeof exports?exports.ReactLeaflet=e(require("react"),require("react-leaflet")):t.ReactLeaflet=e(t.React,t[void 0])}(this,function(t,e){return function(t){function e(n){if(i[n])return i[n].exports;var o=i[n]={exports:{},id:n,loaded:!1};return t[n].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var i={};return e.m=t,e.c=i,e.p="",e(0)}([function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.GoogleLayer=void 0;var o=i(1),r=n(o);e.GoogleLayer=r.default},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){var i={};for(var n in t)e.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(t,n)&&(i[n]=t[n]);return i}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var l=function(){function t(t,e){for(var i=0;i1&&(t.style.zIndex=1),i=1):(o=t.src.match(this._satRegexp),o&&(e={x:o[1],y:o[2],z:o[3]}),i=0),e){var r=this._tileCoordsToKey(e);t.style.position="absolute",this._imagesPerTile>1&&(r+="/"+i),r in this._tileCallbacks&&this._tileCallbacks[r]?(this._tileCallbacks[r].pop()(t),this._tileCallbacks[r].length||delete this._tileCallbacks[r]):(n=t.parentNode,n&&(n.removeChild(t),n.removeChild=L.Util.falseFn),r in this._freshTiles?this._freshTiles[r].push(t):this._freshTiles[r]=[t])}else t.src.match(this._staticRegExp)&&(n=t.parentNode,n&&t.parentNode.replaceChild(L.DomUtil.create("img"),t))},_createSingleTile:function(t,e){var i=this._tileCoordsToKey(t);if(i in this._freshTiles){var n=this._freshTiles[i].pop();return this._freshTiles[i].length||delete this._freshTiles[i],L.Util.requestAnimFrame(e),n}var o=L.DomUtil.create("div");return this._tileCallbacks[i]=this._tileCallbacks[i]||[],this._tileCallbacks[i].push(function(t){return function(i){var n=i.parentNode;n&&(n.removeChild(i),n.removeChild=L.Util.falseFn),t.appendChild(i),e()}.bind(this)}.bind(this)(o)),o},_createMultiTile:function(t,e){var i=this._tileCoordsToKey(t),n=L.DomUtil.create("div");n.dataset.pending=this._imagesPerTile;for(var o=0;o1)for(var e=0;e0&&(t+="&libraries="+s.LIBRARIES.join(",")),s.CLIENT&&(t+="&client="+s.CLIENT+"&v="+s.VERSION),s.CHANNEL&&(t+="&channel="+s.CHANNEL),s.LANGUAGE&&(t+="&language="+s.LANGUAGE),s.REGION&&(t+="®ion="+s.REGION),t},s.release=function(l){var u=function(){s.KEY=null,s.LIBRARIES=[],s.CLIENT=null,s.CHANNEL=null,s.LANGUAGE=null,s.REGION=null,s.VERSION=t,i=null,n=!1,o=[],r=[],"undefined"!=typeof window.google&&delete window.google,"undefined"!=typeof window[s.WINDOW_CALLBACK_NAME]&&delete window[s.WINDOW_CALLBACK_NAME],null!==a&&(s.createLoader=a,a=null),null!==e&&(e.parentElement.removeChild(e),e=null),l&&l()};n?s.load(function(){u()}):u()},s.onLoad=function(t){r.push(t)},s.makeMock=function(){a=s.createLoader,s.createLoader=function(){window.google=s._googleMockApiObject,window[s.WINDOW_CALLBACK_NAME]()}};var l=function(t){var e;for(n=!1,null===i&&(i=window.google),e=0;e=0||Object.prototype.hasOwnProperty.call(t,n)&&(i[n]=t[n]);return i}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var l=function(){function t(t,e){for(var i=0;i1&&(t.style.zIndex=1),i=1):(o=t.src.match(this._satRegexp),o&&(e={x:o[1],y:o[2],z:o[3]}),i=0),e){var r=this._tileCoordsToKey(e);t.style.position="absolute",this._imagesPerTile>1&&(r+="/"+i),r in this._tileCallbacks&&this._tileCallbacks[r]?(this._tileCallbacks[r].pop()(t),this._tileCallbacks[r].length||delete this._tileCallbacks[r]):(n=t.parentNode,n&&(n.removeChild(t),n.removeChild=L.Util.falseFn),r in this._freshTiles?this._freshTiles[r].push(t):this._freshTiles[r]=[t])}else t.src.match(this._staticRegExp)&&(n=t.parentNode,n&&t.parentNode.replaceChild(L.DomUtil.create("img"),t))},_createSingleTile:function(t,e){var i=this._tileCoordsToKey(t);if(i in this._freshTiles){var n=this._freshTiles[i].pop();return this._freshTiles[i].length||delete this._freshTiles[i],L.Util.requestAnimFrame(e),n}var o=L.DomUtil.create("div");return this._tileCallbacks[i]=this._tileCallbacks[i]||[],this._tileCallbacks[i].push(function(t){return function(i){var n=i.parentNode;n&&(n.removeChild(i),n.removeChild=L.Util.falseFn),t.appendChild(i),e()}.bind(this)}.bind(this)(o)),o},_createMultiTile:function(t,e){var i=this._tileCoordsToKey(t),n=L.DomUtil.create("div");n.dataset.pending=this._imagesPerTile;for(var o=0;o1)for(var e=0;e0&&(t+="&libraries="+s.LIBRARIES.join(",")),s.CLIENT&&(t+="&client="+s.CLIENT+"&v="+s.VERSION),s.CHANNEL&&(t+="&channel="+s.CHANNEL),s.LANGUAGE&&(t+="&language="+s.LANGUAGE),s.REGION&&(t+="®ion="+s.REGION),t},s.release=function(l){var u=function(){s.KEY=null,s.LIBRARIES=[],s.CLIENT=null,s.CHANNEL=null,s.LANGUAGE=null,s.REGION=null,s.VERSION=t,i=null,n=!1,o=[],r=[],"undefined"!=typeof window.google&&delete window.google,"undefined"!=typeof window[s.WINDOW_CALLBACK_NAME]&&delete window[s.WINDOW_CALLBACK_NAME],null!==a&&(s.createLoader=a,a=null),null!==e&&(e.parentElement.removeChild(e),e=null),l&&l()};n?s.load(function(){u()}):u()},s.onLoad=function(t){r.push(t)},s.makeMock=function(){a=s.createLoader,s.createLoader=function(){window.google=s._googleMockApiObject,window[s.WINDOW_CALLBACK_NAME]()}};var l=function(t){var e;for(n=!1,null===i&&(i=window.google),e=0;e