Changeset 2907026
- Timestamp:
- 05/02/2023 01:19:10 PM (3 years ago)
- Location:
- advanced-google-map-block
- Files:
-
- 8 edited
-
tags/1.0.0/advanced-google-map-block.php (modified) (3 diffs)
-
tags/1.0.0/build/blocks/google-map/block.json (modified) (2 diffs)
-
tags/1.0.0/build/blocks/google-map/index.asset.php (modified) (1 diff)
-
tags/1.0.0/build/blocks/google-map/index.js (modified) (1 diff)
-
trunk/advanced-google-map-block.php (modified) (3 diffs)
-
trunk/build/blocks/google-map/block.json (modified) (2 diffs)
-
trunk/build/blocks/google-map/index.asset.php (modified) (1 diff)
-
trunk/build/blocks/google-map/index.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
advanced-google-map-block/tags/1.0.0/advanced-google-map-block.php
r2905615 r2907026 2 2 3 3 /** 4 * Plugin Name: Advanced Google Map Block5 * Plugin URI: https:// github.com/addonium/advanced-google-map-block6 * Description: Advanced Google Map Blocks for WordPress is a powerful tool for creating interactive and engaging maps in WordPress websites.4 * Plugin Name: Advanced Google Map block 5 * Plugin URI: https://talib.netlify.app 6 * Description: Advanced google map block blocks for WordPress Users 7 7 * Version: 1.0.0 8 8 * Author: TALIB 9 9 * Author URI: https://talib.netlify.app 10 10 * License: GPLv3 11 * Text Domain: advanced-google-map 11 * Text Domain: advanced-google-map-block 12 12 * Domain Path: /languages/ 13 13 */ … … 15 15 // Stop Direct Access 16 16 if (!defined('ABSPATH')) { 17 exit;17 exit; 18 18 } 19 19 … … 23 23 24 24 final class AdvancedGoogleMap { 25 public function __construct() {25 public function __construct() { 26 26 27 // define constants28 $this->agm_define_constants();27 // define constants 28 $this->agm_define_constants(); 29 29 30 // block initialization31 add_action('init', [$this, 'agm_blocks_init']);30 // block initialization 31 add_action('init', [$this, 'agm_blocks_init']); 32 32 33 // blocks category 34 if (version_compare($GLOBALS['wp_version'], '5.7', '<')) { 35 add_filter('block_categories', [$this, 'agm_register_block_category'], 10, 2); 36 } else { 37 add_filter('block_categories_all', [$this, 'agm_register_block_category'], 10, 2); 38 } 39 } 33 // blocks category 34 if (version_compare($GLOBALS['wp_version'], '5.7', '<')) { 35 add_filter('block_categories', [$this, 'agm_register_block_category'], 10, 2); 36 } else { 37 add_filter('block_categories_all', [$this, 'agm_register_block_category'], 10, 2); 38 } 40 39 41 /** 42 * Initialize the plugin 43 */ 40 // enqueue block assets 41 // add_action('enqueue_block_assets', [$this, 'agm_external_libraries']); 42 } 44 43 45 public static function init() { 46 static $instance = false; 47 if (!$instance) { 48 $instance = new self(); 49 } 50 return $instance; 51 } 44 /** 45 * Initialize the plugin 46 */ 52 47 53 /** 54 * Define the plugin constants 55 */ 56 private function agm_define_constants() { 57 define('AGM_VERSION', '1.0.0'); 58 define('AGM_URL', plugin_dir_url(__FILE__)); 59 define('AGM_INC_URL', AGM_URL . 'includes/'); 60 } 48 public static function init() { 49 static $instance = false; 50 if (!$instance) { 51 $instance = new self(); 52 } 53 return $instance; 54 } 61 55 62 /** 63 * Blocks Registration 64 */ 56 /** 57 * Define the plugin constants 58 */ 59 private function agm_define_constants() { 60 define('AGM_VERSION', '1.0.0'); 61 define('AGM_URL', plugin_dir_url(__FILE__)); 62 define('AGM_INC_URL', AGM_URL . 'includes/'); 63 } 65 64 66 public function agm_register_block($name, $options = array()) { 67 register_block_type(__DIR__ . '/build/blocks/' . $name, $options); 68 } 65 /** 66 * Blocks Registration 67 */ 69 68 70 /** 71 * Blocks Initialization 72 */ 73 public function agm_blocks_init() { 74 // register single block 75 // $this->agm_register_block('gmap'); 76 $this->agm_register_block('google-map'); 77 } 69 public function agm_register_block($name, $options = array()) { 70 register_block_type(__DIR__ . '/build/blocks/' . $name, $options); 71 } 78 72 79 /** 80 * Register Block Category 81 */ 73 /** 74 * Blocks Initialization 75 */ 76 public function agm_blocks_init() { 77 // register single block 78 // $this->agm_register_block('gmap'); 79 $this->agm_register_block('google-map'); 80 } 82 81 83 public function agm_register_block_category($categories, $post) { 84 return array_merge( 85 array( 86 array( 87 'slug' => 'advanced-google-map', 88 'title' => __('Advanced Google Map', 'advanced-google-map'), 89 ), 90 ), 91 $categories, 92 ); 93 } 82 /** 83 * Register Block Category 84 */ 85 86 public function agm_register_block_category($categories, $post) { 87 return array_merge( 88 array( 89 array( 90 'slug' => 'advanced-google-map-block', 91 'title' => __('Advanced google map block', 'advanced-google-map-block'), 92 ), 93 ), 94 $categories, 95 ); 96 } 97 98 /** 99 * Enqueue Block Assets 100 */ 101 public function agm_external_libraries() { 102 $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min'; 103 // enqueue JS 104 wp_register_script('gmap-api', '//maps.googleapis.com/maps/api/js?sensor=true', ['jquery'], null, true); 105 wp_enqueue_script('gmap-js', AGM_INC_URL . 'js/gmaps' . $suffix . '.js', null, AGM_VERSION, true); 106 wp_enqueue_script('agm-lib', AGM_INC_URL . 'js/plugin.js', null, AGM_VERSION, true); 107 } 94 108 } 95 109 -
advanced-google-map-block/tags/1.0.0/build/blocks/google-map/block.json
r2905615 r2907026 6 6 "category": "advanced-google-map-block", 7 7 "icon": "location", 8 "description": "Advanced Google Map Block for WordPress Users.",8 "description": "Advanced google map block for WordPress Users.", 9 9 "supports": { 10 10 "html": false, … … 40 40 "default": "en" 41 41 }, 42 "width": { 43 "type": "number", 44 "default": 450 45 }, 42 46 "height": { 43 47 "type": "number", -
advanced-google-map-block/tags/1.0.0/build/blocks/google-map/index.asset.php
r2905615 r2907026 1 <?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => ' ba9ac357852674df7abf');1 <?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => 'd67dfd693488947ffe6a'); -
advanced-google-map-block/tags/1.0.0/build/blocks/google-map/index.js
r2905615 r2907026 1 (()=>{"use strict";var e,a={410:()=>{const e=window.wp.blocks,a=JSON.parse('{"apiVersion":2,"name":"advanced-google-map-block/google-map","version":"1.0.0","title":"Google Map","category":"advanced-google-map-block","icon":"location","description":"Advanced Google Map Block for WordPress Users.","supports":{"html":false,"anchor":true},"keywords":["google","map","location","address","place","maps","google map"],"attributes":{"id":{"type":"string"},"location":{"type":"string","default":"Nasa"},"zoom":{"type":"number","default":12},"mapType":{"type":"string","default":"roadmap"},"language":{"type":"string","default":"en"},"height":{"type":"number","default":350}},"textdomain":"advanced-google-map-block","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css"}'),l=window.wp.element,o=window.wp.i18n,n=window.wp.blockEditor,c=window.wp.components,{__}=wp.i18n,{Fragment:g}=(__("Black","boilerplate"),__("White","boilerplate"),__("Red","boilerplate"),__("Green","boilerplate"),__("Blue","boilerplate"),__("Yellow","boilerplate"),wp.element);(0,e.registerBlockType)(a,{edit:function(e){let{attributes:a,setAttributes:d,clientId:t}=e;const{id:i,language:p,location:b,zoom:v,mapType:m,latitude:_,longitude:r,height:u}=a,s=p||"en",k=`https://www.google.com/maps/embed/v1/place?key=AIzaSyAsd_d46higiozY-zNqtr7zdA81Soswje4&q=${encodeURI(b)}&zoom=${v}&maptype=${m}&language=${s}${_&&r?"¢er=37.7749,-122.4194":""}`;return d({id:t.slice(0,8)}),(0,l.createElement)(g,null,(0,l.createElement)(n.InspectorControls,null,(0,l.createElement)(c.PanelBody,{title:(0,o.__)("Map Settings","advanced-google-map-block"),initialOpen:!1},(0,l.createElement)(c.TextControl,{label:(0,o.__)("Location","advanced-google-map-block"),help:(0,o.__)("Type the specified location name that you want to display on the map.","advanced-google-map-block"),value:b,placeholder:(0,o.__)("Enter the Location Name","advanced-goole-map"),onChange:e=>d({location:e})}),(0,l.createElement)(c.RangeControl,{label:(0,o.__)("Zoom Level","advanced-google-map-block"),help:(0,o.__)("Set the initial zoom level of the map. The higher the value will be the more zoomed in the map","advanced-google-map-block"),value:v,onChange:e=>d({zoom:e}),min:1,max:21}),(0,l.createElement)(c.SelectControl,{label:(0,o.__)("Map View Type","advanced-google-map-block"),help:(0,o.__)("Set the type of map to be displayed, such as road map, satellite imagery, or terrain.","advanced-google-map-block"),value:m,options:[{label:(0,o.__)("Roadmap","advanced-google-map-block"),value:"roadmap"},{label:(0,o.__)("Satellite","advanced-google-map-block"),value:"satellite"}],onChange:e=>{d({mapType:e})}}),(0,l.createElement)(c.SelectControl,{label:(0,o.__)("Select Language for your Location"),help:(0,o.__)("Select the language of the map interface. such as for English select English or French select French","advanced-google-map-block"),value:p,options:[{value:"af",label:(0,o.__)("Afrikaans","advanced-google-map-block")},{value:"sq",label:(0,o.__)("Albanian","advanced-google-map-block")},{value:"am",label:(0,o.__)("Amharic","advanced-google-map-block")},{value:"ar",label:(0,o.__)("Arabic","advanced-google-map-block")},{value:"hy",label:(0,o.__)("Armenian","advanced-google-map-block")},{value:"az",label:(0,o.__)("Azerbaijani","advanced-google-map-block")},{value:"eu",label:(0,o.__)("Basque","advanced-google-map-block")},{value:"be",label:(0,o.__)("Belarusian","advanced-google-map-block")},{value:"bn",label:(0,o.__)("Bengali","advanced-google-map-block")},{value:"bs",label:(0,o.__)("Bosnian","advanced-google-map-block")},{value:"bg",label:(0,o.__)("Bulgarian","advanced-google-map-block")},{value:"my",label:(0,o.__)("Burmese","advanced-google-map-block")},{value:"ca",label:(0,o.__)("Catalan","advanced-google-map-block")},{value:"zh",label:(0,o.__)("Chinese","advanced-google-map-block")},{value:"hr",label:(0,o.__)("Croatian","advanced-google-map-block")},{value:"cs",label:(0,o.__)("Czech","advanced-google-map-block")},{value:"da",label:(0,o.__)("Danish","advanced-google-map-block")},{value:"nl",label:(0,o.__)("Dutch","advanced-google-map-block")},{value:"en",label:(0,o.__)("English","advanced-google-map-block")},{value:"et",label:(0,o.__)("Estonian","advanced-google-map-block")},{value:"fa",label:(0,o.__)("Farsi","advanced-google-map-block")},{value:"fi",label:(0,o.__)("Finnish","advanced-google-map-block")},{value:"fr",label:(0,o.__)("French","advanced-google-map-block")},{value:"gl",label:(0,o.__)("Galician","advanced-google-map-block")},{value:"ka",label:(0,o.__)("Georgian","advanced-google-map-block")},{value:"de",label:(0,o.__)("German","advanced-google-map-block")},{value:"el",label:(0,o.__)("Greek","advanced-google-map-block")},{value:"gu",label:(0,o.__)("Gujarati","advanced-google-map-block")},{value:"iw",label:(0,o.__)("Hebrew","advanced-google-map-block")},{value:"hi",label:(0,o.__)("Hindi","advanced-google-map-block")},{value:"hu",label:(0,o.__)("Hungarian","advanced-google-map-block")},{value:"is",label:(0,o.__)("Icelandic","advanced-google-map-block")},{value:"id",label:(0,o.__)("Indonesian","advanced-google-map-block")},{value:"it",label:(0,o.__)("Italian","advanced-google-map-block")},{value:"ja",label:(0,o.__)("Japanese","advanced-google-map-block")},{value:"kn",label:(0,o.__)("Kannada","advanced-google-map-block")},{value:"kk",label:(0,o.__)("Kazakh","advanced-google-map-block")},{value:"km",label:(0,o.__)("Khmer","advanced-google-map-block")},{value:"ko",label:(0,o.__)("Korean","advanced-google-map-block")},{value:"ky",label:(0,o.__)("Kyrgyz","advanced-google-map-block")},{value:"lo",label:(0,o.__)("Lao","advanced-google-map-block")},{value:"lv",label:(0,o.__)("Latvian","advanced-google-map-block")},{value:"lt",label:(0,o.__)("Lithuanian","advanced-google-map-block")},{value:"mk",label:(0,o.__)("Macedonian","advanced-google-map-block")},{value:"ms",label:(0,o.__)("Malay","advanced-google-map-block")},{value:"ml",label:(0,o.__)("Malayalam","advanced-google-map-block")},{value:"mr",label:(0,o.__)("Marathi","advanced-google-map-block")},{value:"mn",label:(0,o.__)("Mongolian","advanced-google-map-block")},{value:"ne",label:(0,o.__)("Nepali","advanced-google-map-block")},{value:"no",label:(0,o.__)("Norwegian","advanced-google-map-block")},{value:"pl",label:(0,o.__)("Polish","advanced-google-map-block")},{value:"pt",label:(0,o.__)("Portuguese","advanced-google-map-block")},{value:"pa",label:(0,o.__)("Punjabi","advanced-google-map-block")},{value:"ro",label:(0,o.__)("Romanian","advanced-google-map-block")},{value:"ru",label:(0,o.__)("Russian","advanced-google-map-block")},{value:"sr",label:(0,o.__)("Serbian","advanced-google-map-block")},{value:"si",label:(0,o.__)("Sinhalese","advanced-google-map-block")},{value:"sk",label:(0,o.__)("Slovak","advanced-google-map-block")},{value:"sl",label:(0,o.__)("Slovenian","advanced-google-map-block")},{value:"es",label:(0,o.__)("Spanish","advanced-google-map-block")},{value:"sw",label:(0,o.__)("Swahili","advanced-google-map-block")},{value:"sv",label:(0,o.__)("Swedish","advanced-google-map-block")},{value:"ta",label:(0,o.__)("Tamil","advanced-google-map-block")},{value:"te",label:(0,o.__)("Telugu","advanced-google-map-block")},{value:"th",label:(0,o.__)("Thai","advanced-google-map-block")},{value:"tr",label:(0,o.__)("Turkish","advanced-google-map-block")},{value:"uk",label:(0,o.__)("Ukrainian","advanced-google-map-block")},{value:"ur",label:(0,o.__)("Urdu","advanced-google-map-block")},{value:"uz",label:(0,o.__)("Uzbek","advanced-google-map-block")},{value:"vi",label:(0,o.__)("Vietnamese","advanced-google-map-block")},{value:"zu",label:(0,o.__)("Zulu","advanced-google-map-block")}],onChange:e=>{d({language:e})}}),(0,l.createElement)(c.RangeControl,{label:(0,o.__)("Height","advanced-google-map-block"),help:(0,o.__)("Specifies the height of the map in pixels.","advanced-google-map-block"),value:u,onChange:e=>d({height:e}),min:200,max:1800})),(0,l.createElement)(c.PanelBody,{title:(0,o.__)("Map Settings Additional"),initialOpen:!1},(0,l.createElement)("p",null,(0,o.__)(" This parameter sets the center of the map to a specific location. The format for this parameter is latitude and longitude, separated by a comma. For example: center=37.7749,-122.4194","advanced-google-map-block")),(0,l.createElement)(c.TextControl,{label:(0,o.__)("Latitude","advanced-google-map-block"),placeholder:(0,o.__)("37.7749","advanced-google-map-block"),value:_,onChange:e=>d({latitude:e})}),(0,l.createElement)(c.TextControl,{label:(0,o.__)("Longitude","advanced-google-map-block"),placeholder:(0,o.__)("-122.4194","advanced-google-map-block"),value:r,onChange:e=>d({longitude:e})}))),(0,l.createElement)("div",(0,n.useBlockProps)({className:"agm-google-map agm-google-map-"+i}),(0,l.createElement)("iframe",{className:"agm-google-map__iframe",title:(0,o.__)("Advanced Google Map Block","advanced-google-map-block"),src:k,width:"100%",height:u,loading:"lazy"})))},save:function(e){let{attributes:a}=e;const{id:c,language:g,location:d,zoom:t,mapType:i,height:p,latitude:b,longitude:v}=a,m=g||"en",_=b&&v?`¢er=${b},${v}`:"",r=`https://www.google.com/maps/embed/v1/place?key=AIzaSyAsd_d46higiozY-zNqtr7zdA81Soswje4&q=${encodeURI(d)}&maptype=${i}&zoom=${t}&language=${m}${_}`;return(0,l.createElement)("div",n.useBlockProps.save(),(0,l.createElement)("iframe",{className:"agm-google-map__iframe",title:(0,o.__)("Advanced Google Map Block","advanced-google-map-block"),src:r,width:"100%",height:p,loading:"lazy"}))}})}},l={};function o(e){var n=l[e];if(void 0!==n)return n.exports;var c=l[e]={exports:{}};return a[e](c,c.exports,o),c.exports}o.m=a,e=[],o.O=(a,l,n,c)=>{if(!l){var g=1/0;for(p=0;p<e.length;p++){for(var[l,n,c]=e[p],d=!0,t=0;t<l.length;t++)(!1&c||g>=c)&&Object.keys(o.O).every((e=>o.O[e](l[t])))?l.splice(t--,1):(d=!1,c<g&&(g=c));if(d){e.splice(p--,1);var i=n();void 0!==i&&(a=i)}}return a}c=c||0;for(var p=e.length;p>0&&e[p-1][2]>c;p--)e[p]=e[p-1];e[p]=[l,n,c]},o.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),(()=>{var e={815:0,299:0};o.O.j=a=>0===e[a];var a=(a,l)=>{var n,c,[g,d,t]=l,i=0;if(g.some((a=>0!==e[a]))){for(n in d)o.o(d,n)&&(o.m[n]=d[n]);if(t)var p=t(o)}for(a&&a(l);i<g.length;i++)c=g[i],o.o(e,c)&&e[c]&&e[c][0](),e[c]=0;return o.O(p)},l=globalThis.webpackChunkadvanced_google_map_block=globalThis.webpackChunkadvanced_google_map_block||[];l.forEach(a.bind(null,0)),l.push=a.bind(null,l.push.bind(l))})();var n=o.O(void 0,[299],(()=>o(410)));n=o.O(n)})();1 !function(){"use strict";var e,a={410:function(){var e=window.wp.blocks,a=JSON.parse('{"apiVersion":2,"name":"advanced-google-map-block/google-map","version":"1.0.0","title":"Google Map","category":"advanced-google-map-block","icon":"location","description":"Advanced google map block for WordPress Users.","supports":{"html":false,"anchor":true},"keywords":["google","map","location","address","place","maps","google map"],"attributes":{"id":{"type":"string"},"location":{"type":"string","default":"Nasa"},"zoom":{"type":"number","default":12},"mapType":{"type":"string","default":"roadmap"},"language":{"type":"string","default":"en"},"width":{"type":"number","default":450},"height":{"type":"number","default":350}},"textdomain":"advanced-google-map-block","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css"}'),l=window.wp.element,o=window.wp.i18n,n=window.wp.blockEditor,c=window.wp.components;const{__:__}=wp.i18n;__("Black","boilerplate"),__("White","boilerplate"),__("Red","boilerplate"),__("Green","boilerplate"),__("Blue","boilerplate"),__("Yellow","boilerplate");const{Fragment:g}=wp.element;(0,e.registerBlockType)(a,{edit:function(e){let{attributes:a,setAttributes:d,clientId:t}=e;const{id:i,language:p,location:b,zoom:v,mapType:m,latitude:_,longitude:r,height:u}=a,s=p||"en",k=`https://www.google.com/maps/embed/v1/place?key=AIzaSyAsd_d46higiozY-zNqtr7zdA81Soswje4&q=${encodeURI(b)}&zoom=${v}&maptype=${m}&language=${s}${_&&r?"¢er=37.7749,-122.4194":""}`;return d({id:t.slice(0,8)}),(0,l.createElement)(g,null,(0,l.createElement)(n.InspectorControls,null,(0,l.createElement)(c.PanelBody,{title:(0,o.__)("Map Settings","advanced-google-map-block"),initialOpen:!1},(0,l.createElement)(c.TextControl,{label:(0,o.__)("Location","advanced-google-map-block"),help:(0,o.__)("Type the specified location name that you want to display on the map.","advanced-google-map-block"),value:b,placeholder:(0,o.__)("Enter the Location Name","advanced-goole-map"),onChange:e=>d({location:e})}),(0,l.createElement)(c.RangeControl,{label:(0,o.__)("Zoom Level","advanced-google-map-block"),help:(0,o.__)("Set the initial zoom level of the map. The higher the value will be the more zoomed in the map","advanced-google-map-block"),value:v,onChange:e=>d({zoom:e}),min:1,max:21}),(0,l.createElement)(c.SelectControl,{label:(0,o.__)("Map View Type","advanced-google-map-block"),help:(0,o.__)("Set the type of map to be displayed, such as road map, satellite imagery, or terrain.","advanced-google-map-block"),value:m,options:[{label:(0,o.__)("Roadmap","advanced-google-map-block"),value:"roadmap"},{label:(0,o.__)("Satellite","advanced-google-map-block"),value:"satellite"}],onChange:e=>{d({mapType:e})}}),(0,l.createElement)(c.SelectControl,{label:(0,o.__)("Select Language for your Location"),help:(0,o.__)("Select the language of the map interface. such as for English select English or French select French","advanced-google-map-block"),value:p,options:[{value:"af",label:(0,o.__)("Afrikaans","advanced-google-map-block")},{value:"sq",label:(0,o.__)("Albanian","advanced-google-map-block")},{value:"am",label:(0,o.__)("Amharic","advanced-google-map-block")},{value:"ar",label:(0,o.__)("Arabic","advanced-google-map-block")},{value:"hy",label:(0,o.__)("Armenian","advanced-google-map-block")},{value:"az",label:(0,o.__)("Azerbaijani","advanced-google-map-block")},{value:"eu",label:(0,o.__)("Basque","advanced-google-map-block")},{value:"be",label:(0,o.__)("Belarusian","advanced-google-map-block")},{value:"bn",label:(0,o.__)("Bengali","advanced-google-map-block")},{value:"bs",label:(0,o.__)("Bosnian","advanced-google-map-block")},{value:"bg",label:(0,o.__)("Bulgarian","advanced-google-map-block")},{value:"my",label:(0,o.__)("Burmese","advanced-google-map-block")},{value:"ca",label:(0,o.__)("Catalan","advanced-google-map-block")},{value:"zh",label:(0,o.__)("Chinese","advanced-google-map-block")},{value:"hr",label:(0,o.__)("Croatian","advanced-google-map-block")},{value:"cs",label:(0,o.__)("Czech","advanced-google-map-block")},{value:"da",label:(0,o.__)("Danish","advanced-google-map-block")},{value:"nl",label:(0,o.__)("Dutch","advanced-google-map-block")},{value:"en",label:(0,o.__)("English","advanced-google-map-block")},{value:"et",label:(0,o.__)("Estonian","advanced-google-map-block")},{value:"fa",label:(0,o.__)("Farsi","advanced-google-map-block")},{value:"fi",label:(0,o.__)("Finnish","advanced-google-map-block")},{value:"fr",label:(0,o.__)("French","advanced-google-map-block")},{value:"gl",label:(0,o.__)("Galician","advanced-google-map-block")},{value:"ka",label:(0,o.__)("Georgian","advanced-google-map-block")},{value:"de",label:(0,o.__)("German","advanced-google-map-block")},{value:"el",label:(0,o.__)("Greek","advanced-google-map-block")},{value:"gu",label:(0,o.__)("Gujarati","advanced-google-map-block")},{value:"iw",label:(0,o.__)("Hebrew","advanced-google-map-block")},{value:"hi",label:(0,o.__)("Hindi","advanced-google-map-block")},{value:"hu",label:(0,o.__)("Hungarian","advanced-google-map-block")},{value:"is",label:(0,o.__)("Icelandic","advanced-google-map-block")},{value:"id",label:(0,o.__)("Indonesian","advanced-google-map-block")},{value:"it",label:(0,o.__)("Italian","advanced-google-map-block")},{value:"ja",label:(0,o.__)("Japanese","advanced-google-map-block")},{value:"kn",label:(0,o.__)("Kannada","advanced-google-map-block")},{value:"kk",label:(0,o.__)("Kazakh","advanced-google-map-block")},{value:"km",label:(0,o.__)("Khmer","advanced-google-map-block")},{value:"ko",label:(0,o.__)("Korean","advanced-google-map-block")},{value:"ky",label:(0,o.__)("Kyrgyz","advanced-google-map-block")},{value:"lo",label:(0,o.__)("Lao","advanced-google-map-block")},{value:"lv",label:(0,o.__)("Latvian","advanced-google-map-block")},{value:"lt",label:(0,o.__)("Lithuanian","advanced-google-map-block")},{value:"mk",label:(0,o.__)("Macedonian","advanced-google-map-block")},{value:"ms",label:(0,o.__)("Malay","advanced-google-map-block")},{value:"ml",label:(0,o.__)("Malayalam","advanced-google-map-block")},{value:"mr",label:(0,o.__)("Marathi","advanced-google-map-block")},{value:"mn",label:(0,o.__)("Mongolian","advanced-google-map-block")},{value:"ne",label:(0,o.__)("Nepali","advanced-google-map-block")},{value:"no",label:(0,o.__)("Norwegian","advanced-google-map-block")},{value:"pl",label:(0,o.__)("Polish","advanced-google-map-block")},{value:"pt",label:(0,o.__)("Portuguese","advanced-google-map-block")},{value:"pa",label:(0,o.__)("Punjabi","advanced-google-map-block")},{value:"ro",label:(0,o.__)("Romanian","advanced-google-map-block")},{value:"ru",label:(0,o.__)("Russian","advanced-google-map-block")},{value:"sr",label:(0,o.__)("Serbian","advanced-google-map-block")},{value:"si",label:(0,o.__)("Sinhalese","advanced-google-map-block")},{value:"sk",label:(0,o.__)("Slovak","advanced-google-map-block")},{value:"sl",label:(0,o.__)("Slovenian","advanced-google-map-block")},{value:"es",label:(0,o.__)("Spanish","advanced-google-map-block")},{value:"sw",label:(0,o.__)("Swahili","advanced-google-map-block")},{value:"sv",label:(0,o.__)("Swedish","advanced-google-map-block")},{value:"ta",label:(0,o.__)("Tamil","advanced-google-map-block")},{value:"te",label:(0,o.__)("Telugu","advanced-google-map-block")},{value:"th",label:(0,o.__)("Thai","advanced-google-map-block")},{value:"tr",label:(0,o.__)("Turkish","advanced-google-map-block")},{value:"uk",label:(0,o.__)("Ukrainian","advanced-google-map-block")},{value:"ur",label:(0,o.__)("Urdu","advanced-google-map-block")},{value:"uz",label:(0,o.__)("Uzbek","advanced-google-map-block")},{value:"vi",label:(0,o.__)("Vietnamese","advanced-google-map-block")},{value:"zu",label:(0,o.__)("Zulu","advanced-google-map-block")}],onChange:e=>{d({language:e})}}),(0,l.createElement)(c.RangeControl,{label:(0,o.__)("Height","advanced-google-map-block"),help:(0,o.__)("Specifies the height of the map in pixels.","advanced-google-map-block"),value:u,onChange:e=>d({height:e}),min:200,max:1800})),(0,l.createElement)(c.PanelBody,{title:(0,o.__)("Map Settings Additional"),initialOpen:!1},(0,l.createElement)("p",null,(0,o.__)(" This parameter sets the center of the map to a specific location. The format for this parameter is latitude and longitude, separated by a comma. For example: center=37.7749,-122.4194","advanced-google-map-block")),(0,l.createElement)(c.TextControl,{label:(0,o.__)("Latitude","advanced-google-map-block"),placeholder:(0,o.__)("37.7749","advanced-google-map-block"),value:_,onChange:e=>d({latitude:e})}),(0,l.createElement)(c.TextControl,{label:(0,o.__)("Longitude","advanced-google-map-block"),placeholder:(0,o.__)("-122.4194","advanced-google-map-block"),value:r,onChange:e=>d({longitude:e})}))),(0,l.createElement)("div",(0,n.useBlockProps)({className:"agm-google-map agm-google-map-"+i}),(0,l.createElement)("iframe",{className:"agm-google-map__iframe",title:(0,o.__)("Advanced google map block","advanced-google-map-block"),src:k,width:"100%",height:u,loading:"lazy"})))},save:function(e){let{attributes:a}=e;const{id:c,language:g,location:d,zoom:t,mapType:i,height:p,latitude:b,longitude:v}=a,m=g||"en",_=b&&v?`¢er=${b},${v}`:"",r=`https://www.google.com/maps/embed/v1/place?key=AIzaSyAsd_d46higiozY-zNqtr7zdA81Soswje4&q=${encodeURI(d)}&maptype=${i}&zoom=${t}&language=${m}${_}`;return(0,l.createElement)("div",n.useBlockProps.save(),(0,l.createElement)("iframe",{className:"agm-google-map__iframe",title:(0,o.__)("Advanced google map block","advanced-google-map-block"),src:r,width:"100%",height:p,loading:"lazy"}))}})}},l={};function o(e){var n=l[e];if(void 0!==n)return n.exports;var c=l[e]={exports:{}};return a[e](c,c.exports,o),c.exports}o.m=a,e=[],o.O=function(a,l,n,c){if(!l){var g=1/0;for(p=0;p<e.length;p++){l=e[p][0],n=e[p][1],c=e[p][2];for(var d=!0,t=0;t<l.length;t++)(!1&c||g>=c)&&Object.keys(o.O).every((function(e){return o.O[e](l[t])}))?l.splice(t--,1):(d=!1,c<g&&(g=c));if(d){e.splice(p--,1);var i=n();void 0!==i&&(a=i)}}return a}c=c||0;for(var p=e.length;p>0&&e[p-1][2]>c;p--)e[p]=e[p-1];e[p]=[l,n,c]},o.o=function(e,a){return Object.prototype.hasOwnProperty.call(e,a)},function(){var e={815:0,299:0};o.O.j=function(a){return 0===e[a]};var a=function(a,l){var n,c,g=l[0],d=l[1],t=l[2],i=0;if(g.some((function(a){return 0!==e[a]}))){for(n in d)o.o(d,n)&&(o.m[n]=d[n]);if(t)var p=t(o)}for(a&&a(l);i<g.length;i++)c=g[i],o.o(e,c)&&e[c]&&e[c][0](),e[c]=0;return o.O(p)},l=self.webpackChunkadvanced_google_map_block=self.webpackChunkadvanced_google_map_block||[];l.forEach(a.bind(null,0)),l.push=a.bind(null,l.push.bind(l))}();var n=o.O(void 0,[299],(function(){return o(410)}));n=o.O(n)}(); -
advanced-google-map-block/trunk/advanced-google-map-block.php
r2905615 r2907026 2 2 3 3 /** 4 * Plugin Name: Advanced Google Map Block5 * Plugin URI: https:// github.com/addonium/advanced-google-map-block6 * Description: Advanced Google Map Blocks for WordPress is a powerful tool for creating interactive and engaging maps in WordPress websites.4 * Plugin Name: Advanced Google Map block 5 * Plugin URI: https://talib.netlify.app 6 * Description: Advanced google map block blocks for WordPress Users 7 7 * Version: 1.0.0 8 8 * Author: TALIB 9 9 * Author URI: https://talib.netlify.app 10 10 * License: GPLv3 11 * Text Domain: advanced-google-map 11 * Text Domain: advanced-google-map-block 12 12 * Domain Path: /languages/ 13 13 */ … … 15 15 // Stop Direct Access 16 16 if (!defined('ABSPATH')) { 17 exit;17 exit; 18 18 } 19 19 … … 23 23 24 24 final class AdvancedGoogleMap { 25 public function __construct() {25 public function __construct() { 26 26 27 // define constants28 $this->agm_define_constants();27 // define constants 28 $this->agm_define_constants(); 29 29 30 // block initialization31 add_action('init', [$this, 'agm_blocks_init']);30 // block initialization 31 add_action('init', [$this, 'agm_blocks_init']); 32 32 33 // blocks category 34 if (version_compare($GLOBALS['wp_version'], '5.7', '<')) { 35 add_filter('block_categories', [$this, 'agm_register_block_category'], 10, 2); 36 } else { 37 add_filter('block_categories_all', [$this, 'agm_register_block_category'], 10, 2); 38 } 39 } 33 // blocks category 34 if (version_compare($GLOBALS['wp_version'], '5.7', '<')) { 35 add_filter('block_categories', [$this, 'agm_register_block_category'], 10, 2); 36 } else { 37 add_filter('block_categories_all', [$this, 'agm_register_block_category'], 10, 2); 38 } 40 39 41 /** 42 * Initialize the plugin 43 */ 40 // enqueue block assets 41 // add_action('enqueue_block_assets', [$this, 'agm_external_libraries']); 42 } 44 43 45 public static function init() { 46 static $instance = false; 47 if (!$instance) { 48 $instance = new self(); 49 } 50 return $instance; 51 } 44 /** 45 * Initialize the plugin 46 */ 52 47 53 /** 54 * Define the plugin constants 55 */ 56 private function agm_define_constants() { 57 define('AGM_VERSION', '1.0.0'); 58 define('AGM_URL', plugin_dir_url(__FILE__)); 59 define('AGM_INC_URL', AGM_URL . 'includes/'); 60 } 48 public static function init() { 49 static $instance = false; 50 if (!$instance) { 51 $instance = new self(); 52 } 53 return $instance; 54 } 61 55 62 /** 63 * Blocks Registration 64 */ 56 /** 57 * Define the plugin constants 58 */ 59 private function agm_define_constants() { 60 define('AGM_VERSION', '1.0.0'); 61 define('AGM_URL', plugin_dir_url(__FILE__)); 62 define('AGM_INC_URL', AGM_URL . 'includes/'); 63 } 65 64 66 public function agm_register_block($name, $options = array()) { 67 register_block_type(__DIR__ . '/build/blocks/' . $name, $options); 68 } 65 /** 66 * Blocks Registration 67 */ 69 68 70 /** 71 * Blocks Initialization 72 */ 73 public function agm_blocks_init() { 74 // register single block 75 // $this->agm_register_block('gmap'); 76 $this->agm_register_block('google-map'); 77 } 69 public function agm_register_block($name, $options = array()) { 70 register_block_type(__DIR__ . '/build/blocks/' . $name, $options); 71 } 78 72 79 /** 80 * Register Block Category 81 */ 73 /** 74 * Blocks Initialization 75 */ 76 public function agm_blocks_init() { 77 // register single block 78 // $this->agm_register_block('gmap'); 79 $this->agm_register_block('google-map'); 80 } 82 81 83 public function agm_register_block_category($categories, $post) { 84 return array_merge( 85 array( 86 array( 87 'slug' => 'advanced-google-map', 88 'title' => __('Advanced Google Map', 'advanced-google-map'), 89 ), 90 ), 91 $categories, 92 ); 93 } 82 /** 83 * Register Block Category 84 */ 85 86 public function agm_register_block_category($categories, $post) { 87 return array_merge( 88 array( 89 array( 90 'slug' => 'advanced-google-map-block', 91 'title' => __('Advanced google map block', 'advanced-google-map-block'), 92 ), 93 ), 94 $categories, 95 ); 96 } 97 98 /** 99 * Enqueue Block Assets 100 */ 101 public function agm_external_libraries() { 102 $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min'; 103 // enqueue JS 104 wp_register_script('gmap-api', '//maps.googleapis.com/maps/api/js?sensor=true', ['jquery'], null, true); 105 wp_enqueue_script('gmap-js', AGM_INC_URL . 'js/gmaps' . $suffix . '.js', null, AGM_VERSION, true); 106 wp_enqueue_script('agm-lib', AGM_INC_URL . 'js/plugin.js', null, AGM_VERSION, true); 107 } 94 108 } 95 109 -
advanced-google-map-block/trunk/build/blocks/google-map/block.json
r2905615 r2907026 6 6 "category": "advanced-google-map-block", 7 7 "icon": "location", 8 "description": "Advanced Google Map Block for WordPress Users.",8 "description": "Advanced google map block for WordPress Users.", 9 9 "supports": { 10 10 "html": false, … … 40 40 "default": "en" 41 41 }, 42 "width": { 43 "type": "number", 44 "default": 450 45 }, 42 46 "height": { 43 47 "type": "number", -
advanced-google-map-block/trunk/build/blocks/google-map/index.asset.php
r2905615 r2907026 1 <?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => ' ba9ac357852674df7abf');1 <?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => 'd67dfd693488947ffe6a'); -
advanced-google-map-block/trunk/build/blocks/google-map/index.js
r2905615 r2907026 1 (()=>{"use strict";var e,a={410:()=>{const e=window.wp.blocks,a=JSON.parse('{"apiVersion":2,"name":"advanced-google-map-block/google-map","version":"1.0.0","title":"Google Map","category":"advanced-google-map-block","icon":"location","description":"Advanced Google Map Block for WordPress Users.","supports":{"html":false,"anchor":true},"keywords":["google","map","location","address","place","maps","google map"],"attributes":{"id":{"type":"string"},"location":{"type":"string","default":"Nasa"},"zoom":{"type":"number","default":12},"mapType":{"type":"string","default":"roadmap"},"language":{"type":"string","default":"en"},"height":{"type":"number","default":350}},"textdomain":"advanced-google-map-block","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css"}'),l=window.wp.element,o=window.wp.i18n,n=window.wp.blockEditor,c=window.wp.components,{__}=wp.i18n,{Fragment:g}=(__("Black","boilerplate"),__("White","boilerplate"),__("Red","boilerplate"),__("Green","boilerplate"),__("Blue","boilerplate"),__("Yellow","boilerplate"),wp.element);(0,e.registerBlockType)(a,{edit:function(e){let{attributes:a,setAttributes:d,clientId:t}=e;const{id:i,language:p,location:b,zoom:v,mapType:m,latitude:_,longitude:r,height:u}=a,s=p||"en",k=`https://www.google.com/maps/embed/v1/place?key=AIzaSyAsd_d46higiozY-zNqtr7zdA81Soswje4&q=${encodeURI(b)}&zoom=${v}&maptype=${m}&language=${s}${_&&r?"¢er=37.7749,-122.4194":""}`;return d({id:t.slice(0,8)}),(0,l.createElement)(g,null,(0,l.createElement)(n.InspectorControls,null,(0,l.createElement)(c.PanelBody,{title:(0,o.__)("Map Settings","advanced-google-map-block"),initialOpen:!1},(0,l.createElement)(c.TextControl,{label:(0,o.__)("Location","advanced-google-map-block"),help:(0,o.__)("Type the specified location name that you want to display on the map.","advanced-google-map-block"),value:b,placeholder:(0,o.__)("Enter the Location Name","advanced-goole-map"),onChange:e=>d({location:e})}),(0,l.createElement)(c.RangeControl,{label:(0,o.__)("Zoom Level","advanced-google-map-block"),help:(0,o.__)("Set the initial zoom level of the map. The higher the value will be the more zoomed in the map","advanced-google-map-block"),value:v,onChange:e=>d({zoom:e}),min:1,max:21}),(0,l.createElement)(c.SelectControl,{label:(0,o.__)("Map View Type","advanced-google-map-block"),help:(0,o.__)("Set the type of map to be displayed, such as road map, satellite imagery, or terrain.","advanced-google-map-block"),value:m,options:[{label:(0,o.__)("Roadmap","advanced-google-map-block"),value:"roadmap"},{label:(0,o.__)("Satellite","advanced-google-map-block"),value:"satellite"}],onChange:e=>{d({mapType:e})}}),(0,l.createElement)(c.SelectControl,{label:(0,o.__)("Select Language for your Location"),help:(0,o.__)("Select the language of the map interface. such as for English select English or French select French","advanced-google-map-block"),value:p,options:[{value:"af",label:(0,o.__)("Afrikaans","advanced-google-map-block")},{value:"sq",label:(0,o.__)("Albanian","advanced-google-map-block")},{value:"am",label:(0,o.__)("Amharic","advanced-google-map-block")},{value:"ar",label:(0,o.__)("Arabic","advanced-google-map-block")},{value:"hy",label:(0,o.__)("Armenian","advanced-google-map-block")},{value:"az",label:(0,o.__)("Azerbaijani","advanced-google-map-block")},{value:"eu",label:(0,o.__)("Basque","advanced-google-map-block")},{value:"be",label:(0,o.__)("Belarusian","advanced-google-map-block")},{value:"bn",label:(0,o.__)("Bengali","advanced-google-map-block")},{value:"bs",label:(0,o.__)("Bosnian","advanced-google-map-block")},{value:"bg",label:(0,o.__)("Bulgarian","advanced-google-map-block")},{value:"my",label:(0,o.__)("Burmese","advanced-google-map-block")},{value:"ca",label:(0,o.__)("Catalan","advanced-google-map-block")},{value:"zh",label:(0,o.__)("Chinese","advanced-google-map-block")},{value:"hr",label:(0,o.__)("Croatian","advanced-google-map-block")},{value:"cs",label:(0,o.__)("Czech","advanced-google-map-block")},{value:"da",label:(0,o.__)("Danish","advanced-google-map-block")},{value:"nl",label:(0,o.__)("Dutch","advanced-google-map-block")},{value:"en",label:(0,o.__)("English","advanced-google-map-block")},{value:"et",label:(0,o.__)("Estonian","advanced-google-map-block")},{value:"fa",label:(0,o.__)("Farsi","advanced-google-map-block")},{value:"fi",label:(0,o.__)("Finnish","advanced-google-map-block")},{value:"fr",label:(0,o.__)("French","advanced-google-map-block")},{value:"gl",label:(0,o.__)("Galician","advanced-google-map-block")},{value:"ka",label:(0,o.__)("Georgian","advanced-google-map-block")},{value:"de",label:(0,o.__)("German","advanced-google-map-block")},{value:"el",label:(0,o.__)("Greek","advanced-google-map-block")},{value:"gu",label:(0,o.__)("Gujarati","advanced-google-map-block")},{value:"iw",label:(0,o.__)("Hebrew","advanced-google-map-block")},{value:"hi",label:(0,o.__)("Hindi","advanced-google-map-block")},{value:"hu",label:(0,o.__)("Hungarian","advanced-google-map-block")},{value:"is",label:(0,o.__)("Icelandic","advanced-google-map-block")},{value:"id",label:(0,o.__)("Indonesian","advanced-google-map-block")},{value:"it",label:(0,o.__)("Italian","advanced-google-map-block")},{value:"ja",label:(0,o.__)("Japanese","advanced-google-map-block")},{value:"kn",label:(0,o.__)("Kannada","advanced-google-map-block")},{value:"kk",label:(0,o.__)("Kazakh","advanced-google-map-block")},{value:"km",label:(0,o.__)("Khmer","advanced-google-map-block")},{value:"ko",label:(0,o.__)("Korean","advanced-google-map-block")},{value:"ky",label:(0,o.__)("Kyrgyz","advanced-google-map-block")},{value:"lo",label:(0,o.__)("Lao","advanced-google-map-block")},{value:"lv",label:(0,o.__)("Latvian","advanced-google-map-block")},{value:"lt",label:(0,o.__)("Lithuanian","advanced-google-map-block")},{value:"mk",label:(0,o.__)("Macedonian","advanced-google-map-block")},{value:"ms",label:(0,o.__)("Malay","advanced-google-map-block")},{value:"ml",label:(0,o.__)("Malayalam","advanced-google-map-block")},{value:"mr",label:(0,o.__)("Marathi","advanced-google-map-block")},{value:"mn",label:(0,o.__)("Mongolian","advanced-google-map-block")},{value:"ne",label:(0,o.__)("Nepali","advanced-google-map-block")},{value:"no",label:(0,o.__)("Norwegian","advanced-google-map-block")},{value:"pl",label:(0,o.__)("Polish","advanced-google-map-block")},{value:"pt",label:(0,o.__)("Portuguese","advanced-google-map-block")},{value:"pa",label:(0,o.__)("Punjabi","advanced-google-map-block")},{value:"ro",label:(0,o.__)("Romanian","advanced-google-map-block")},{value:"ru",label:(0,o.__)("Russian","advanced-google-map-block")},{value:"sr",label:(0,o.__)("Serbian","advanced-google-map-block")},{value:"si",label:(0,o.__)("Sinhalese","advanced-google-map-block")},{value:"sk",label:(0,o.__)("Slovak","advanced-google-map-block")},{value:"sl",label:(0,o.__)("Slovenian","advanced-google-map-block")},{value:"es",label:(0,o.__)("Spanish","advanced-google-map-block")},{value:"sw",label:(0,o.__)("Swahili","advanced-google-map-block")},{value:"sv",label:(0,o.__)("Swedish","advanced-google-map-block")},{value:"ta",label:(0,o.__)("Tamil","advanced-google-map-block")},{value:"te",label:(0,o.__)("Telugu","advanced-google-map-block")},{value:"th",label:(0,o.__)("Thai","advanced-google-map-block")},{value:"tr",label:(0,o.__)("Turkish","advanced-google-map-block")},{value:"uk",label:(0,o.__)("Ukrainian","advanced-google-map-block")},{value:"ur",label:(0,o.__)("Urdu","advanced-google-map-block")},{value:"uz",label:(0,o.__)("Uzbek","advanced-google-map-block")},{value:"vi",label:(0,o.__)("Vietnamese","advanced-google-map-block")},{value:"zu",label:(0,o.__)("Zulu","advanced-google-map-block")}],onChange:e=>{d({language:e})}}),(0,l.createElement)(c.RangeControl,{label:(0,o.__)("Height","advanced-google-map-block"),help:(0,o.__)("Specifies the height of the map in pixels.","advanced-google-map-block"),value:u,onChange:e=>d({height:e}),min:200,max:1800})),(0,l.createElement)(c.PanelBody,{title:(0,o.__)("Map Settings Additional"),initialOpen:!1},(0,l.createElement)("p",null,(0,o.__)(" This parameter sets the center of the map to a specific location. The format for this parameter is latitude and longitude, separated by a comma. For example: center=37.7749,-122.4194","advanced-google-map-block")),(0,l.createElement)(c.TextControl,{label:(0,o.__)("Latitude","advanced-google-map-block"),placeholder:(0,o.__)("37.7749","advanced-google-map-block"),value:_,onChange:e=>d({latitude:e})}),(0,l.createElement)(c.TextControl,{label:(0,o.__)("Longitude","advanced-google-map-block"),placeholder:(0,o.__)("-122.4194","advanced-google-map-block"),value:r,onChange:e=>d({longitude:e})}))),(0,l.createElement)("div",(0,n.useBlockProps)({className:"agm-google-map agm-google-map-"+i}),(0,l.createElement)("iframe",{className:"agm-google-map__iframe",title:(0,o.__)("Advanced Google Map Block","advanced-google-map-block"),src:k,width:"100%",height:u,loading:"lazy"})))},save:function(e){let{attributes:a}=e;const{id:c,language:g,location:d,zoom:t,mapType:i,height:p,latitude:b,longitude:v}=a,m=g||"en",_=b&&v?`¢er=${b},${v}`:"",r=`https://www.google.com/maps/embed/v1/place?key=AIzaSyAsd_d46higiozY-zNqtr7zdA81Soswje4&q=${encodeURI(d)}&maptype=${i}&zoom=${t}&language=${m}${_}`;return(0,l.createElement)("div",n.useBlockProps.save(),(0,l.createElement)("iframe",{className:"agm-google-map__iframe",title:(0,o.__)("Advanced Google Map Block","advanced-google-map-block"),src:r,width:"100%",height:p,loading:"lazy"}))}})}},l={};function o(e){var n=l[e];if(void 0!==n)return n.exports;var c=l[e]={exports:{}};return a[e](c,c.exports,o),c.exports}o.m=a,e=[],o.O=(a,l,n,c)=>{if(!l){var g=1/0;for(p=0;p<e.length;p++){for(var[l,n,c]=e[p],d=!0,t=0;t<l.length;t++)(!1&c||g>=c)&&Object.keys(o.O).every((e=>o.O[e](l[t])))?l.splice(t--,1):(d=!1,c<g&&(g=c));if(d){e.splice(p--,1);var i=n();void 0!==i&&(a=i)}}return a}c=c||0;for(var p=e.length;p>0&&e[p-1][2]>c;p--)e[p]=e[p-1];e[p]=[l,n,c]},o.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),(()=>{var e={815:0,299:0};o.O.j=a=>0===e[a];var a=(a,l)=>{var n,c,[g,d,t]=l,i=0;if(g.some((a=>0!==e[a]))){for(n in d)o.o(d,n)&&(o.m[n]=d[n]);if(t)var p=t(o)}for(a&&a(l);i<g.length;i++)c=g[i],o.o(e,c)&&e[c]&&e[c][0](),e[c]=0;return o.O(p)},l=globalThis.webpackChunkadvanced_google_map_block=globalThis.webpackChunkadvanced_google_map_block||[];l.forEach(a.bind(null,0)),l.push=a.bind(null,l.push.bind(l))})();var n=o.O(void 0,[299],(()=>o(410)));n=o.O(n)})();1 !function(){"use strict";var e,a={410:function(){var e=window.wp.blocks,a=JSON.parse('{"apiVersion":2,"name":"advanced-google-map-block/google-map","version":"1.0.0","title":"Google Map","category":"advanced-google-map-block","icon":"location","description":"Advanced google map block for WordPress Users.","supports":{"html":false,"anchor":true},"keywords":["google","map","location","address","place","maps","google map"],"attributes":{"id":{"type":"string"},"location":{"type":"string","default":"Nasa"},"zoom":{"type":"number","default":12},"mapType":{"type":"string","default":"roadmap"},"language":{"type":"string","default":"en"},"width":{"type":"number","default":450},"height":{"type":"number","default":350}},"textdomain":"advanced-google-map-block","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css"}'),l=window.wp.element,o=window.wp.i18n,n=window.wp.blockEditor,c=window.wp.components;const{__:__}=wp.i18n;__("Black","boilerplate"),__("White","boilerplate"),__("Red","boilerplate"),__("Green","boilerplate"),__("Blue","boilerplate"),__("Yellow","boilerplate");const{Fragment:g}=wp.element;(0,e.registerBlockType)(a,{edit:function(e){let{attributes:a,setAttributes:d,clientId:t}=e;const{id:i,language:p,location:b,zoom:v,mapType:m,latitude:_,longitude:r,height:u}=a,s=p||"en",k=`https://www.google.com/maps/embed/v1/place?key=AIzaSyAsd_d46higiozY-zNqtr7zdA81Soswje4&q=${encodeURI(b)}&zoom=${v}&maptype=${m}&language=${s}${_&&r?"¢er=37.7749,-122.4194":""}`;return d({id:t.slice(0,8)}),(0,l.createElement)(g,null,(0,l.createElement)(n.InspectorControls,null,(0,l.createElement)(c.PanelBody,{title:(0,o.__)("Map Settings","advanced-google-map-block"),initialOpen:!1},(0,l.createElement)(c.TextControl,{label:(0,o.__)("Location","advanced-google-map-block"),help:(0,o.__)("Type the specified location name that you want to display on the map.","advanced-google-map-block"),value:b,placeholder:(0,o.__)("Enter the Location Name","advanced-goole-map"),onChange:e=>d({location:e})}),(0,l.createElement)(c.RangeControl,{label:(0,o.__)("Zoom Level","advanced-google-map-block"),help:(0,o.__)("Set the initial zoom level of the map. The higher the value will be the more zoomed in the map","advanced-google-map-block"),value:v,onChange:e=>d({zoom:e}),min:1,max:21}),(0,l.createElement)(c.SelectControl,{label:(0,o.__)("Map View Type","advanced-google-map-block"),help:(0,o.__)("Set the type of map to be displayed, such as road map, satellite imagery, or terrain.","advanced-google-map-block"),value:m,options:[{label:(0,o.__)("Roadmap","advanced-google-map-block"),value:"roadmap"},{label:(0,o.__)("Satellite","advanced-google-map-block"),value:"satellite"}],onChange:e=>{d({mapType:e})}}),(0,l.createElement)(c.SelectControl,{label:(0,o.__)("Select Language for your Location"),help:(0,o.__)("Select the language of the map interface. such as for English select English or French select French","advanced-google-map-block"),value:p,options:[{value:"af",label:(0,o.__)("Afrikaans","advanced-google-map-block")},{value:"sq",label:(0,o.__)("Albanian","advanced-google-map-block")},{value:"am",label:(0,o.__)("Amharic","advanced-google-map-block")},{value:"ar",label:(0,o.__)("Arabic","advanced-google-map-block")},{value:"hy",label:(0,o.__)("Armenian","advanced-google-map-block")},{value:"az",label:(0,o.__)("Azerbaijani","advanced-google-map-block")},{value:"eu",label:(0,o.__)("Basque","advanced-google-map-block")},{value:"be",label:(0,o.__)("Belarusian","advanced-google-map-block")},{value:"bn",label:(0,o.__)("Bengali","advanced-google-map-block")},{value:"bs",label:(0,o.__)("Bosnian","advanced-google-map-block")},{value:"bg",label:(0,o.__)("Bulgarian","advanced-google-map-block")},{value:"my",label:(0,o.__)("Burmese","advanced-google-map-block")},{value:"ca",label:(0,o.__)("Catalan","advanced-google-map-block")},{value:"zh",label:(0,o.__)("Chinese","advanced-google-map-block")},{value:"hr",label:(0,o.__)("Croatian","advanced-google-map-block")},{value:"cs",label:(0,o.__)("Czech","advanced-google-map-block")},{value:"da",label:(0,o.__)("Danish","advanced-google-map-block")},{value:"nl",label:(0,o.__)("Dutch","advanced-google-map-block")},{value:"en",label:(0,o.__)("English","advanced-google-map-block")},{value:"et",label:(0,o.__)("Estonian","advanced-google-map-block")},{value:"fa",label:(0,o.__)("Farsi","advanced-google-map-block")},{value:"fi",label:(0,o.__)("Finnish","advanced-google-map-block")},{value:"fr",label:(0,o.__)("French","advanced-google-map-block")},{value:"gl",label:(0,o.__)("Galician","advanced-google-map-block")},{value:"ka",label:(0,o.__)("Georgian","advanced-google-map-block")},{value:"de",label:(0,o.__)("German","advanced-google-map-block")},{value:"el",label:(0,o.__)("Greek","advanced-google-map-block")},{value:"gu",label:(0,o.__)("Gujarati","advanced-google-map-block")},{value:"iw",label:(0,o.__)("Hebrew","advanced-google-map-block")},{value:"hi",label:(0,o.__)("Hindi","advanced-google-map-block")},{value:"hu",label:(0,o.__)("Hungarian","advanced-google-map-block")},{value:"is",label:(0,o.__)("Icelandic","advanced-google-map-block")},{value:"id",label:(0,o.__)("Indonesian","advanced-google-map-block")},{value:"it",label:(0,o.__)("Italian","advanced-google-map-block")},{value:"ja",label:(0,o.__)("Japanese","advanced-google-map-block")},{value:"kn",label:(0,o.__)("Kannada","advanced-google-map-block")},{value:"kk",label:(0,o.__)("Kazakh","advanced-google-map-block")},{value:"km",label:(0,o.__)("Khmer","advanced-google-map-block")},{value:"ko",label:(0,o.__)("Korean","advanced-google-map-block")},{value:"ky",label:(0,o.__)("Kyrgyz","advanced-google-map-block")},{value:"lo",label:(0,o.__)("Lao","advanced-google-map-block")},{value:"lv",label:(0,o.__)("Latvian","advanced-google-map-block")},{value:"lt",label:(0,o.__)("Lithuanian","advanced-google-map-block")},{value:"mk",label:(0,o.__)("Macedonian","advanced-google-map-block")},{value:"ms",label:(0,o.__)("Malay","advanced-google-map-block")},{value:"ml",label:(0,o.__)("Malayalam","advanced-google-map-block")},{value:"mr",label:(0,o.__)("Marathi","advanced-google-map-block")},{value:"mn",label:(0,o.__)("Mongolian","advanced-google-map-block")},{value:"ne",label:(0,o.__)("Nepali","advanced-google-map-block")},{value:"no",label:(0,o.__)("Norwegian","advanced-google-map-block")},{value:"pl",label:(0,o.__)("Polish","advanced-google-map-block")},{value:"pt",label:(0,o.__)("Portuguese","advanced-google-map-block")},{value:"pa",label:(0,o.__)("Punjabi","advanced-google-map-block")},{value:"ro",label:(0,o.__)("Romanian","advanced-google-map-block")},{value:"ru",label:(0,o.__)("Russian","advanced-google-map-block")},{value:"sr",label:(0,o.__)("Serbian","advanced-google-map-block")},{value:"si",label:(0,o.__)("Sinhalese","advanced-google-map-block")},{value:"sk",label:(0,o.__)("Slovak","advanced-google-map-block")},{value:"sl",label:(0,o.__)("Slovenian","advanced-google-map-block")},{value:"es",label:(0,o.__)("Spanish","advanced-google-map-block")},{value:"sw",label:(0,o.__)("Swahili","advanced-google-map-block")},{value:"sv",label:(0,o.__)("Swedish","advanced-google-map-block")},{value:"ta",label:(0,o.__)("Tamil","advanced-google-map-block")},{value:"te",label:(0,o.__)("Telugu","advanced-google-map-block")},{value:"th",label:(0,o.__)("Thai","advanced-google-map-block")},{value:"tr",label:(0,o.__)("Turkish","advanced-google-map-block")},{value:"uk",label:(0,o.__)("Ukrainian","advanced-google-map-block")},{value:"ur",label:(0,o.__)("Urdu","advanced-google-map-block")},{value:"uz",label:(0,o.__)("Uzbek","advanced-google-map-block")},{value:"vi",label:(0,o.__)("Vietnamese","advanced-google-map-block")},{value:"zu",label:(0,o.__)("Zulu","advanced-google-map-block")}],onChange:e=>{d({language:e})}}),(0,l.createElement)(c.RangeControl,{label:(0,o.__)("Height","advanced-google-map-block"),help:(0,o.__)("Specifies the height of the map in pixels.","advanced-google-map-block"),value:u,onChange:e=>d({height:e}),min:200,max:1800})),(0,l.createElement)(c.PanelBody,{title:(0,o.__)("Map Settings Additional"),initialOpen:!1},(0,l.createElement)("p",null,(0,o.__)(" This parameter sets the center of the map to a specific location. The format for this parameter is latitude and longitude, separated by a comma. For example: center=37.7749,-122.4194","advanced-google-map-block")),(0,l.createElement)(c.TextControl,{label:(0,o.__)("Latitude","advanced-google-map-block"),placeholder:(0,o.__)("37.7749","advanced-google-map-block"),value:_,onChange:e=>d({latitude:e})}),(0,l.createElement)(c.TextControl,{label:(0,o.__)("Longitude","advanced-google-map-block"),placeholder:(0,o.__)("-122.4194","advanced-google-map-block"),value:r,onChange:e=>d({longitude:e})}))),(0,l.createElement)("div",(0,n.useBlockProps)({className:"agm-google-map agm-google-map-"+i}),(0,l.createElement)("iframe",{className:"agm-google-map__iframe",title:(0,o.__)("Advanced google map block","advanced-google-map-block"),src:k,width:"100%",height:u,loading:"lazy"})))},save:function(e){let{attributes:a}=e;const{id:c,language:g,location:d,zoom:t,mapType:i,height:p,latitude:b,longitude:v}=a,m=g||"en",_=b&&v?`¢er=${b},${v}`:"",r=`https://www.google.com/maps/embed/v1/place?key=AIzaSyAsd_d46higiozY-zNqtr7zdA81Soswje4&q=${encodeURI(d)}&maptype=${i}&zoom=${t}&language=${m}${_}`;return(0,l.createElement)("div",n.useBlockProps.save(),(0,l.createElement)("iframe",{className:"agm-google-map__iframe",title:(0,o.__)("Advanced google map block","advanced-google-map-block"),src:r,width:"100%",height:p,loading:"lazy"}))}})}},l={};function o(e){var n=l[e];if(void 0!==n)return n.exports;var c=l[e]={exports:{}};return a[e](c,c.exports,o),c.exports}o.m=a,e=[],o.O=function(a,l,n,c){if(!l){var g=1/0;for(p=0;p<e.length;p++){l=e[p][0],n=e[p][1],c=e[p][2];for(var d=!0,t=0;t<l.length;t++)(!1&c||g>=c)&&Object.keys(o.O).every((function(e){return o.O[e](l[t])}))?l.splice(t--,1):(d=!1,c<g&&(g=c));if(d){e.splice(p--,1);var i=n();void 0!==i&&(a=i)}}return a}c=c||0;for(var p=e.length;p>0&&e[p-1][2]>c;p--)e[p]=e[p-1];e[p]=[l,n,c]},o.o=function(e,a){return Object.prototype.hasOwnProperty.call(e,a)},function(){var e={815:0,299:0};o.O.j=function(a){return 0===e[a]};var a=function(a,l){var n,c,g=l[0],d=l[1],t=l[2],i=0;if(g.some((function(a){return 0!==e[a]}))){for(n in d)o.o(d,n)&&(o.m[n]=d[n]);if(t)var p=t(o)}for(a&&a(l);i<g.length;i++)c=g[i],o.o(e,c)&&e[c]&&e[c][0](),e[c]=0;return o.O(p)},l=self.webpackChunkadvanced_google_map_block=self.webpackChunkadvanced_google_map_block||[];l.forEach(a.bind(null,0)),l.push=a.bind(null,l.push.bind(l))}();var n=o.O(void 0,[299],(function(){return o(410)}));n=o.O(n)}();
Note: See TracChangeset
for help on using the changeset viewer.