Class DirectionFinder

দিকনির্দেশনা সন্ধানকারী

অবস্থানগুলির মধ্যে দিকনির্দেশ পুনরুদ্ধারের অনুমতি দেয়।
নিচের উদাহরণটি দেখায় কিভাবে আপনি এই ক্লাসটি ব্যবহার করে টাইমস স্কয়ার থেকে সেন্ট্রাল পার্কের দিকনির্দেশনা পেতে পারেন, প্রথমে লিঙ্কন সেন্টারে থামুন, একটি মানচিত্রে অবস্থান এবং পথ প্লট করুন এবং একটি ইমেলে মানচিত্রটি পাঠান।

// Get the directions.
const directions = Maps.newDirectionFinder()
                       .setOrigin('Times Square, New York, NY')
                       .addWaypoint('Lincoln Center, New York, NY')
                       .setDestination('Central Park, New York, NY')
                       .setMode(Maps.DirectionFinder.Mode.DRIVING)
                       .getDirections();
const route = directions.routes[0];

// Set up marker styles.

let markerLetterCode = 'A'.charCodeAt();

// Add markers to the map.
const map = Maps.newStaticMap();
for (let i = 0; i < route.legs.length; i++) {
  const leg = route.legs[i];
  if (i === 0) {
    // Add a marker for the start location of the first leg only.
    map.setMarkerStyle(
        Maps.StaticMap.MarkerSize.MID,
        Maps.StaticMap.Color.GREEN,
        String.fromCharCode(markerLetterCode),
    );
    map.addMarker(leg.start_location.lat, leg.start_location.lng);
    markerLetterCode++;
  }
  map.setMarkerStyle(
      Maps.StaticMap.MarkerSize.MID,
      Maps.StaticMap.Color.GREEN,
      String.fromCharCode(markerLetterCode),
  );
  map.addMarker(leg.end_location.lat, leg.end_location.lng);
  markerLetterCode++;
}

// Add a path for the entire route.
map.addPath(route.overview_polyline.points);

// Send the map in an email.
const toAddress = Session.getActiveUser().getEmail();
MailApp.sendEmail(
    toAddress,
    'Directions',
    `Please open: ${map.getMapUrl()}&key=YOUR_API_KEY`,
    {
      htmlBody: 'See below.<br/><img src="cid:mapImage">',
      inlineImages: {
        mapImage: Utilities.newBlob(map.getMapImage(), 'image/png'),
      },
    },
);

আরো দেখুন

পদ্ধতি

পদ্ধতি রিটার্ন টাইপ সংক্ষিপ্ত বিবরণ
add Waypoint(latitude, longitude) Direction Finder একটি বিন্দু (lat/lng) ব্যবহার করে একটি ওয়েপয়েন্ট যোগ করে যার মধ্য দিয়ে রুটটি যেতে হবে।
add Waypoint(address) Direction Finder একটি ঠিকানা ব্যবহার করে, রুটটি যে পথ দিয়ে যেতে হবে তার একটি ওয়েপয়েন্ট যোগ করে।
clear Waypoints() Direction Finder বর্তমান ওয়েপয়েন্টের সেট সাফ করে।
get Directions() Object উৎপত্তিস্থল, গন্তব্যস্থল এবং সেট করা অন্যান্য বিকল্প ব্যবহার করে দিকনির্দেশনা পায়।
set Alternatives(useAlternatives) Direction Finder সর্বোচ্চ র‍্যাঙ্কযুক্ত রুটের পরিবর্তে বিকল্প রুটগুলি ফেরত দেওয়া উচিত কিনা তা সেট করে (ডিফল্ট হিসেবে false থাকে)।
set Arrive(time) Direction Finder আগমনের কাঙ্ক্ষিত সময় নির্ধারণ করে (যখন প্রযোজ্য)।
set Avoid(avoid) Direction Finder নির্দিষ্ট ধরণের বিধিনিষেধ এড়াতে হবে কিনা তা নির্ধারণ করে।
set Depart(time) Direction Finder প্রস্থানের কাঙ্ক্ষিত সময় নির্ধারণ করে (যখন প্রযোজ্য)।
set Destination(latitude, longitude) Direction Finder একটি বিন্দু (lat/lng) ব্যবহার করে দিকনির্দেশনা গণনা করার জন্য শেষের অবস্থান নির্ধারণ করে।
set Destination(address) Direction Finder একটি ঠিকানা ব্যবহার করে, দিকনির্দেশ গণনা করার জন্য শেষ অবস্থানটি সেট করে।
set Language(language) Direction Finder দিকনির্দেশের জন্য ব্যবহৃত ভাষা সেট করে।
set Mode(mode) Direction Finder ভ্রমণের মোড সেট করে (ডিফল্টভাবে ড্রাইভিং করা হয়)।
set Optimize Waypoints(optimizeOrder) Direction Finder ওয়েপয়েন্টগুলিকে আরও দক্ষ ক্রমে পুনর্বিন্যাস করে প্রদত্ত রুটটি অপ্টিমাইজ করা হবে কিনা তা সেট করে (ডিফল্ট false )।
set Origin(latitude, longitude) Direction Finder একটি বিন্দু (lat/lng) ব্যবহার করে দিকনির্দেশনা গণনা করার জন্য শুরুর অবস্থান নির্ধারণ করে।
set Origin(address) Direction Finder একটি ঠিকানা ব্যবহার করে দিকনির্দেশ গণনা করার জন্য শুরুর অবস্থান নির্ধারণ করে।
set Region(region) Direction Finder অবস্থানের নাম ব্যাখ্যা করার সময় ব্যবহার করার জন্য একটি অঞ্চল সেট করে।

