Hacker !!!

I believe Hacking can aspire to be art, and can become art.

Showing posts with label hack google. Show all posts
Showing posts with label hack google. Show all posts

simple example of google maps


About Google Maps

Google Maps is a Google service offering powerful, user-friendly mapping technology and local business information -- including business locations, contact information, and driving directions. With Google Maps, you'll enjoy the following unique features:

    Integrated business search results - Find business locations and contact information all in one location, integrated on the map. For example, if you search for [ pizza in San Jose, CA ], locations of relevant listings and phone numbers appear on the map. You can also view additional information like hours of operation, types of payment accepted, and reviews.
    Draggable maps - Click and drag maps to view adjacent sections instantly (no long waits for new areas to download).
    Satellite imagery - View a satellite image (or a satellite image with superimposed map data) of your desired location that you can zoom and pan.
    Earth view - Click the Earth button to view 3D imagery and terrain from Google Earth on Maps that you can zoom, pan, and tilt.
    Street View - View and navigate within street-level imagery.
    Detailed directions - Enter an address and let Google Maps plot the location and driving directions for you. Plan a trip by adding multiple destinations to your route, and click and drag the route to customize it. Learn more about Google Maps driving directions.
    Keyboard shortcuts - Pan left, right, up and down with the arrow keys. Pan wider with the Page Up, Page Down, Home and End keys. Zoom in and out with the plus (+) and minus (-) keys.
    Double-click to zoom functionality - Double left-click to zoom in, and double right-click to zoom out (Ctrl+ double-click for Mac users).
    Scroll wheel zooming - Use the scroll wheel on your mouse to zoom in and out of the maps.
   
    Just copy the below code and save that file .html and open it in any browser...

<!DOCTYPE html>
<html>
  <head>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    <style type="text/css">
      html { height: 100% }
      body { height: 100%; margin: 0; padding: 0 }
      #map_canvas { height: 100% }
    </style>
    <script type="text/javascript"
      src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBICyE5vXPYapUl-rHcMP_L16QsvDIpzaE&sensor=false">
    </script>
    <script type="text/javascript">
      function initialize() {
        var mapOptions = {
          center: new google.maps.LatLng(-34.397, 150.644),
          zoom: 8,
          mapTypeId: google.maps.MapTypeId.ROADMAP
        };
        var map = new google.maps.Map(document.getElementById("map_canvas"),
            mapOptions);
      }
    </script>
  </head>
  <body onload="initialize()">
    <div id="map_canvas" style="width:100%; height:100%"></div>
  </body>
</html>

create google map using javascript api v3


About Google Maps

Google Maps is a Google service offering powerful, user-friendly mapping technology and local business information -- including business locations, contact information, and driving directions. With Google Maps, you'll enjoy the following unique features:

    Integrated business search results - Find business locations and contact information all in one location, integrated on the map. For example, if you search for [ pizza in San Jose, CA ], locations of relevant listings and phone numbers appear on the map. You can also view additional information like hours of operation, types of payment accepted, and reviews.
    Draggable maps - Click and drag maps to view adjacent sections instantly (no long waits for new areas to download).
    Satellite imagery - View a satellite image (or a satellite image with superimposed map data) of your desired location that you can zoom and pan.
    Earth view - Click the Earth button to view 3D imagery and terrain from Google Earth on Maps that you can zoom, pan, and tilt.
    Street View - View and navigate within street-level imagery.
    Detailed directions - Enter an address and let Google Maps plot the location and driving directions for you. Plan a trip by adding multiple destinations to your route, and click and drag the route to customize it. Learn more about Google Maps driving directions.
    Keyboard shortcuts - Pan left, right, up and down with the arrow keys. Pan wider with the Page Up, Page Down, Home and End keys. Zoom in and out with the plus (+) and minus (-) keys.
    Double-click to zoom functionality - Double left-click to zoom in, and double right-click to zoom out (Ctrl+ double-click for Mac users).
    Scroll wheel zooming - Use the scroll wheel on your mouse to zoom in and out of the maps.
   
    Just copy the below code and save that file .html and open it in any browser...

<!DOCTYPE html>
<html>
  <head>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    <style type="text/css">
      html { height: 100% }
      body { height: 100%; margin: 0; padding: 0 }
      #map_canvas { height: 100% }
    </style>
    <script type="text/javascript"
      src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBICyE5vXPYapUl-rHcMP_L16QsvDIpzaE&sensor=false">
    </script>
    <script type="text/javascript">
      function initialize() {
        var mapOptions = {
          center: new google.maps.LatLng(-34.397, 150.644),
          zoom: 8,
          mapTypeId: google.maps.MapTypeId.ROADMAP
        };
        var map = new google.maps.Map(document.getElementById("map_canvas"),
            mapOptions);
      }
    </script>
  </head>
  <body onload="initialize()">
    <div id="map_canvas" style="width:100%; height:100%"></div>
  </body>
</html>

Adding Google Maps to your Java Application

Now you can get business locations, maps and directions while you're on the go. And it's all free.


Cruising around looking for a nearby coffee shop? Driving to that new restaurant but can't remember which street to turn right on? Now you can get business locations, maps and directions while you're on the go. And it's all free.


Real-time traffic

See where the congestion is, and estimate delays in over 30 major US metropolitan areas.


Detailed directions

Whether you plan to walk or drive, your route is displayed on the map itself, together with step-by-step directions.

Integrated search results
Local business locations and contact information appear all in one place, integrated on your map.


Easily movable maps
Interactive maps let you zoom in or out, and move in all directions so you can orient yourself visually.


Satellite imagery
Get a bird's eye view of your desired location.

Getting It
To request a map, you start with the following URL:
http://maps.google.com/maps/api/staticmap?

After the question mark, append all of the details you wish to be included in the map, separated by ampersand (&) symbols. For example:
http://maps.google.com/maps/api/staticmap?center=Brooklyn+Bridge,New+York,NY&
zoom=14&size=512x512&maptype=roadmap
This requests a road map centering on the Brooklyn Bridge, in New York City, at zoom level 14, 512x512 pixels in size. There's a very rich collection of options for specifying and decorating maps, Google has very helpfully made a highly detailed page explaining them all.
As I hope you've reasonably guessed; the http request dutifully returns an image of the map requested. That's all there is to it!
Using It

Happily, Java provides all the resources you need to use this great Google feature right in the Standard Edition. Simply create a java.net.URLConnection, request the content, and generate the map image. If you've not done this before, fear not, as Java makes it very easy to do, it looks a bit like this:
URLConnection con = new URL("http://maps...").openConnection();
InputStream is = con.getInputStream();
byte bytes[] = new byte[con.getContentLength()];
is.read(bytes);
is.close();
Toolkit tk = getToolkit();
map = tk.createImage(bytes);
tk.prepareImage(map, -1, -1, null);
The variable map now has the image, ready for presentation! Remarkably easy wasn't it? That's all it takes, and you can enjoy the full functionality of Google maps in any Java application.

How To Remove Powered By Google Translate

GOOGLE TRANSLATOR FOR WEBSITE WITH POWERED BY GOOGLE



If you are interested in using Google translator as shown in the picture above, then use the codes below:


<div id="google_translate_element"></div>
  <script>
    function googleTranslateElementInit() {
        new google.translate.TranslateElement(
            {pageLanguage: 'en'},
            'google_translate_element'
        );
    }
    </script>
    <script src="http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>

GOOGLE TRANSLATOR FOR WEBSITE WITHOUT POWERED BY GOOGLE



If you are interested in using Google translator without branded logo as shown in the picture above, then use the codes below:



<div align="right">
<div id="google_translate_element"></div>
<span><script type="text/javascript">
//<![CDATA[
function googleTranslateElementInit() {
  new google.translate.TranslateElement({
    pageLanguage: 'en',
    layout: google.translate.TranslateElement.InlineLayout.SIMPLE
  }, 'google_translate_element');
}
//]]>
</script><script src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
</script></span></div>
GOOGLE TRANSLATOR FOR WEBSITE WITHOUT POWERED BY AND GOOGLE LOGO





If you are interested in using Google translator without branded logo as shown in the picture above, then use the codes below:


<script>
    function googleTranslateElementInit() {
    new google.translate.TranslateElement(
                {pageLanguage: 'en'},
                'google_translate_element'
            );
        /*
        To remove the "powered by google",
        uncomment one of the following code blocks.
        NB: This breaks Google's Attribution Requirements:
        https://developers.google.com/translate/v2/attribution#attribution-and-logos
    */

    // Native (but only works in browsers that support query selector)
    if(typeof(document.querySelector) == 'function') {
        document.querySelector('.goog-logo-link').setAttribute('style', 'display: none');
        document.querySelector('.goog-te-gadget').setAttribute('style', 'font-size: 0');
    }

    // If you have jQuery - works cross-browser - uncomment this
    jQuery('.goog-logo-link').css('display', 'none');
    jQuery('.goog-te-gadget').css('font-size', '0');
    }
    </script>
    <script src="http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>


Some times it will not work in IE so add the below code in .CSS file


 .goog-logo-link {
display:none !important;

 .goog-te-gadget{
    color: transparent !important;