ラファエル/マップマップ上にツールチップを配置しようとしています。現在は、地図の左下にデフォルト設定されていますが、地図上に配置されているプロットの近くに表示されることを期待しています。rafael/mapaelのマップ上にプロットの横にツールチップを配置する方法
私はここにjsbinを作成しました。
http://jsbin.com/pogaqecuwa/edit?html,js,output
私はまた、プロットへのhrefのリンクを追加したいです。もしそれが可能なら、私は各プロットにリンクを含めることができますか、私はイベントハンドラをキャッチする必要がありますか?
function initMap() {
var $map = $('#map'),
state;
$map.mapael({
map: {
name: "usa_states",
},
plots: {
'ny': {
latitude: 40.717079,
longitude: -74.00116,
tooltip: {content: "New York",
offset: {
left:3000,
top:1000
}
}
},
'on': {
latitude: 33.145235,
longitude: -83.811834,
size: 18,
tooltip: {content: "Oconee National Forest"}
},
'sf': {
latitude: 37.792032,
longitude: -122.394613,
size: 12,
tooltip: {content: "San Francisco"}
},
'la': {
latitude: 26.935080,
longitude: -80.851766,
size: 26,
tooltip: {content: "Lake Okeechobee"}
},
'gc': {
latitude: 36.331308,
longitude: -83.336050,
size: 10,
tooltip: {content: "Grainger County"}
},
'cc': {
latitude: 36.269356,
longitude: -76.587477,
size: 22,
tooltip: {content: "Chowan County"}
},
'll': {
latitude: 30.700644,
longitude: -95.145249,
tooltip: {content: "Lake Livingston"}
},
'tc': {
latitude: 34.546708,
longitude: -90.211471,
size: 14,
tooltip: {content: "Tunica County"}
},
'lc': {
latitude: 32.628599,
longitude: -103.675115,
tooltip: {content: "Lea County"}
},
'uc': {
latitude: 40.456692,
longitude: -83.522688,
size: 11,
tooltip: {content: "Union County"}
},
'lm': {
latitude: 33.844630,
longitude: -118.157483,
tooltip: {content: "Lakewood Mutual"}
}
}
});
}
//ie svg height fix
function _fixMapHeight() {
$map.find('svg').css('height', function() {
return $(this).attr('height') + 'px';
});
}
$(function() {
initMap();
});