Last active
May 6, 2017 14:53
-
-
Save dimik/7715fdba2db6da9a3615da598fdae787 to your computer and use it in GitHub Desktop.
cluster balloon layout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var MyClusterBalloonItemContentLayout = ymaps.templateLayoutFactory.createClass([ | |
'<a href="/WebApp/tasks/editTask?id={{ properties.taskId }}" title="{{ properties.title }}" class="edit_btn">', | |
'<span class="glyphicon glyphicon-edit map_btn edit_map_btn"></span>', | |
'</a>' | |
].join(''), { | |
build: function() { | |
MyClusterBalloonItemContentLayout.superclass.build.call(this); | |
jQuery('.edit_btn', this.getParentElement()).on('click', function(e) { | |
... | |
}) | |
} | |
}); | |
var myClusterer = new ymaps.Clusterer({ | |
clusterBalloonItemContentLayout: MyClusterBalloonItemContentLayout, | |
}); | |
myMap.geoObjects.add(myClusterer); | |
for(...) { | |
myClusterer.add(new ymaps.GeoObject({ | |
geometry: { | |
type: "Point", | |
coordinates: [addresses[i].log, addresses[i].lat] | |
}, | |
properties: { | |
taskId: tasksNotDone[i].id, | |
title: "Редактировать задание", | |
} | |
})); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment