forked from 0x2620/oxjs
add proper tooltips to map
This commit is contained in:
parent
479e7da2f5
commit
64032b5e9c
8 changed files with 57 additions and 17 deletions
|
|
@ -797,6 +797,18 @@ Ox.Map = function(options, self) {
|
|||
google.maps.event.addListener(self.map, 'zoom_changed', zoomChanged);
|
||||
google.maps.event.addListenerOnce(self.map, 'tilesloaded', tilesLoaded);
|
||||
|
||||
// needed to get mouse x/y coordinates on marker mouseover,
|
||||
// see http://code.google.com/p/gmaps-api-issues/issues/detail?id=2342
|
||||
that.overlayView = new google.maps.OverlayView();
|
||||
that.overlayView.setMap(self.map);
|
||||
that.overlayView.draw = function () {
|
||||
if (!this.ready) {
|
||||
this.ready = true;
|
||||
google.maps.event.trigger(this, 'ready');
|
||||
}
|
||||
}
|
||||
that.overlayView.draw();
|
||||
|
||||
if (self.options.find) {
|
||||
self.$findInput.options({value: self.options.find})
|
||||
.triggerEvent('submit', {value: self.options.find});
|
||||
|
|
@ -1161,10 +1173,9 @@ Ox.Map = function(options, self) {
|
|||
isVisible = self.$placeControls.name.is(':visible');
|
||||
if (place) {
|
||||
self.$placeControls.flag.empty().append(
|
||||
$('<img>')
|
||||
.attr({
|
||||
src: Ox.getImageByGeoname('icon', 16, place.geoname)
|
||||
})
|
||||
$('<img>').attr({
|
||||
src: Ox.getImageByGeoname('icon', 16, place.geoname)
|
||||
})
|
||||
).show();
|
||||
self.$placeControls.name.options({title: place.name})
|
||||
!isVisible && $placeControls.show().animate({opacity: 1}, 250);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue