ControlOptions new google maps version

93 views
Skip to first unread message

Juan Manuel Andrade

unread,
Jan 27, 2015, 7:41:16 PM1/27/15
to timemap-d...@googlegroups.com
hello all, I have made a webpage using timemap two years ago. I must recently update it, now I see there are no map controls (zoom, pan, etc), and looking into google maps API, maps v2 is deprecated, and now only available and official version is 3, I want to know how it could be possible to enable again map controls and where do i have to put the code in order to update it, thanks!

Richard Abbott

unread,
May 22, 2015, 12:36:04 AM5/22/15
to timemap-d...@googlegroups.com
Juan,
I have found that this works. Set up a map options object and then attach it to the map. For example

var tm;
$(function() {
    var myMapOptions = {
   zoomControl: true,
   zoomControlOptions: {
     style: google.maps.ZoomControlStyle.SMALL
   }
    };
//...etc all the other stuff you want...

    tm = TimeMap.init({
        mapId: "map",               // Id of map div element (required)
        timelineId: "timeline",     // Id of timeline div element (required)
//... more stuff you want as usual...
    });
    
    // set the map to our custom style
    var gmap = tm.getNativeMap();
    gmap.setOptions(myMapOptions);
});

Hope that helps
Richard

Juan Manuel Andrade

unread,
May 28, 2015, 9:53:30 PM5/28/15
to timemap-d...@googlegroups.com
Hello there,

So sorry not to answer before your post, having a busy month here. Thank you so much for your reply! it worked perfectly for me! nice to reborn my timemap project thanks to you! best regards!

Michael Ussher

unread,
Dec 30, 2017, 8:39:45 PM12/30/17
to Timemap.js Development
Also had this problem.  Thank you very much for the solution that worked.  Had been looking for a while.
Reply all
Reply to author
Forward
0 new messages