• The Facebook Platform

Results 1 to 1 of 1
  1. #1
    Join Date
    Jan 2016
    Posts
    33
    Points
    84.00
    Rep Power
    35

    youtube Google Maps - Class 3 Marker Lgana

    Assalam o aliekum dosto kesay hain aap sab.. ye mera Google Maps ka teessra tutorial hy agar aapny pehla tutorial nahi dekha to please aap pehly usay check karein kyu k us may main sari basics btai hain ab may dubara unko explain nahi karu ga taa k hu srif usi bat pe focus kar sakein jo new hy..










    Dosto google map google walon ki bnai hui ek API hy jo humy humari website k pages may google maps ko use karny deti hai, jesay apny dekha hoga k bht say businesses jesay k food resturaunts, banks ki websites may google map lga k btaya geya hota hy k resturaunt kahn hy to humari website k page may wo google map hum esi API ko use kar k lgaty hain.


    es lecture may hum apni btai hui destination per Marker lganay k bray may seekhein gay.


    To dosto marker lganay k lye hum Initiaze function k bahr ek new variable may sirf apna center point store kar lety hain kyu k humara marker es case may humary center point per he hoga or ziada tar cases may aap yehi karty hain yani k humari btai hui destination center ho jati hy or us per marker bhi aa raha hota hy


    var myCenter=new google.maps.LatLng(31.557885,74.359675);


    phr hum map ka initialize function likhty hain, or us may map ka center waghera set kar k baad, usky ander marker set karny k lye ye code likhty hain


    var marker=new google.maps.Marker({
    position:myCenter,
    });



    es say humara marker to set ho gya mgar wo map per lga nahi... map per lganay k lye ye code likha jata hy


    marker.setMap(map);


    that's it.


    ye lijiye sara code:


    <!DOCTYPE html>
    <html>
    <head>
    <title>google maps</title>
    <script src="http://maps.googleapis.com/maps/api/js"></script>
    <script>
    var myCenter=new google.maps.LatLng(31.557885,74.359675);


    function initialize()
    {
    var mapProp = {
    center:myCenter,
    zoom:15,
    mapTypeId:google.maps.MapTypeId.ROADMAP
    };


    var map=new google.maps.Map(document.getElementById("googleMap "),mapProp);


    var marker=new google.maps.Marker({
    position:myCenter,
    });


    marker.setMap(map);
    }


    google.maps.event.addDomListener(window, 'load', initialize);
    </script>
    </head>


    <body>
    <div id="googleMap" style="height:500px;width:600px;margin:0 auto;"></div>


    </body>
    </html>





    dosto ab humara marker bhi set ho gya hy... or adhay say ziada websites may etna he kam hua wa hota hy es k elava kuch log marker k upar ek indicator k tor per ek dialog box bhi lgaty hain jispy likha hota hy "we are here" ya koi bhi line jo aap likhna chahein... jo humara next topic hy...


 

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •