Showing stops on bus route using google map on wen application - javascript

I have developed a web application for showing bus route between two different stations. I want to show all the stops on the bus route. I have checked this forum and could not find exactly what I am looking for. I am using Google transit API to show the route between two stations. I have more than 30 stops on the route and I want to show them like the Google direction shows when you search the direction between two places on Google maps.
My Second question is can I draw a bus route with out using Google transit API. Any help will be highly appreciated.
Thanks
Pramod

In order to avoid using the API, you can construct a transit route URL something like this: https://www.google.com/maps/dir/Boston,MA/Bufalo,+NY/data=!4m2!4m1!3e3
This is the simplest URL that will give you a map with the Transit mode between Boston and Buffalo. This URL can be used inside an iframe.
Whether you see the bus stops or not depends on the zoom level.
You can explore the nuances of Google Maps URLs in various posts on the web, or by experimenting with a map. The embed codes that Google uses can be found in the address bar, or by using the embed map selection from the Google Maps menu.

Related

Google Maps, how to show distance and travel time in the map

I have used the directions service to render a route on Google Maps. I managed to show the distance and travel time on a marker via the response object which contains the data. But how do I show the information on hover on the blue polylines?
For example:
I have been unable to find this feature in the documentation, but my customer is saying he had this feature in his old website (which is offline, not available anymore).
Is this feature still available in Google Maps? And if so, where are the docs located for this particular feature? Is there another another solution?

Open a Google Maps link with multiple markers

We'd like to open a list of locations in a Google Map link. I've explored many possibilities, but I can't find how to do this.
The map I built using the JavaScript API doesn't show a link to Google Maps with markers on it. I hoped for a "View Larger Map" link like in the Embed API, but none of the variables seemed to add that. I tried the Embed API, but it doesn't take multiple markers.
We need to generate the list dynamically, so MyMaps doesn't work.
The Static Maps API isn't really a Google Map, in that you can't do anything with it.
I tried sending a KML file like this:
http://maps.google.com/maps?q=http://example.com/j.kml
but it looks like Google has discontinued that.
The most promising thing has been the Directions API, but we don't want directions, just a bunch of markers. The URL structure that is showing multiple points is:
https://www.google.com/maps/dir/Mi+Mero+Mole,+5026+Southeast+Division+Street,+Portland,+OR+97206/3+Doors+Down+Cafe,+Southeast+37th+Avenue,+Portland,+OR/Bunk+Downtown,+211+Southwest+6th+Avenue,+Portland,+OR+97204/#45.5135928,-122.661738,14z/
But I tried removing /dir/ to get rid of the directions and Google didn't like that. Has anyone had any luck with this?
My research on the same issue, shows that the directions URL -you have posted- is the most relevant solution at this point.
The only think I could possibly propose as an enhancement, is to leave the starting point blank so the user will be prompted to enter an address as a starting point or automatically enable geolocation by appending the Current+Location wording to the url next to /dir/:
Enable Geolocation
https://www.google.com/maps/dir/Current+Location/Mi+Mero+Mole,+5026+Southeast+Division+Street,+Portland,+OR+97206/3+Doors+Down+Cafe,+Southeast+37th+Avenue,+Portland,+OR/Bunk+Downtown,+211+Southwest+6th+Avenue,+Portland,+OR+97204/#45.5135928,-122.661738,14z/
Leave Starting Point Empty
https://www.google.com/maps/dir//Mi+Mero+Mole,+5026+Southeast+Division+Street,+Portland,+OR+97206/3+Doors+Down+Cafe,+Southeast+37th+Avenue,+Portland,+OR/Bunk+Downtown,+211+Southwest+6th+Avenue,+Portland,+OR+97204/#45.5135928,-122.661738,14z/

map data to make a Web application for displaying location of my customers

I want to create a Web application in which I need a map data of certain area and would like to show the details or location of my customers.
I have seen the Google maps api, but I was searching if I could get something privately for my web application.
Please reply. Thanks.in advance
You can add marker to your map. Markers are designed to be interactive with 'click' events. You can add an event listener to bring up an info window displaying custom information. These marker will only show what you specify. They will not show other marker ( shops,petrol bunks,aims etc)
You can always use the Places API from Google in order to show various places on the Google Maps and also the detailed description about that Places.
Here is the detailed description for the Places API.
Here is a tutorial that may help you in your implementation.

Embed a Google Map (or Google Earth) inside our web page

Here's a gist of what we are trying to do.
We have some co-ordinate information (latitude and longitudes), and a bunch of annotations for these co-ordinates on the server. We want to embed a Google Map (or Google Earth) inside our web page, which shows these co-ordinates as balloons (or some icon) and annotate them with relevant information.
We have seen videos where this is done manually (copying the embed URL into our HTML page, or open a kml/kmz file in Google Earth etc), but we cannot have any manual step in between, as this is used by end users (clients) who cannot do this. We need to do this programmatically.
We want to what is the best way to go about doing this? Also, in the future we want to update the map dynamically with live data.
Thanks in advance.
https://developers.google.com/maps/documentation/javascript/examples/
this is the tutorial for the google map..

Can bus stop icons in Baidu map(created through the API) be made clickable?

I am wondering if bus stop icons embedded in map (maps created using Google API or Baidu API) can be made clickable? I am aware that someone mentioned in another post of the legal issues regarding real-time data between the maps service provider and the public transport agencies. However, what if I just want to make the bus stop icons clickable mainly to show bus stop information such as bus service numbers and name(in the case of Baidu Map), is there any ways to do that? Those information can be obtained from the API so I do not think there is any legal issues compromised.
I am aware that I can simply just search for the bus stops and create markers to mark the points, and open the info window by clicking on the markers. However I feel that it will be better to enable the bus stop icons (already show on the map) clickable instead of displaying more markers.
Any information and help regarding this issue will be greatly appreciated. :)
(I'm using Baidu Map v1.3 btw)

Categories