// svg path for target icon
var targetSVG = "M9,0C4.029,0,0,4.029,0,9s4.029,9,9,9s9-4.029,9-9S13.971,0,9,0z M9,15.93 c-3.83,0-6.93-3.1-6.93-6.93S5.17,2.07,9,2.07s6.93,3.1,6.93,6.93S12.83,15.93,9,15.93 M12.5,9c0,1.933-1.567,3.5-3.5,3.5S5.5,10.933,5.5,9S7.067,5.5,9,5.5 S12.5,7.067,12.5,9z";
var map = AmCharts.makeChart("chartdiv", {
type: "map",
"theme": "none",
pathToImages: "http://www.amcharts.com/lib/3/images/",
dataProvider: {
map: "usa2Low",
images: [{
svgPath: targetSVG,
label: "San Diego",
zoomLevel: 14,
scale: 1,
title: "San Diego",
latitude: 32.715738,
longitude: -117.161084,
images: [{
svgPath: targetSVG,
scale: 0.7,
title: "Imperial Beach",
latitude: 32.586299,
longitude: -117.110481
}, {
svgPath: targetSVG,
scale: 0.7,
title: "El Cajon",
latitude: 32.802417,
longitude: -116.963539
}, {
svgPath: targetSVG,
scale: 0.7,
title: "University City",
latitude: 32.861268,
longitude: -117.210045
}, {
svgPath: targetSVG,
scale: 0.7,
title: "Poway",
latitude: 32.969635,
longitude: -117.036324
}]
},
{
svgPath: targetSVG,
label: "New York",
zoomLevel: 14,
scale: 1,
title: "New York",
latitude: 40.7591704,
longitude: -74.0392706,
images: [{
svgPath: targetSVG,
scale: 0.7,
title: "Hempstead",
latitude: 40.7029647,
longitude: -73.638341
}, {
svgPath: targetSVG,
scale: 0.7,
title: "Queens",
latitude: 40.6511939,
longitude: -74.0112748
}, {
svgPath: targetSVG,
scale: 0.7,
title: "Bronx",
latitude: 40.8517687,
longitude: -73.9109736,
theUrl: "http://www.google.com/"
}]
}]
},
areasSettings: {
autoZoom: false
}
});
map.addListener("clickMapObject", function (event) {
// check if the map is already at target zoomLevel and go to the URL if it is
if ( 'undefined' != typeof currentObject && event.mapObject.id == currentObject.id ) {
window.location.href = event.mapObject.theUrl;
}
currentObject = event.mapObject;
});
function clickObject(id) {
map.clickMapObject(map.getObjectById(id));
}
Open in new window
This would be your Javascript for the map that you want to have.
2. To include a link, you would need to add an ID to each location that you wish to link:
Open in new window
After you are done with the images for locations, add the following
Open in new window