Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 774031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T19:03:48+00:00 2026-05-14T19:03:48+00:00

I need to be able to, using either V2 OR V3 (preferably 3), create

  • 0

I need to be able to, using either V2 OR V3 (preferably 3), create paths which ignore buildings in a sense.

I was trying to create even a kml file to draw out all of the paths myself, and then find some way to turn them on/off as needed.

For example. The user wants to go from point A to point B. Between these points is a number of buildings. The user physically CAN walk through these buildings(it’s a campus). I want to show them that on the map.

This way you don’t have to do a loop-de-loop around, say, a parking lot, just to get to the other end of it.

If there is ANY way AT ALL to do this, I’d love to know.

An example of what I require can be found here: http://www.uottawa.ca/maps/

It’s all pre-determined paths based on the two inputs from the user into the dropdown menu. I can plainly see this. But I have no clue if a) this can be done in v3, and b) how on earth they did it themselves.

Assistance required, and greatly appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T19:03:49+00:00Added an answer on May 14, 2026 at 7:03 pm

    If your campus is not very big, you may want to consider defining all the polyline routes by hand for each permutation, such that if you have 4 buildings A, B, C and D, you would need to define 6 routes:

    A:B, A:C, A:D, B:C, B:D, C:D 
    

    Then simply build some basic JavaScript logic, that when you chose building A as starting point and building C as destination, you hide all polylines and show the A:C line only. You can also use Google’s polyline methods to get the length in meters of each route, if this is required.

    This is a short table of how many routes you would have to define, according to the number of buildings you have:

    +-------------+--------+
    |  Buildings  | Routes |
    |-------------+--------+
    |         5   |    10  |
    |        10   |    45  |
    |        15   |   105  |
    |        20   |   190  |
    |        25   |   300  |
    +-------------+--------+
    

    As you can see, it really gets out of control as the number of buildings goes up, so I would say that this option is only feasible to a certain point. At least you are lucky since the order of the permutations is not important, assuming that people can walk each route in both directions.


    Interesting Note: I noticed that the Ottawa demo you supplied is not making any AJAX calls when requesting for directions. Therefore there is a good chance that they are doing the same as suggested above.


    UPDATE:

    Here is working demo using the v3 Maps API, which I hope can help you getting started:

    <!DOCTYPE html>
    <html> 
    <head> 
      <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> 
      <title>Google Maps Campus</title> 
      <script src="http://maps.google.com/maps/api/js?sensor=false" 
               type="text/javascript"></script> 
    </head> 
    <body> 
      <div id="map" style="width: 550px; height: 400px"></div> 
    
      <div>Start: 
        <select id="start">
          <option>Building 1</option>
          <option>Building 2</option>
          <option>Building 3</option>
        </select>
      </div>
    
      <div>End: 
        <select id="end">
          <option>Building 1</option>
          <option>Building 2</option>
          <option>Building 3</option>
        </select>
      </div>
    
      <input type="button" onclick="drawDirections();" value="GO" />
    
      <script type="text/javascript"> 
        var mapOptions = { 
          mapTypeId: google.maps.MapTypeId.TERRAIN,
          center: new google.maps.LatLng(47.690, -122.310),
          zoom: 12
        };
    
        var map = new google.maps.Map(document.getElementById("map"), 
                                      mapOptions);
    
        // Predefine all the paths
        var paths = [];                         
    
        paths['1_to_2'] = new google.maps.Polyline({
          path: [
              new google.maps.LatLng(47.656, -122.360),
              new google.maps.LatLng(47.656, -122.343),
              new google.maps.LatLng(47.690, -122.310)
          ], strokeColor: '#FF0000'
        });
    
        paths['1_to_3'] = new google.maps.Polyline({
           path: [
              new google.maps.LatLng(47.656, -122.360),
              new google.maps.LatLng(47.656, -122.343),
              new google.maps.LatLng(47.690, -122.270)
           ], strokeColor: '#FF0000'
        });
    
        paths['2_to_3'] = new google.maps.Polyline({
           path: [
               new google.maps.LatLng(47.690, -122.310),
               new google.maps.LatLng(47.690, -122.270)
           ], strokeColor: '#FF0000'
        });
    
        function drawDirections() {
          var start = 1 + document.getElementById('start').selectedIndex;
          var end = 1 + document.getElementById('end').selectedIndex;
          var i;
    
          if (start === end) {
            alert('Please choose different buildings');
          }
          else {
            // Hide all polylines
            for (i in paths) {
              paths[i].setOptions({ map: null });
            }
    
            // Show the route
            if (typeof paths['' + start + '_to_' + end] !== 'undefined') {
              paths['' + start + '_to_' + end].setOptions({ map: map });
            }
            else if (typeof paths['' + end + '_to_' + start] !== 'undefined') {
              paths['' + end + '_to_' + start].setOptions({ map: map });
            }
          }
        }
      </script> 
    </body> 
    </html>
    

    Screenshot:

    Google Maps Campus

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 375k
  • Answers 375k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You don't give your table name but I think something… May 14, 2026 at 8:13 pm
  • Editorial Team
    Editorial Team added an answer I would use JTextField for the number-window JRadioButton for the… May 14, 2026 at 8:13 pm
  • Editorial Team
    Editorial Team added an answer You are explicitly calling your paint() function when the window… May 14, 2026 at 8:13 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.