10390 Posts in 2202 Topics by 1712 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 502 Views |
-
Mappable module and clusterer

7 September 2011 at 2:06am
Hi,
i just played around with uncle cheese's Mappable module - it's a great time saver. But trying to activate the clusterer i get a javascript error:
marker.getLatLng is not a function
I downloaded the code for markercluster.js and activated it via
$gmap->setClusterer(true, 100, 9, '/mysite/javascript/markerclusterer.js');
Any hints?
-
Re: Mappable module and clusterer

9 September 2011 at 5:54am Last edited: 17 September 2011 9:00am
I might try removing the leading slash for one.. not sure if that will path right. Second, you might not be using the right clustered script. The one that I'm using is here: [REMOVED]
--------------------
SilverStripe tips, tutorials, screencasts and more: http://www.leftandmain.com -
Re: Mappable module and clusterer

9 September 2011 at 10:05pm
Hi there guys,
can i ask how you are implementing the cluster function please.
It's something i would like to do, just not sure how to go about it. I got the mappable module working with help form UC and this will be my next step as i have quite a few clusters of markers in various towns and villages.
Regards
Mick
-
Re: Mappable module and clusterer

13 September 2011 at 1:56am
You need to download the script in this thread and place it in your javascript dir, then just run the function you see above in cumquat's post..
$map = $yourDataObjectSet->GoogleMap($width, $height);
$map->setClusterer(true, 100, 9, 'path/to/clusterer.js');I forget what all those arguments are.. you can look in the API to see what those are. I think the 9 is the zoom..
--------------------
SilverStripe tips, tutorials, screencasts and more: http://www.leftandmain.com -
Re: Mappable module and clusterer

13 September 2011 at 8:07pm Last edited: 14 September 2011 5:07am
Hi ya,
Cheers for that, dumb question time,
Currently i run it with a very simple function that just brings back all the hospitals and police stations in a table with the code below,
public function Hospitals() {
return DataObject::get("HospitalEx");
}and then on my template page i just have
$Hospitals.GoogleMap
and that works great, but i'm just not sure where to slip in the
$map->setClusterer(true, 100, 9, 'path/to/clusterer.js');
i've set the default size of the map in _config file withGoogleMapUtil::set_map_size(980, 500);
Sorry if this is obvious to everyone else.
cheers
mick
-
Re: Mappable module and clusterer

15 September 2011 at 1:51am Last edited: 15 September 2011 1:58am
Ok I'm further forward but i'm getting the same error as WMK
Error: a.getLatLng is not a function
Source File: http://awebsiteaddress/mysite/javascript/markerclusterer_packed.js
Line: 1
I'm using the file that UC linked to.WMK did you get it working?
my current function is,
public function Hosp() {
$HospitalEx = DataObject::get("HospitalEx");
$map = $HospitalEx->GoogleMap(980, 600);
$map->setClusterer(true, 100, 9, 'mysite/javascript/markerclusterer_packed.js');
return $map;
}Mick
-
Re: Mappable module and clusterer

17 September 2011 at 9:01am
Hi, guys,
I've fixed this in the latest commit. The clusterer.js is now included with the module, and that bug has been fixed. Just use $map->setClusterer(true);
--------------------
SilverStripe tips, tutorials, screencasts and more: http://www.leftandmain.com -
Re: Mappable module and clusterer

19 September 2011 at 9:38pm
Bloody marvellous,
cheers for that it all works and everything :o)
Mick.
| 502 Views | ||
|
Page:
1
|
Go to Top |