বিস্তারিত ডকুমেন্টেশন

add Waypoint(latitude, longitude)

একটি বিন্দু (lat/lng) ব্যবহার করে একটি ওয়েপয়েন্ট যোগ করে যার মধ্য দিয়ে রুটটি যেতে হবে।

// Creates a DirectionFinder with a wapoint at Lincoln Center.
const directionFinder = Maps.newDirectionFinder().addWaypoint(
    40.772628,
    -73.984243,
);

পরামিতি

নাম আদর্শ বিবরণ
latitude Number পথবিন্দুর অক্ষাংশ।
longitude Number পথবিন্দুর দ্রাঘিমাংশ।

প্রত্যাবর্তন

Direction Finder — কল চেইনিং সহজতর করার জন্য দিকনির্দেশনা অনুসন্ধানকারী বস্তু।


add Waypoint(address)

একটি ঠিকানা ব্যবহার করে, রুটটি যে পথ দিয়ে যেতে হবে তার একটি ওয়েপয়েন্ট যোগ করে।

// Creates a DirectionFinder with a wapoint at Lincoln Center.
const directionFinder = Maps.newDirectionFinder().addWaypoint(
    'Lincoln Center, New York, NY',
);

পরামিতি

নাম আদর্শ বিবরণ
address String একটি ঠিকানা।

প্রত্যাবর্তন

Direction Finder — কল চেইনিং সহজতর করার জন্য দিকনির্দেশনা অনুসন্ধানকারী বস্তু।


clear Waypoints()

বর্তমান ওয়েপয়েন্টের সেট সাফ করে।

const directionFinder = Maps.newDirectionFinder();
// ...
// Do something interesting here ...
// ...
// Remove all waypoints added with addWaypoint().
directionFinder.clearWaypoints();

প্রত্যাবর্তন

Direction Finder — কল চেইনিং সহজতর করার জন্য দিকনির্দেশনা অনুসন্ধানকারী বস্তু।


get Directions()

উৎপত্তিস্থল, গন্তব্যস্থল এবং সেট করা অন্যান্য বিকল্প ব্যবহার করে দিকনির্দেশনা পায়।

// Logs how long it takes to walk from Times Square to Central Park.
const directions = Maps.newDirectionFinder()
                       .setOrigin('Times Square, New York, NY')
                       .setDestination('Central Park, New York, NY')
                       .setMode(Maps.DirectionFinder.Mode.WALKING)
                       .getDirections();
Logger.log(directions.routes[0].legs[0].duration.text);

প্রত্যাবর্তন

Object — একটি JSON অবজেক্ট যাতে দিকনির্দেশের জন্য রুটের সেট থাকে, যেমনটি এখানে বর্ণনা করা হয়েছে।

আরো দেখুন


set Alternatives(useAlternatives)

