Changeset 1144182
- Timestamp:
- 04/24/2015 05:21:00 AM (11 years ago)
- Location:
- custom-baidu-maps/trunk
- Files:
-
- 2 edited
-
baidu-maps.php (modified) (4 diffs)
-
readme.txt (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
custom-baidu-maps/trunk/baidu-maps.php
r797086 r1144182 1 1 <?php 2 2 /* 3 Plugin Name: Custom Baidu Maps3 Plugin Name: Baidu Maps Plugin 4 4 Plugin URI: http://www.digitalcreative.asia/ 5 5 Description: A Wordpress Plugin to easily integrate baidu maps 6 Version: 1. 06 Version: 1.1 7 7 Author: Digital Creative 8 8 Author URI: http://www.digitalcreative.asia/ 9 9 License: 10 10 11 Copyright 201 3Samuel Jesse (samueljesse@digitalcreative.asia)11 Copyright 2015 Samuel Jesse (samueljesse@digitalcreative.asia) 12 12 13 13 This program is free software; you can redistribute it and/or modify … … 101 101 102 102 // Enqueue Plugin's Frontend Styles 103 wp_register_style( 'baidu-maps-style- admin', $this->plugin_url . 'css/map.css' );104 wp_enqueue_style( 'baidu-maps-style- admin' );103 wp_register_style( 'baidu-maps-style-frontend', $this->plugin_url . 'assets/css/frontend.css' ); 104 wp_enqueue_style( 'baidu-maps-style-frontend' ); 105 105 106 106 // Enqueue Plugin's Frontend Script 107 wp_register_script( 'baidu-maps-script-map', $this->plugin_url . ' js/map.js', array( 'jquery' ), false, true );107 wp_register_script( 'baidu-maps-script-map', $this->plugin_url . 'assets/js/map.js', array( 'jquery' ), false, true ); 108 108 wp_enqueue_script( 'baidu-maps-script-map' ); 109 109 } … … 113 113 */ 114 114 public function register_admin_scripts() { 115 115 116 // Enqueue Baidu Maps Script 116 wp_register_script( 'baidu-maps-script-api', 'http://api.map.baidu.com/api?v=2.0&ak=' . $this->settings['api_key'], false, true ); 117 wp_enqueue_script( 'baidu-maps-script-api' ); 118 119 wp_register_style( 'baidu-maps-style-admin', $this->plugin_url . 'css/admin.css' ); 120 wp_enqueue_style( 'baidu-maps-style-admin' ); 121 122 wp_register_script( 'baidu-maps-script-admin', $this->plugin_url . 'js/admin.js', array( 'jquery', 'wp-color-picker' ), false, true ); 123 wp_enqueue_script( 'baidu-maps-script-admin' ); 124 125 wp_localize_script( 'baidu-maps-script-admin', 'pluginUrl', $this->plugin_url ); 126 wp_localize_script( 'baidu-maps-script-admin', 'ajaxurl', admin_url( 'admin-ajax.php' ) ); 127 128 wp_enqueue_script( 'thickbox' ); 129 wp_enqueue_style( 'thickbox' ); 130 131 wp_enqueue_script( 'media-upload' ); 132 133 wp_enqueue_style( 'wp-color-picker' ); 117 if ( get_post_type( ) == 'bmap' ) { 118 wp_register_script( 'baidu-maps-script-api', 'http://api.map.baidu.com/api?v=2.0&ak=' . $this->settings['api_key'], false, true ); 119 wp_enqueue_script( 'baidu-maps-script-api' ); 120 121 wp_register_style( 'baidu-maps-style-admin', $this->plugin_url . 'assets/css/admin.css' ); 122 wp_enqueue_style( 'baidu-maps-style-admin' ); 123 124 wp_register_script( 'baidu-maps-script-admin', $this->plugin_url . 'assets/js/admin.js', array( 'jquery', 'wp-color-picker' ), false, true ); 125 wp_enqueue_script( 'baidu-maps-script-admin' ); 126 127 wp_localize_script( 'baidu-maps-script-admin', 'pluginUrl', $this->plugin_url ); 128 wp_localize_script( 'baidu-maps-script-admin', 'ajaxurl', admin_url( 'admin-ajax.php' ) ); 129 130 wp_enqueue_script( 'thickbox' ); 131 wp_enqueue_style( 'thickbox' ); 132 133 wp_enqueue_script( 'media-upload' ); 134 135 wp_enqueue_style( 'wp-color-picker' ); 136 } 134 137 } 135 138 … … 180 183 public function makeMapWithID( $id ) { 181 184 $baidu_maps_api = new Baidu_Maps_API(); 182 $map_element = $baidu_maps_api->createMapWithID( $id , $zoom, $lat, $lng);185 $map_element = $baidu_maps_api->createMapWithID( $id ); 183 186 184 187 return $map_element; -
custom-baidu-maps/trunk/readme.txt
r1082251 r1144182 3 3 Tags: maps, baidu, baidu maps 4 4 Requires at least: 3.0.1 5 Tested up to: 3.65 Tested up to: 4.2 6 6 Stable tag: 1.1 7 7 License: GPLv2 or later … … 13 13 == Description == 14 14 15 Easily create Custom Baidu Maps to add to any Wordpress post or page. You can create one or multiple maps15 Easily create Custom Baidu Maps to add to any Wordpress ost or page. You can create one or multiple maps 16 16 with our easy to use settings panel, then insert the map using a shortcode. 17 17 18 18 With Custom Baidu Maps you can customize each map with multiple locations with options to add/change location 19 19 coordinates, add a description, choose background and font colors and upload your own custom marker image. 20 21 22 Plugin developed by [Digital Creative](http://www.digitalcreative.asia), Shanghai.23 24 25 26 *Baidu API key required. In order to obtain a Baidu API you must have access to a mobile phone number from China.27 28 == Installation ==29 30 Follow the steps below for the plugin installation :31 32 33 1. Upload `baidu-maps.zip` to the `/wp-content/plugins/` directory or add the plugin via wordpress plugin repository.34 1. Activate the plugin through the 'Plugins' menu in WordPress.35 1. Enter your Baidu Developer API key in the settings page.36 20 37 21 … … 42 26 with a zoom of '12' 43 27 44 `[bmap width="500" height="400" lat="39.900" lng="116.403" zoom="12"]` 28 [bmap width="500" height="400" lat="39.900" lng="116.403" zoom="12"] 45 29 46 30 Options : … … 69 53 70 54 55 56 == Installation == 57 58 Follow the steps below for the plugin installation : 59 60 61 1. Upload `baidu-maps.zip` to the `/wp-content/plugins/` directory or add the plugin via wordpress plugin repository. 62 1. Activate the plugin through the 'Plugins' menu in WordPress. 63 1. Enter your Baidu Developer API key in the settings page. 64 65 71 66 == Frequently Asked Questions == 72 67 … … 74 69 75 70 To use Baidu Maps, you need to have a Baidu Developers API Key. 76 To obtain the API Key please visit : http://lbsyun.baidu.com/apiconsole/key?application=key 71 To obtain the API Key please visit : http://lbsyun.baidu.com/apiconsole/key 72 73 A Detailed guide on how to create the API Key is available in the Settings Page 77 74 78 75 76 == Screenshots == 77 78 79 == Changelog == 80 81 = 1.1 = 82 83 PHP warnings fixed 84 Added instructions to create the Baidu Developers API Key 85 86 87 == Upgrade Notice ==
Note: See TracChangeset
for help on using the changeset viewer.