I'm new to Google Maps.
I'm searching for a way to use Google Maps to do the following:
- Create a map of the United States, showing only boundaries of the states
- No pin points / markers
- The states would have a ‘mouse over’ effect to display content (desktop)
- The states would have an ‘on click’ event to display content (mobile)
EXAMPLE: http://maps.debt.com/ccus-geo-map.html (but without the pin points / markers and this map is not responsive)
Have any of you seen anything like this using Google Maps and if so, where? Is there a tutorial to perform this? The google docs were not helpful as markers were displayed and this is not the desired result.
Thanks,
Mitch
An example of the code I created below using the Google Documents, but this was not providing the desired results either ...
function initialize() {
var locations = [
['California (LOS ANGELES)', 34.0522, -118.2437, 1],
['Florida (MIAMI)', 25.7617, -80.1918, 2],
['Maine (HOULTON)', 46.1262, -67.8402, 3],
['Washington (CLALLAM)', 48.253517, -124.257798, 4]
];
var mapProp = {
center: new google.maps.LatLng(39.8282, -98.5795), /* exact center of the US */
zoom: 4,
mapTypeId: google.maps.MapTypeId.ROADMAP
/*
ROADMAP (normal, default 2D map)
SATELLITE (photographic map)
HYBRID (photographic map + roads and city names)
TERRAIN (map with mountains, rivers, etc.)
*/
};
var map = new google.maps.Map(document.getElementById("googleMap"), mapProp);
var marker, i;
var markers = new Array();
for (i = 0; i < locations.length; i++) {
marker = new google.maps.Marker({
position: new google.maps.LatLng(locations[i][1], locations[i][2]),
map: map
});
markers.push(marker);
google.maps.event.addListener(marker, 'click', (function (marker, i) {
return function () {
infowindow.setContent(locations[i][0]);
infowindow.open(map, marker);
}
})(marker, i));
}
}
google.maps.event.addDomListener(window, 'load', initialize)