miya0001 / simple-map

Display Google Map Shortcode for WordPress
21 stars 15 forks source link

Use "key" shortcode tag to provide Google Maps API key. #18

Closed damiencarbery closed 8 years ago

damiencarbery commented 8 years ago

I decided to go a different route from marushu's pull request. To keep the plugin "simple" I enabled a "key" tag to the shortcode. This parameter will be the Google Maps API key.

The API key must have Google Static Maps API and Google Maps JavaScript API enabled.

I used wp_localize_script to pass the key to the simple-map.js script for use when a static map is used. I add the key to the image url because it was not accepted by the GMaps.staticMapURL constructor.

miya0001 commented 8 years ago

I have merged another PR. Thanks!