Finding driving directions using Google Maps JavaScript API V3 - javascript

Here is the scenario that i want take two addresses dynamically from user, consider one of them as source and other as destination and find driving directions between source and destination.
i googled and got some stuffs not familiar to me..such as writing script using Google Maps JavaScript API V3, and the direction out put will be in json or xml format...i have tried google.map.directionrenrender and directionservice api's in my code but it is saying no such classes in google.map..as i am new to scripting language i am not understanding how to start ....i am using eclipse ide, where i want to build an android app that takes addresses and gives driving directions between those two points..
i want the program almost similar to this Google map driving direction source code for their example? but here they have used some html code and why that is actually required..?
please help me in writing the code
Thanks in advance

To open up Google Maps with directions, start a new Intent using a URL like this:
http://maps.google.com/maps?saddr=%s&daddr=%s
Replace each %s with a string like "x,y" where x and y specify the latitude and longitude. If you want directions from the current location, leave the saddre parameter blank.
This won't work on phones that don't have Google Maps installed, and in those cases will open the browser.

Related

What technology/strategy should I use to render big GeoJSON files within google maps

I'm currently working on a project to display enriched geographical data within an interactive map. For example, I have housing blocks with additional information added, and I want to display this data within an interactive map. I chose google maps, because I don't have any experience in building a map-based webservice and google seemed to be easy accessible and working.
The problem comes with the amount of information i have. A single town like Berlin has about 450.000 geometrys, which results in a GeoJSON file roughly 170MB big. I know, that this isn't anywhere near to working.
Do you guys can give me a hint on how to structure the project? What kind of technology can I use to dynamically query the needed data? Are there any libraries or working solutions that I should give a try?
How I solved this issue:
I used mapnik to pre-render the tiles and displayed them in google maps using getTileURL. I used this tutorial, which explains the basics on how to use mapnik for google map tiles.

Display address on map on my page

If I have an address string (New Jersey, Hoboken), what is the simplest way to display the address(simple address) on map in my page?(no preference for the source of the map).
If you are less familiar with how to setup a Google Maps embed on your website this site will help you generate the appropriate code:
http://www.trivoo.net/google-maps/
If you are more familiar with HTML/JS you could go the more involved route of using Google Maps JavaScript API found here.
https://developers.google.com/maps/documentation/javascript/
They have great documentation there on how to set it up.
The simplest way would be to use Google My Maps, you can enter an address and Google will generate some code you can embed on your page.

Real time Tracker on Samrtphone using Bing Map

I have read up on GPS Real time tracking and found out several things about it,mostly requiring PHP,but I need use only JavaScript.
As regards to my question, is it possible to do so with just html and JS, using markers or anything else to populate the Bing Map when you move anywhere in the city? Need some help on this, Thanks!
PS: I try to use it on WP8.1, and I am already succeed to add Bing map to it using html5
My solution
and if there is a solution on Win8.1, it's Ok, just how do it?
Yes. In HTML5 you can use the geolocation class: http://www.w3schools.com/HTML/html5_geolocation.asp or since you are using Bing Maps you can use the GeoLocationProvider class: http://msdn.microsoft.com/en-us/library/hh125833.aspx
Make sure you enable share of locations in your app manifest or it will silently fail to get the users location.
This would work in both WP8.1 and Win8.1, and browsers as well.
If you want you can also do all of this in a universal app using .NET.

Charting lib open or commerical

Anyone have advice on how to get a control to do something like this
http://screencast.com/t/VyHdxOdRJQwY
I will be plotting based on city or zip so i need to maintain some geo aspects but in the end the chart control needs to look like this guy.
Ideally no flash... but interested to see if anyone has hit something like this.
open or commercial source, im game
d3 seems to be a pretty good library for data visualization.
Check out the examples here: https://github.com/mbostock/d3/wiki/Gallery
Here's an implementation similar to what you are looking for. http://trends.truliablog.com/vis/metro-movers/
I suggest you check out the Google Maps API. There are two versions of the API:
Static Maps API V2 - from the docs:
The Google Static Maps API lets you embed a Google Maps image on your
web page without requiring JavaScript or any dynamic page loading. The
Google Static Map service creates your map based on URL parameters
sent through a standard HTTP request and returns the map as an image
you can display on your web page.
There are Usage Limits: The free version has a query limit of 1000 unique (different) image requests per viewer per day, if that will work for your situation. There is a licensed option above that with associated licensing fees.
Google Maps JavaScript API v3 - from the docs:
The Google Maps Javascript API lets you embed Google Maps in your own
web pages. Version 3 of this API is especially designed to be faster
and more applicable to mobile devices, as well as traditional desktop
browser applications. The API provides a number of utilities for
manipulating maps (just like on the http://maps.google.com web page)
and adding content to the map through a variety of services, allowing
you to create robust maps applications on your website.
There are similar usage limits for this version, also with a licensed option above the free version.
The API could easily create a map to match the one at your link. These aren't an exact match, but here are some examples from the Google Maps Demo Gallery:
We ended up using http://www.mapdotnet.com/ with background from open maps. Custom middle cache tiles from shape files stored in SQL, on top we have open street layer (or can use bing)

How to show Google Local business marker and InfoWindow in custom Google Map?

I want to show the location of my business on my website using google maps. Instead of creating the marker, infowindow, etc... by hand, I would like to reuse the one found in Google Local business listings.
For instance, this business could use this map. The advantages are numerous : it is already done, it will be updated when you update the listing, it has directions, etc...
Does anybody know how to do that using the JavaScript API (v3) ? I could obviously use the iframe code they provide, but I would love having a bit more control on the result, especially the controls.
You can't. You can either use the embed as is, or build a custom map using the JavaScript API.

Categories