সর্বোচ্চ র‍্যাঙ্ক করা রুটের পরিবর্তে বিকল্প রুটগুলি ফেরত দেওয়া উচিত কিনা তা সেট করে (ডিফল্টভাবে false )। যদি true , তাহলে ফলাফল প্রাপ্ত বস্তুর routes অ্যারেতে একাধিক এন্ট্রি থাকতে পারে।

// Creates a DirectionFinder with alternative routes enabled.
const directionFinder = Maps.newDirectionFinder().setAlternatives(true);

পরামিতি

নাম আদর্শ বিবরণ
use Alternatives Boolean বিকল্প রুট ফেরত দেওয়ার ক্ষেত্রে true , অন্যথায় false

প্রত্যাবর্তন

Direction Finder — কল চেইনিং সহজতর করার জন্য দিকনির্দেশনা অনুসন্ধানকারী বস্তু।


set Arrive(time)

আগমনের কাঙ্ক্ষিত সময় নির্ধারণ করে (যখন প্রযোজ্য)।

// Creates a DirectionFinder with an arrival time of 2 hours from now.
const now = new Date();
const arrive = new Date(now.getTime() + 2 * 60 * 60 * 1000);
const directionFinder = Maps.newDirectionFinder().setArrive(arrive);

পরামিতি

নাম আদর্শ বিবরণ
time Date আগমনের সময়।

প্রত্যাবর্তন

Direction Finder — কল চেইনিং সহজতর করার জন্য দিকনির্দেশনা অনুসন্ধানকারী বস্তু।

আরো দেখুন


set Avoid(avoid)

নির্দিষ্ট ধরণের বিধিনিষেধ এড়াতে হবে কিনা তা নির্ধারণ করে।

// Creates a DirectionFinder that avoid highways.
const directionFinder = Maps.newDirectionFinder().setAvoid(
    Maps.DirectionFinder.Avoid.HIGHWAYS,
);

পরামিতি

নাম আদর্শ বিবরণ
avoid String Avoid থেকে একটি ধ্রুবক মান।

প্রত্যাবর্তন

Direction Finder — কল চেইনিং সহজতর করার জন্য দিকনির্দেশনা অনুসন্ধানকারী বস্তু।

আরো দেখুন


set Depart(time)

প্রস্থানের কাঙ্ক্ষিত সময় নির্ধারণ করে (যখন প্রযোজ্য)।

// Creates a DirectionFinder with a departure time of 1 hour from now.
const now = new Date();
const depart = new Date(now.getTime() + 1 * 60 * 60 * 1000);
const directionFinder = Maps.newDirectionFinder().setDepart(depart);

পরামিতি

নাম আদর্শ বিবরণ
time Date প্রস্থানের সময়।

প্রত্যাবর্তন

Direction Finder — কল চেইনিং সহজতর করার জন্য দিকনির্দেশনা অনুসন্ধানকারী বস্তু।

আরো দেখুন


set Destination(latitude, longitude)

একটি বিন্দু (lat/lng) ব্যবহার করে দিকনির্দেশনা গণনা করার জন্য শেষের অবস্থান নির্ধারণ করে।

// Creates a DirectionFinder with the destination set to Central Park.
const directionFinder = Maps.newDirectionFinder().setDestination(
    40.777052,
    -73.975464,
);

পরামিতি

নাম আদর্শ বিবরণ
latitude Number শেষ অবস্থানের অক্ষাংশ।
longitude Number শেষ অবস্থানের দ্রাঘিমাংশ।

প্রত্যাবর্তন

Direction Finder — কল চেইনিং সহজতর করার জন্য দিকনির্দেশনা অনুসন্ধানকারী বস্তু।


set Destination(address)

একটি ঠিকানা ব্যবহার করে, দিকনির্দেশ গণনা করার জন্য শেষ অবস্থানটি সেট করে।

// Creates a DirectionFinder with the destination set to Central Park.
const directionFinder = Maps.newDirectionFinder().setDestination(
    'Central Park, New York, NY',
);

পরামিতি

নাম আদর্শ বিবরণ
address String শেষ ঠিকানা।

প্রত্যাবর্তন

Direction Finder — কল চেইনিং সহজতর করার জন্য দিকনির্দেশনা অনুসন্ধানকারী বস্তু।


set Language(language)

