[EXTENSION] jquery-gmap

I’m not sure I understand. Do you mean the styled maps option of the js plugin ? http://gmap3.net/api/set-styled-map.html

Yes

At the present time, this feature is not implemented in the PHP interface. Work has started but is not finished.

You should be able to set the options through JS though, by accessing the map after creation.

Very nice and friendly extension.

Works like a charm!

Question: is it possible to define an ‘anchor point’ for a marker’s icon?

According to Google Maps documentation (google.maps.MarkerImage class):

"By default, the anchor is located along the center point of the bottom of the image"

But since I’m using a PNG image with semi-transparent glow / shadow, the icon appears to be ‘above’ the actual point in the map where it should be…

Also, when I add ‘polylines’ to link the Markers, the lines seem to come out of the ‘air’ instead of the Marker’s center.

I’d like to position the icon’s vertical and horizontal center at the marker’s coordinates. Any ideas?

Have you seen any Google documentation to that effect ?

Yes Ianaré, see below:

google.maps.MarkerImage class:

Constructor: MarkerImage(url:string, size?:Size, origin?:Point, anchor?:Point, scaledSize?:Size)

anchor = Point : The position at which to anchor an image in correspondance to the location of the marker on the map. By default, the anchor is located along the center point of the bottom of the image.

(from code.google.com/apis/maps/documentation/javascript/reference.html#MarkerImage)

I don’tt know hoy to use this javascript code with the jquery-gmap extension (if possible), or if the extension already supports this.

This was relatively easiy to add, so here you go :




$marker = new EGmap3Marker(array(

    'title'=>'hello',

    'icon'=>array(

         'url'=>'http://google-maps-icons.googlecode.com/files/dolphins.png',

         'anchor'=> array('x'=>1,'y'=>36),

         //'anchor' => new EGmap3Point(5,5),

    )

));

This hasn’t been released yet though, get latest version from github …

Thanks SOOO much!! :D

It works perfect.

Thank you for great extensions.

I’ve problem, I want to refresh automatic only the map and set data marker from database periodically.

Could you help me?

If you need to update the map after it is created you should look to adding that functionality with javascript calls, connecting to the DB via ajax. Take a look at the gmap3 API documentation.

I have problem with this extension, i dont know how to modify action named ‘addMarkers’. I want to make clustering for points like here gmap3.net/examples/clustering.html. Anyone have solution for clustering in this extension? it is possible?

A new version has been pushed to github which provides preliminary support for this. Here is an example :


Yii::import('ext.jquery-gmap.*');


$gmap = new EGmap3Widget();

$gmap->setSize(600, 400);


// base options

$options = array(

	'zoom' => 12,

	'center' => array('41.850033', '-87.650052'),

	'mapTypeId' => EGmap3MapTypeId::ROADMAP,

	'mapTypeControlOptions' => array(

		'mapTypeIds' => array(EGmap3MapTypeId::ROADMAP, 'style1'),

	),

);

$gmap->setOptions($options);


$styledMap = new EGmap3StyledMap('style1', array('name' => 'style 1'));

$styledMap->addStyle(array(

	'featureType' => 'road.highway',

	'elementType' => 'geometry',

	'stylers' => array(array(

			'hue' => '#ff0022',

			'saturation' => 60,

			'lightness' => -20

		)

	)

));

$gmap->add($styledMap);


$gmap->renderMap();

New version released today which includes improvements previously requested here. Also some example view files.

Work on this has started but is not complete yet, will be done for the next release. For now you can still access this functionality through JS.

Hey! Anyone have an idea as to how I can get the text directions showing with this?

You need a call to setDirectionsPanel… but I am not really sure how to call that properly with this extension. I have a simple map and address form. They type their address in and a route is made from there to the destination. The form does submit to the page… so there is nothing fancy. And the route is working correctly… I just need the text directions.

Please help me. =\

Thanks.

Is is possible to pass many addresses into the marker and have them all displayed on the map?

I created a function in my model with a foreach loop to grab all the addresses and then set that function as the marker but this only prints out all the addresses above the map and the map only shows a world view at this point.

How to render a street view/ panorama map using this extension?

Please help !!

How do I add more then one marker with info window

please please help me

Hello Yii people! I would like to know if someone could solve the comment #5803 written by sirin_ibin (Update Marker Position from Yii Model is not working when we are using Capture position or capture zoom level with it).

This extension is great!! Thanks

Hi. How i can get current lat lon by right clicking on the map and populate it in a form fiedls?

Here is the code in js:


google.maps.event.addListener(map, "rightclick", function(event) {

    var lat = event.latLng.lat();

    var lng = event.latLng.lng();

    // populate yor box/field with lat, lng

    alert("Lat=" + lat + "; Lng=" + lng);

});

How i can do this using this extension?

Thanks