
+ + ')
'
+ + '
'
+ + that.map.options('markerTooltip')(that.place) + '
'
+ ).addTo(that.map.map);
}
function mouseout() {
- that.tooltip.hide();
+ that.tooltip.remove();
}
- function setOptions() {
- // workaround to prevent marker from appearing twice
- // after setting draggable from true to false (google maps bug)
- var fix = that.marker.getDraggable() && !that.place.editing,
- color = that.map.options('markerColor'),
- size = that.map.options('markerSize');
+ function setColor() {
+ var color = that.map.options('markerColor');
//Ox.Log('Map', 'setOptions, that.map: ', that.map)
if (color == 'auto') {
that.color = typeColor[that.place.type] || typeColor['mapPlaceFeatureColor'];
@@ -218,6 +227,15 @@ Ox.MapMarker = function(options) {
} else {
that.color = color(that.place);
}
+ }
+
+ function setOptions() {
+ // workaround to prevent marker from appearing twice
+ // after setting draggable from true to false (google maps bug)
+ var fix = false, // that.marker.getDraggable() && !that.place.editing,
+ size = that.map.options('markerSize');
+ //Ox.Log('Map', 'setOptions, that.map: ', that.map)
+ setColor()
if (size == 'auto') {
that.size = 8;
Ox.forEach(areaSize, function(size, area) {
@@ -232,50 +250,46 @@ Ox.MapMarker = function(options) {
} else {
that.size = size(that.place);
}
+ /* fixme, some of those can be set some not
that.marker.setOptions({
// fixme: cursor remains pointer
cursor: that.place.editing ? 'move' : 'pointer',
draggable: that.place.editing,
- icon: Ox.MapMarkerImage({
+ element: Ox.MapMarkerImage({
color: that.color,
mode: that.place.editing ? 'editing' :
that.place.selected ? 'selected' : 'normal',
size: that.size,
type: that.place.id[0] == '_' ? 'result' : 'place'
}),
- position: that.place.center
- });
+ })
+ */
+ //that.marker._color = that.color;
+ that.marker._element.style.cursor = that.place.editing ? 'move' : 'pointer';
+ that.marker.setDraggable(that.place.editing);
+ that.marker.setLngLat(that.place.center);
if (fix) {
that.marker.setVisible(false);
setTimeout(function() {
that.marker.setVisible(true);
}, 0);
}
- setTooltip();
}
- function setTooltip() {
- that.tooltip && that.tooltip.remove();
- that.tooltip = Ox.Tooltip({
- title: '