SEBatt

Google Static Maps API

Apr 10th, 2017
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. ---- MapControl.cs ----
  2.  
  3. using System;
  4. using System.Collections.Generic;
  5. using System.ComponentModel;
  6. using System.Data;
  7. using System.Drawing;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. using System.Windows.Forms;
  12.  
  13. namespace Google_Maps_API
  14. {
  15. public partial class MapControl : Form
  16. {
  17. public MapControl()
  18. {
  19. InitializeComponent();
  20. }
  21.  
  22. private void makemap_Click(object sender, EventArgs e)
  23. {
  24. var MapWindow = new MapDisplay();
  25. MapWindow.Show();
  26. }
  27. }
  28. }
  29.  
  30. ---- MapDisplay.cs ----
  31.  
  32. using System;
  33. using System.Collections.Generic;
  34. using System.ComponentModel;
  35. using System.Data;
  36. using System.Drawing;
  37. using System.Linq;
  38. using System.Text;
  39. using System.Threading.Tasks;
  40. using System.Windows.Forms;
  41.  
  42. namespace Google_Maps_API
  43. {
  44. public partial class MapDisplay : Form
  45. {
  46. public MapDisplay(string loc, string zoom, string type)
  47. {
  48. InitializeComponent();
  49. String url = "https://maps.googleapis.com/maps/api/staticmap?&size=400x400&center=Tokyo&zoom=10&maptype=satellite&key=[YOUR_KEY]";
  50. MapBrowser.Navigate(new Uri(url));
  51. }
  52. }
  53. }
Add Comment
Please, Sign In to add comment