Highlight whole countries in Google Maps

I was able to do this using the public World Country Boundaries.kml Fusion Table. You’ll need to add it as a Fusion Table Layer to your map. Firstly initialize a map zoomed out right out, centered so we can see most countries: var map = new google.maps.Map(document.getElementById(‘map-canvas’), { center: new google.maps.LatLng(30,0), zoom: 2, mapTypeId: google.maps.MapTypeId.ROADMAP … Read more

is there a way to pass arguments to google map’s get directions functionality?

You can use the following url parameters. saddr for start address daddr for destination address The url would be http://maps.google.com/maps?saddr=new+york&daddr=baltimore The values you pass in can be pretty much whatever you can type into the web app, ie names of places/lat longs/etc. Also, make sure you use a + character for spaces.

Google Maps API v3: Gray Box, no map

This works for me. You simply have to set zoom parameter: UPDATE (by @user2652379): You need to set BOTH zoom and center options. Just zoom does not work. <!DOCTYPE html> <html> <head> <title></title> <META NAME=”ROBOTS” CONTENT=”NOINDEX, NOFOLLOW”> <script src=”http://maps.google.com/maps/api/js?sensor=false” type=”text/javascript”></script> </script> <script type=”text/javascript”> function load() { var mapDiv = document.getElementById(“map”); var latlng = new google.maps.LatLng(-34.397, … Read more

google maps v3 standard icon/shadow names (equiv. of G_DEFAULT_ICON in v2) [closed]

I did some digging through the Google Maps – My Places creation page and there’s a place to find a bunch of default icons. Not sure if they’ll remain forever or not, but here’s a list of almost a hundred to get you in the right direction with default icons: Preview PNG https://maps.gstatic.com/intl/en_us/mapfiles/ms2/iconm.png Row 1 … Read more

How to offset the center of a Google maps (API v3) in pixels?

Found this question when researching and thought I should provide an answer: function map_recenter(latlng,offsetx,offsety) { var point1 = map.getProjection().fromLatLngToPoint( (latlng instanceof google.maps.LatLng) ? latlng : map.getCenter() ); var point2 = new google.maps.Point( ( (typeof(offsetx) == ‘number’ ? offsetx : 0) / Math.pow(2, map.getZoom()) ) || 0, ( (typeof(offsety) == ‘number’ ? offsety : 0) / … Read more

Find center of multiple locations in Google Maps

First you can create a LatLngBounds object by including all the dynamically generated locations. Use the extend method to include the points. Then you can get the center of the bound using the getCenter method. UPDATE: Code: var bound = new google.maps.LatLngBounds(); for (i = 0; i < locations.length; i++) { bound.extend( new google.maps.LatLng(locations[i][2], locations[i][3]) … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)