দিকনির্দেশের জন্য ব্যবহৃত ভাষা সেট করে।

// Creates a DirectionFinder with the language set to French.
const directionFinder = Maps.newDirectionFinder().setLanguage('fr');

পরামিতি

নাম আদর্শ বিবরণ
language String একটি BCP-47 ভাষা শনাক্তকারী।

প্রত্যাবর্তন

Direction Finder — কল চেইনিং সহজতর করার জন্য দিকনির্দেশনা অনুসন্ধানকারী বস্তু।

আরো দেখুন


set Mode(mode)

ভ্রমণের মোড সেট করে (ডিফল্টভাবে ড্রাইভিং করা হয়)।

// Creates a DirectionFinder with the mode set to walking.
const directionFinder = Maps.newDirectionFinder().setMode(
    Maps.DirectionFinder.Mode.WALKING,
);

পরামিতি

নাম আদর্শ বিবরণ
mode String Mode থেকে একটি ধ্রুবক মান।

প্রত্যাবর্তন

Direction Finder — কল চেইনিং সহজতর করার জন্য দিকনির্দেশনা অনুসন্ধানকারী বস্তু।

আরো দেখুন


set Optimize Waypoints(optimizeOrder)

ওয়েপয়েন্টগুলিকে আরও দক্ষ ক্রমে পুনর্বিন্যাস করে প্রদত্ত রুটটি অপ্টিমাইজ করা হবে কিনা তা সেট করে (ডিফল্ট false )।

// Creates a DirectionFinder with wapoint optimization enabled.
const directionFinder = Maps.newDirectionFinder().setOptimizeWaypoints(true);

পরামিতি

নাম আদর্শ বিবরণ
optimize Order Boolean অর্ডারটি অপ্টিমাইজ করার জন্য true , অথবা অন্যথায় false

প্রত্যাবর্তন

Direction Finder — কল চেইনিং সহজতর করার জন্য দিকনির্দেশনা অনুসন্ধানকারী বস্তু।

আরো দেখুন


set Origin(latitude, longitude)

একটি বিন্দু (lat/lng) ব্যবহার করে দিকনির্দেশনা গণনা করার জন্য শুরুর অবস্থান নির্ধারণ করে।

// Creates a DirectionFinder with the origin set to Times Square.
const directionFinder = Maps.newDirectionFinder().setOrigin(
    40.759011,
    -73.984472,
);

পরামিতি

নাম আদর্শ বিবরণ
latitude Number শুরুর স্থানের অক্ষাংশ।
longitude Number শুরুর স্থানের দ্রাঘিমাংশ।

প্রত্যাবর্তন

Direction Finder — কল চেইনিং সহজতর করার জন্য দিকনির্দেশনা অনুসন্ধানকারী বস্তু।


set Origin(address)

একটি ঠিকানা ব্যবহার করে দিকনির্দেশ গণনা করার জন্য শুরুর অবস্থান নির্ধারণ করে।

// Creates a DirectionFinder with the origin set to Times Square.
const directionFinder = Maps.newDirectionFinder().setOrigin(
    'Times Square, New York, NY',
);

পরামিতি

নাম আদর্শ বিবরণ
address String শুরুর ঠিকানা।

প্রত্যাবর্তন

Direction Finder — কল চেইনিং সহজতর করার জন্য দিকনির্দেশনা অনুসন্ধানকারী উদাহরণ।


set Region(region)

অবস্থানের নাম ব্যাখ্যা করার সময় ব্যবহার করার জন্য একটি অঞ্চল সেট করে। সমর্থিত অঞ্চল কোডগুলি Google Maps দ্বারা সমর্থিত ccTLD-এর সাথে সঙ্গতিপূর্ণ। উদাহরণস্বরূপ, অঞ্চল কোড "uk" "maps.google.co.uk"-এর সাথে সঙ্গতিপূর্ণ।

// Creates a DirectionFinder with the region set to France.
const directionFinder = Maps.newDirectionFinder().setRegion('fr');

পরামিতি

নাম আদর্শ বিবরণ
region String ব্যবহার করার জন্য অঞ্চল কোড।

প্রত্যাবর্তন

Direction Finder — কল চেইনিং সহজতর করার জন্য দিকনির্দেশনা অনুসন্ধানকারী বস্তু।

আরো দেখুন