Autocenter on loaded KML file...

Ldectus_gr - January 3, 2008 - 21:54
Project:MyKML Filter
Version:5.x-2.0
Component:Code
Category:task
Priority:normal
Assigned:Unassigned
Status:needs review
Description

Hi! Nice work and really wonderful implementation of the jquery code....
Now, since I wanted to autozoom on my currently loaded KML overlay, instead of manually putting the correct coordinates, I did the following minor modifications:

jquery.jmaps.js, Line 142:

addKml: function (kmlfile) {
var geoCallback = function()
{
  geoXml.gotoDefaultViewport(jmap);
}
var jmap = this[0].GMap2;
var geoXml = new GGeoXml(kmlfile,geoCallback);
return jmap.addOverlay(geoXml);
},

Additionally ...

mykml_filter.module, line 134:

drupal_add_js('$(document).ready(function(){
$("#map").jmap();
$("#map").addKml("'.$kml.'");
         })','inline');

(I've removed the `$("#map").myMap().setCenter(new GLatLng'.$latlonzoom.');` thing).

Perhaps you could implement a choice in the settings, like "Autocenter" enabled etc...

By the way, I've seen that there's an update on jquery.js module, it's v1.3 now. Can I safely replace the current one?

Cheers!

#1

challer - February 21, 2008 - 21:57

Sorry it took a while, need to refine my notifications. Great patch, I'll look into it. As for the 1.3 release, for some reason I couldn't make it work last time I tried, but it's probably worth looking into that again.

 
 

Drupal is a registered trademark of Dries Buytaert.