How do I get traffic control for my Google Map object? - javascript

I have set my Google Map object to view as a ROADMAP, but there is no traffic options like there is on the regular Google Maps. Below is the control I am trying to get. Is this possible via the map options in the API? I tried looking in the docs but there is nothing there for that (unless I am missing something).

You can create a custom control as shown on this example from the documentation.

Here is an example that shows embedding a traffic control onto the map.
http://pietervogelaar.nl/google-maps-api-v3-traffic-toggle-button/

Related

Best way to implement google maps

I found two way to implement google maps.
The First One
<script src = "http://maps.googleapis.com/maps/api/js"></script>
The Second One
<script type="text/javascript" src="http://www.google.com/jsapi?key=....key"></script>
my questions :-
1- What is difference between them?
2- Can I download (save) a part of google maps (my country map or city) to my localhost?
For your second question
By Broswer Google maps can only be executed using internet. Eventually local copy are actually not allowed and above all does not work. Google Maps can used only as a service and not as a local library.
For Mobile you can access (and also edit) your maps locally eg see this
In HTML5, you no longer need to define the type attribute for JS includes, so this format works:
<script src = "http://maps.googleapis.com/maps/api/js"></script>
Additionally, you are referencing the v3 of the Google Maps API with the above URL - see here in their documentation.
First question: This was answered by #staypuftman.
Second question: You may save a local copy of a part of google maps using Google Static Maps which will return a value as an image file.

Does Google Map offer REST api service?

What I want to do is to load a map with predefined markers on it. I could write code in map initialization to do this. I wonder if google offer REST api that I call it instead of coding to load the map and its predefined markers?
Of course there is! heres a link to their JS api: https://developers.google.com/maps/documentation/javascript/
Read till the bottom, there's a small example.

Google Maps API: how do I make user-added markers permanent?

I am currently trying to create a map application which allows users to add their own pins. I want it to be an 'open' map where anyone with an account can add/edit pins on top of everyone else's.
With my limited knowledge of JavaScript, I have got to the point where anyone can add their pins, but they don't save (i.e. are removed once the application is reloaded). Only those I have put in manually (in the script) actually stick.
So, could anyone help me out?
How can I create some sort of 'database' (like in the custom map editor for google maps) which users can edit without having to actually put it in the code?
look at jStorage http://www.jstorage.info/
<script src="//code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="jstorage.js"></script>
<script>
// Check if "key" exists in the storage
var value = $.jStorage.get("key");
if(!value){
// if not - load the data from the server
value = load_data_from_server()
// and save it
$.jStorage.set("key",value);
}
</script>
Have two arrays saved by jStorage, lat and lng arrays, and then set markers by using a for loop and let it work through the arrays.

Removing Places from OSM

Doe is exists a way to remove all the places from the OSM map? Also like shops, bars, restorations, hotels etc.
I wish to use a maps with a less info. Is it possible to do this from the original OSM server? Maybe like a option in URL or something else? I use Leaflet library for my project, maybe some option in it?
I wished to have it like in GMAPS API:
new google.maps.Map(map_div,{
styles:[{
elementType:'all',
featureType:'poi',
stylers:[{
visibility:'off'
}]
}]});
Over JS or over extra URL, so or so, but without places.
The main OSM service provides only one rendering, and you can't change that rendering. Instead, you could:
Render your own tiles - you could design them in Tilemill and host them using Tilestache.
Use maps provided by a third party, such as these Mapbox maps, or opencyclemap, or...

Reading latitude and longitude from database with Oracle ADF

Using Google Maps api v3, I am trying to reconstruct polylines (and other shapes) on a map when my (.jsf) page loads. The points of the polyline are stored in an Oracle database. I have tried passing both a XML and a JSON file to some javascript code that will generate the points on the map. However, Oracle ADF does not open the file but instead opens a 'loopback script'.
Is there a particular configuration that needs to be set in order to achieve this? Or am I going about this all wrong? Is there an alternative way to reconstruct the shapes on a map from the database using Oracle ADF?
I will be grateful for any guidance or direction.
you are using oracle adf's MAP component or google map,
see this ,hope it will help
https://blogs.oracle.com/middleware/entry/integrating_google_maps_with_adf

Categories