Plugin Directory

Changeset 1947610


Ignore:
Timestamp:
09/26/2018 07:31:39 PM (8 years ago)
Author:
rvwoens
Message:

google api key setting

Location:
map-pins/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • map-pins/trunk/include/mappins.php

    r1947523 r1947610  
    105105            'pics_base_url'=>MAPPINS_PICS_URL.'/markers/',
    106106            'showbar'=>$this->showbar,
     107            'googlekey'=>$this->get_configuration_option('googlekey'),
    107108            'defcountrycode'=>$this->get_configuration_option('defcountry'),
    108109            'defcountryname'=> xcos_country::getCoutryName($this->get_configuration_option('defcountry'),'nodomain'),   // default extension for country name
     
    313314        <table class="form-table"><?php
    314315            xcos::TrFormInput('adminmenu',__('Admin menu name:','mappins'),xcos::ifset($options['adminmenu'],'Map pins'),['size'=>40]);
    315             xcos::TrFormInput('googlekey',__('Google api key:','mappins'),xcos::ifset($options['googlekey'],'YOUR-GOOGLE-API-KEY'),['size'=>60]);
     316            xcos::TrFormInput('googlekey',__('Google Maps Api key:','mappins'),xcos::ifset($options['googlekey'],'GOOGLE-API-KEY'),['size'=>60]);
     317            echo "<div>Get your <a href='https://developers.google.com/maps/documentation/javascript/get-api-key'>google maps API key</a></div>";
    316318            xcos::TrFormInput('categories',__('Categories:<br>(comma separated list)', 'mappins'),xcos::ifset($options['categories'],'first,second'),array('size'=>40));       
    317319            xcos::TrFormSelect('defcountry',__('Default country', 'mappins'),xcos::ifset($options['defcountry'],'NL'),xcos_country::getCountries());       
     
    328330        ?>
    329331        <div class="wrap">
     332            <h3>Google maps API key</h3>
     333                A google API key is now required. Please protect your key by restricting it to your domain, because web site traffic to google maps can be very expensive!<br>
     334                Please get your <a href='https://developers.google.com/maps/documentation/javascript/get-api-key'>google maps API key</a> before using this plugin.
     335
    330336            <h3>Shortcuts</h3>
    331337            <ul>
  • map-pins/trunk/js/mappins-admin.js

    r811030 r1947610  
    5959          center: new google.maps.LatLng(lat,lng),
    6060          zoom: zoom,
    61           mapTypeId: google.maps.MapTypeId.ROADMAP
     61          mapTypeId: google.maps.MapTypeId.ROADMAP,
     62          gestureHandling: 'greedy',
    6263        };
    6364        thisC.mymap = new google.maps.Map(document.getElementById("mappins-editloc"), mapOptions); 
     
    149150            var script=document.createElement('script');
    150151            script.type  = "text/javascript";
    151             script.src='http://maps.google.com/maps/api/js?sensor=false'+'&libraries=places&callback=mappins_admin';    // use this callback!
     152            script.src='http://maps.google.com/maps/api/js?key='+mappins_options.googlekey+'&libraries=places&callback=mappins_admin';  // use this callback!
    152153            document.body.appendChild(script);
    153154        }
  • map-pins/trunk/js/mappins.js

    r1947502 r1947610  
    2525              center: new google.maps.LatLng(-34.397, 150.644),
    2626              zoom: 9,
    27               mapTypeId: google.maps.MapTypeId.ROADMAP
     27              mapTypeId: google.maps.MapTypeId.ROADMAP,
     28              gestureHandling: 'greedy',
     29
    2830            };
    2931            map = new google.maps.Map(document.getElementById("mappins-map"),
     
    7476            var script=document.createElement('script');
    7577            script.type  = "text/javascript";
    76             script.src='http://maps.google.com/maps/api/js?key=APIKEY_HERE&libraries=places&callback=mappins_init';
     78            script.src='http://maps.google.com/maps/api/js?key='+mappins_options.googlekey+'&libraries=places&callback=mappins_init';
    7779            document.body.appendChild(script);
    7880        }
  • map-pins/trunk/map-pins.php

    r1947598 r1947610  
    44 * Plugin URI: http://mappins.innovader.nl
    55 * Description: Show pins on a map from an admin defined table
    6  * Version: 1.03
     6 * Version: 1.10
    77 * Author: Innovader BV
    88 * Author URI: http://innovader.nl
  • map-pins/trunk/readme.txt

    r1947526 r1947610  
    9292= 1.02 =
    9393* fixed short php tags
    94 * apikey for google map
    9594* tested with latest wordpress version
     95= 1.10 =
     96* Added required Google Maps API key
    9697
    9798== Upgrade Notice ==
     
    103104= 1.01 =
    104105* bugfixes
    105 = 1.02 =
    106 * google api key added
    107 * fixed some issues
     106= 1.10 =
     107* Google Maps Api Key is now required.
    108108
    109109
Note: See TracChangeset for help on using the changeset viewer.