[EXTENSION] jquery-gmap

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

I saw a class EGmap3MarkerCluster.php. Can I use the cluster via this class? If so, can you post an example? Thx

Just a quick comment:

  1. Thank you so much for such a wonderful extension.

  2. I don’t know if only I have the problem, but I found a bug in gmap3.js and gmap3.min.js. There is an undefined variable k which should be i if following the code’s logic. I don’t know if this bug occurs in certain circumstance but just found out when I tried to use the marker class’s capturePosition.

hi,

i have the problem that the page, in which i include a gmap, doesent load when the server has no connection to the internet.

How can I use this extension with caching? When I add beginCache before calling EGmap3Widget, the renderMap() option never inserts the javacsript for the maps into the footer when cached. Thanks!

Are there any plans to update this plugin to Gmap3 version 5? This version is substantially different from previous versions, so it may take a bit of work to port over to it without breaking compatibility.

How i can start custom style always? Not through button push.

Thanks for this awesome extension.

I am using this extension for the first time in my project PYA. but here I am facing the zoom problem of map i.e I want to go to the details view of the map such that streets, houses etc but it doesn’t go there.

Here is my code.

<style>

#EGMapContainer1 img{


    max-width: none;


}

</style>

<?php

Yii::import(‘common.extensions.EGMap.*’);

$gMap = new EGMap();

$gMap->width = ‘100%’;

$gMap->setHeight(500);

$gMap->zoom = 2;

$mapTypeControlOptions = array(

'position' =&gt; EGMapControlPosition::TOP_RIGHT,


'style' =&gt; EGMap::MAPTYPECONTROL_STYLE_DROPDOWN_MENU,


'minZoom' =&gt; 2,


'maxZoom' =&gt; 24,

);

$zoomControlOptions = array(

'style' =&gt; EGMap::ZOOMCONTROL_STYLE_SMALL,

);

$gMap->zoomControl = true;

$gMap->panControl = true;

$gMap->scrollwheel = false;

$gMap->zoomControlOptions = $zoomControlOptions;

$gMap->mapTypeControlOptions = $mapTypeControlOptions;

$gMap->setCenter(33.6770364, 73.0203442); // lat and long of Islamabad

/* * ************************************************************************************************* */

// Create GMapInfoWindows

/*     * ******************styling the info window******************** */





// var contentString =    


// Create GMapInfoWindows


&#036;info_box = new EGMapInfoBox('&lt;div style=&quot;color:#fff;border: 1px solid black; margin-top: 8px; background: #000; padding: 5px;&quot;&gt;' . CHtml::image(Yii::app()-&gt;baseUrl . '/media/projects/thumbnails/' . &#036;data-&gt;cover_photo, &#036;data-&gt;title, array('height' =&gt; 100, 'width' =&gt; 100)) . '&lt;br&gt;' . CHtml::link(CHtml::encode(&#036;data-&gt;title), &#036;data-&gt;url) . '&lt;/div&gt;');

// set the properties

&#036;info_box-&gt;pixelOffset = new EGMapSize('0', '-140');


&#036;info_box-&gt;maxWidth = 0;


&#036;info_box-&gt;boxStyle = array(


    'width' =&gt; '&quot;150px&quot;',


    'height' =&gt; '&quot;120px&quot;',


    'background' =&gt; '&quot;url(http://google-maps-utility-library-v3.googlecode.com/svn/tags/infobox/1.1.9/examples/tipbox.gif) no-repeat&quot;'


);


&#036;info_box-&gt;closeBoxMargin = '&quot;10px 2px 2px 2px&quot;';


&#036;info_box-&gt;infoBoxClearance = new EGMapSize(1, 1);


&#036;info_box-&gt;enableEventPropagation = '&quot;floatPane&quot;';

















&#036;marker = new EGMapMarker(&#036;data-&gt;latitude, &#036;data-&gt;longitude, array('title' =&gt; &#036;data-&gt;title, 'icon' =&gt; &#036;icon));


&#036;marker-&gt;addHtmlInfoBox(&#036;info_box);


&#036;gMap-&gt;addMarker(&#036;marker);

}

// enabling marker clusterer just for fun

// to view it zoom-out the map

$gMap->enableMarkerClusterer(new EGMapMarkerClusterer());

$gMap->renderMap();

?>

How should I fix this problem ???

thanks in advance.