/WUW01/bin/Debug/temp/test.html

https://bitbucket.org/Skriglitz/sixthsense · HTML · 64 lines · 59 code · 5 blank · 0 comment · 0 complexity · 4d015ff36522badedadcaf9c33b4199b MD5 · raw file

  1. <html>
  2. <head>
  3. <title></title>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5. <script src="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=5"></script>
  6. <script>
  7. var map = null;
  8. function SetZoomLevel(zLev)
  9. {
  10. map.SetZoomLevel(zLev);
  11. }
  12. function myClickHandler(e)
  13. {
  14. var x = e.mapX;
  15. var y = e.mapY;
  16. var pixel = new VEPixel(x, y);
  17. var LL = map.PixelToLatLong(pixel);
  18. if(e.leftMouseButton)
  19. var events = "snParameter: CLICKEVENT LEFT, " + LL;
  20. if(e.rightMouseButton)
  21. var events = "snParameter: CLICKEVENT RIGHT, " + LL;
  22. window.navigate(events);
  23. }
  24. function myMouseMoveHandler(e)
  25. {
  26. var x = e.mapX;
  27. var y = e.mapY;
  28. var pixel = new VEPixel(x, y);
  29. var LL = map.PixelToLatLong(pixel);
  30. var events = "snParameter: MOVEEVENT MOUSE, " + LL;
  31. window.navigate(events);
  32. }
  33. function AddPin(pinID, posit, descr, iconAddress)
  34. {
  35. var pin = new VEPushpin(
  36. pinID,
  37. posit,
  38. iconAddress,
  39. descr,
  40. ''
  41. );
  42. pin.ShowDetailOnMouseOver=false;
  43. map.AddPushpin(pin);
  44. }
  45. function GetMap()
  46. {
  47. map = new VEMap('myMap');
  48. map.LoadMap(new VELatLong( 45.850816,9.3956833), 10 ,'h' , false);
  49. map.SetZoomLevel(12);
  50. map.SetMapStyle("r");
  51. map.AttachEvent('onclick', myClickHandler);
  52. map.AttachEvent('onmousemove', myMouseMoveHandler);
  53. }
  54. </script>
  55. </head>
  56. <body onload="GetMap();">
  57. <div id='myMap' style="position:relative; width:1024px; height:768px;"></div>
  58. </body>
  59. </html>