echo "\ n <div id = \" map \ "style = \" width: ". $ this-> mapWidth." px; height: ". $ this-> mapHeight." px \ "> \ n\ n "; // clearly indicate that the width and height of divas are px
map.enableScrollWheelZoom (); // for the possibility of approaching-removing the twitch of the mouse
map.enableDoubleClickZoom (); // for the possibility of approaching with a double click
geocoder = new GClientGeocoder ();
geocoder.setBaseCountryCode ('ru'); \ n ";
GEvent.addListener (marker ". $ G.", \ "Mouseover \", function () {\ n ";default onclick event: GEvent.addListener (marker ". $ g.", \ "click \", function () {\ n ";
echo "GEvent.addListener (marker". $ g. ", \" mouseout \ ",
function () {
marker ". $ g.". closeInfoWindow ();
}); \ n ";
echo "GEvent.addDomListener (document.getElementById ('listTaxi'). getElementsByTagName ('p') [". $ g. "], 'mouseover', function () {
this.style.color = '# E5A8A8';
this.className = 'over' \ n ";
echo "marker". $ g. ". openInfoWindowHtml (\" ". $ this-> validPoints [$ g] ['htmlMessage']." \ ");
}); \ n ";
echo "GEvent.addDomListener (document.getElementById ('listTaxi'). getElementsByTagName ('p') [". $ g. "], 'mouseout', function () {
this.style.color = 'black'; \ n ";
echo "marker". $ g. ". closeInfoWindow ();
}); \ n ";
<? php $ map-> printGoogleJS ()?>
<? php $ map-> addGeoPoint ($ resultset-> getString ('latitude'), $ resultset-> getString ('longitude'), $ o); ?>
<? php $ map-> showMap (); ?>
class indexActions extends sfActions
{
public function executeIndex ()
{
$ this-> map = new PhoogleMap ();
$ this-> map-> centerMap (55.7557, 37.6183); // center along the Manege Square
}
}
Source: https://habr.com/ru/post/36987/
All Articles