shababshihan

ম্যাপ ব্যাবহার করব কিভাবে

May 7th, 2015
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.64 KB | None | 0 0
  1. ম্যাপ ব্যাবহার করব কিভাবেঃ
  2. --------------------
  3. ম্যাপের অনেক অনেক ব্যাবহার এর মাঝে আমার জানা তিনটি ব্যবহার হচ্ছেঃ
  4.  
  5. ১। আই ফ্রেম ।
  6. ২। jQuery ম্যাপ পেলেস ।
  7. ৩। jQuery স্নজি ম্যাপ ।
  8. ৪। বডিতে এই লিং গুলো দিতে হবেঃ
  9. <script src="http://maps.google.com/maps/api/js?sensor=false&libraries=geometry&v=3.7"></script>
  10. <script type="text/javascript" src="maplace-0.1.3.min.js"></script>
  11. <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>
  12. নিম্নে বিস্তরিত আলোচনা করলামঃ
  13. ------------------------------------
  14. ১। আই ফ্রেম কিভাবে ব্যবহার করবঃ
  15. গুগল ম্যাপে লোকেশন সার্চ করে Settings Option এ share or embed map এ গিয়ে যে লোকেশন সার্চ করেছি তার লিংক পাওযা যাবে । embed map লিংক টি নিযে HTML মার্কাপে বসালাম । তারপর প্রয়োজন অনুযায়ী CSS ষ্টাইল করলাম ।
  16.  
  17. যেমনঃ
  18. ------
  19. HTML মার্কপঃ
  20. ------------
  21. <div class="maps_content_area fix">
  22. <div class="map_iframe_content fix">
  23. <h1>Map Iframe</h1>
  24. <div id="map_iframe" class="fix">
  25. <iframe src="https://www.google.com/maps/embed?pb=!1m14!1m8!1m3!1d3652.488811719193!2d90.4292205!3d23.729942299999998!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x3755b847aba730c5%3A0x2533f3058ae0a06d!2sMugda+Bajar+Masjid+Rd%2C+Dhaka+1214!5e0!3m2!1sen!2sbd!4v1430935001427" frameborder="0" style="border:0"></iframe>
  26. <div class="iframe_overlay fix"></div>
  27. <button id="show_map"><span class="show_text">Show Map</span><span class="hide_text">Hide Map</span></button>
  28. </div>
  29. </div>
  30. </div>
  31.  
  32. CSS ষ্টাইলঃ
  33. --------
  34. /* Style For Map Content */
  35. .maps_content_area{
  36. text-align: center;
  37. }
  38. .map_iframe_content{
  39. margin-bottom: 50px;
  40. }
  41. .map_iframe_content h1{}
  42. #map_iframe{
  43. position: relative;
  44. }
  45. #map_iframe iframe{
  46. display: block;
  47. width: 100%;
  48. height: 500px;
  49. }
  50. .iframe_overlay{
  51. position: absolute;
  52. top: 0px;
  53. left: 0px;
  54. width: 100%;
  55. height: 100%;
  56. background: rgba(0, 0, 0, 0.3);
  57. z-index: 80;
  58. }
  59. button#show_map{
  60. position: absolute;
  61. left: 50%;
  62. bottom: 20px;
  63. margin-left: -80px;
  64. width: 160px;
  65. padding: 10px 0px;
  66. background: #333;
  67. border: 0px solid #fff;
  68. border-radius: 5px;
  69. color: #fff;
  70. font-size: 18px;
  71. text-transform: uppercase;
  72. letter-spacing: 3px;
  73. z-index: 90;
  74. cursor: pointer;
  75. }
  76. button#show_map:focus{outline:0;}
  77. button#show_map span{
  78. display: block;
  79. }
  80. button#show_map.map span.show_text{
  81. display: none;
  82. }
  83. button#show_map.map span.hide_text{
  84. display: block;
  85. }
  86. button#show_map span.hide_text{
  87. display: none;
  88. }
  89. #gmap{width:100%;height:600px;}
  90.  
  91. jQuery কমান্ড
  92. ------------
  93.  
  94. // map Overlay js
  95. $(document).ready(function() {
  96. $('button#show_map').click(function() {
  97. $(this).toggleClass('map').prev('div.iframe_overlay').fadeToggle(500);
  98. });
  99. });
  100. ======================================================================================================================
  101. ২। jQuery ম্যাপ পেলেস কিভাবে ব্যবহার করবঃ
  102.  
  103. বডি তে লিং দিযে প্রযোজন অনুযায়ী মার্কপ ও ষ্টাইল করলামঃ
  104.  
  105. যেমনঃ
  106. ------
  107. HTML মার্কপঃ
  108. ------------
  109. <div class="maplace_jquery_content fix">
  110. <h1>Maplace.js jQuery Map</h1>
  111. <div id="gmap"></div>
  112. </div>
  113. CSS ষ্টাইলঃ
  114. --------
  115.  
  116.  
  117.  
  118. jQuery কমান্ড
  119. ------------
  120. // Map Include Js
  121. $(document).ready(function() {
  122. new Maplace({
  123. show_markers: true,
  124. locations: [{
  125. lat: 23.729942,
  126. lon: 90.429220,
  127. zoom: 16,
  128. }]
  129. }).Load();
  130. });
  131. ================================================================================================
  132. HTML মার্কপঃ
  133. ------------
  134.  
  135. <div class="maplace_jquery_content fix">
  136. <h1>Snazzy jQuery Map</h1>
  137. <div class="map_contact_form fix">
  138. <div id="snazzy_map"></div>
  139. <div class="map_contact fix">
  140. <div class="contact_content fix">
  141. <form action="">
  142. <input type="text" placeholder="Your Full Name" class="contact_input" />
  143. <input type="text" placeholder="Your Email Address" class="contact_input" />
  144. <input type="text" placeholder="Your Company Name" class="contact_input" />
  145. <input type="text" placeholder="Your Phone Number" class="contact_input" />
  146. <textarea name="" placeholder="Your Message" id="" cols="30" rows="10" class="contact_message"></textarea>
  147. <input type="submit" value="Submit Your Form" class="contact_submit" />
  148. </form>
  149. </div>
  150. </div>
  151. </div>
  152. </div>
  153. CSS ষ্টাইলঃ
  154. --------
  155.  
  156. #snazzy_map{width:100%;height: 600px;}
  157. .map_contact_form{
  158. position: relative;
  159. }
  160. .map_contact{
  161. position: absolute;
  162. top: 0px;
  163. left: 0px;
  164. width: 40%;
  165. height: 100%;
  166. background: rgba(0, 0, 0, 0.45);
  167. }
  168. .map_contact .contact_content{
  169. width: 84%;
  170. margin-left: 8%;
  171. margin-top: 20%;
  172. }
  173. jQuery কমান্ড
  174. ------------
  175. // When the window has finished loading create our google map below
  176. google.maps.event.addDomListener(window, 'load', init);
  177.  
  178. function init() {
  179. var myLatlng = new google.maps.LatLng(23.729942, 90.429220);
  180. var mapOptions = {
  181. zoom: 16,
  182. scrollwheel: false,
  183. center: myLatlng,
  184. panControl: false,
  185. zoomControl: false,
  186. scaleControl: false,
  187. streetViewControl: false,
  188. overviewMapControl: false,
  189. mapTypeControl: false,
  190. styles: [{"featureType":"landscape","stylers":[{"saturation":-100},{"lightness":65},{"visibility":"on"}]},{"featureType":"poi","stylers":[{"saturation":-100},{"lightness":51},{"visibility":"simplified"}]},{"featureType":"road.highway","stylers":[{"saturation":-100},{"visibility":"simplified"}]},{"featureType":"road.arterial","stylers":[{"saturation":-100},{"lightness":30},{"visibility":"on"}]},{"featureType":"road.local","stylers":[{"saturation":-100},{"lightness":40},{"visibility":"on"}]},{"featureType":"transit","stylers":[{"saturation":-100},{"visibility":"simplified"}]},{"featureType":"administrative.province","stylers":[{"visibility":"off"}]},{"featureType":"water","elementType":"labels","stylers":[{"visibility":"on"},{"lightness":-25},{"saturation":-100}]},{"featureType":"water","elementType":"geometry","stylers":[{"hue":"#ffff00"},{"lightness":-25},{"saturation":-97}]}]
  191. }
  192. var map = new google.maps.Map(document.getElementById("snazzy_map"), mapOptions);
  193. var image = 'http://kingrussel.com/demo3/wp-content/themes/deisa/img/map_marker.png';
  194. // To add the marker to the map, use the 'map' property
  195. var marker = new google.maps.Marker({
  196. position: myLatlng,
  197. map: map,
  198. icon: image,
  199. draggable:false,
  200. });
  201. google.maps.event.addListener(marker, 'click', toggleBounce);
  202. function toggleBounce() {
  203. if (marker.getAnimation() != null) {
  204. marker.setAnimation(null);
  205. } else {
  206. marker.setAnimation(google.maps.Animation.BOUNCE);
  207. }
  208. }
  209. }
Advertisement
Add Comment
Please, Sign In to add comment