My suggestion is just create a single line from the location area and show the markers.
[JS]
$("#container").ejMap({
onRenderComplete:"renderComplete",
markerSelected:"onSelect"
});
function onSelect(sender){
var markerElement = sender.originalEvent.marker[0].children[0];
for(var i=0; i < markerElement.childElementCount;i++){
var element = markerElement.children[i];
window.markerCurrentElement = markerElement;
if(element.id.indexOf("dataLabel") > -1){
process = true;
element.style.display = "block";
}
}
if(process){
window.setTimeout(function(){
for(var j=0;j<window.markerCurrentElement.childElementCount;j++){
var element = window.markerCurrentElement.children[j];
if(element.id.indexOf("dataLabel") > -1){
process = false;
element.style.display = "none";
}
}
},2000);
}
}
function renderComplete(sender){
var map = $("#container").ejMap("instance");
map._on($(window), "orientationchange", mapResize);
map._on($(window), "resize", mapResize);
hideDataLabelTemplate();
}
function mapResize(){
window.setTimeout(function(){
hideDataLabelTemplate();
},500);
}
function hideDataLabelTemplate(sender){
var markerTemplate = document.getElementsByClassName("e-TemplateDiv")[0];
for(var i=0;i<markerTemplate.childElementCount;i++){
var markerElement = markerTemplate.children[i];
for(var j=0;j<markerElement.children[0].childElementCount;j++){
var element = markerElement.children[0].children[j];
if(element.id.indexOf("dataLabel") > -1){
element.style.display = "none";
}
}
}
} |