First of all please note that you have defined two function with the name ‘init’. You should have only one of them and put the code in one of them as well.
Another problem - map view is same as agenda view in regards that both of them try to display events with no end date. Such thing won’t work correctly with recurring view where we actually have events with no end date.
You can do following:
[code]// updating dates to display on before view change
scheduler.attachEvent(“onBeforeViewChange”, function(old_mode, old_date, new_mode, new_date) {
scheduler.config.map_start = scheduler.date.month_start(new Date((new_date||old_date).valueOf()));
scheduler.config.map_end = scheduler.date.add(scheduler.config.map_start, 1, “month”);
return true;
});
// defining add function for prev/next arrows
scheduler.date.add_map = function(date, inc) {
return scheduler.date.add(date, inc, “month”);
};
// defining date header
var format = scheduler.date.date_to_str("%Y-%m-%d");
scheduler.templates.map_date = function(start, end, mode){
return format(start)+" — "+format(end);
};[/code]
Kind regards,
Ilya
I have to click twice on the “Map” tab, otherwise the Google Map doesn’t show the position of the entrys on the left
.
If you click only once, the pointer is somewhere in nowhere.
You’ve made incorrect init function to begin with, while there is only one of it you still call scheduler.init two times.
I’ve updated this part, please check: http://pastie.org/3480370
Please note commented lines and several paths to events xml were changed.
Works fine for me.
If it doesn’t work for you - at least provide error message and line number.
Thank you again for your assistance.
I have crated a new html file with your code (copy&paste&customize). But there are still phenomens. The events in the map view- list blinking in bold-font once
And the locations weren’t show if i click them. I send you an URL on PM.
Do you store events coordinates in your DB?
With
scheduler.config.map_resolve_event_location = true;
option enabled scheduler for all events without coordinates info (lat and lng) will try to get their coordinates one by one and save to the database. Option is designed to make migration easier - in case you have locations, but missing coordinates. It’s intended to be used only once as all future events will get their coordinates the moment you save them. And you are expected to store that information, getting it everytime is not a good option.
Problems:
-Calendar doesn’t load the actual date, i have to press “Today” everytime.
-All calendar entrys are blinking by the first view
-Maps doesn’t show the correct position if you click the entry in the list.
-The “Save” button is somewhere in nowhere (left top) and i cant move it.
Again - do you store events coordinates in your DB? Because you need to.
scheduler.config.map_resolve_event_location = true; option should be used only once to get and save event coordinates. After that it should be disabled and coordinates for new events will be saved automatically.
It loads what you’ve told him to load
scheduler.init(‘scheduler_here’, new Date(2010, 8, 1), “map”);
Change it to
scheduler.init(‘scheduler_here’, new Date(), “map”);
to get current date.
Save coordinates, disable resolve option.
If their position wasn’t resolved yet - could be happening, as expected.
As you’ve added that button you can freely control it’s position. It seems you forgot to add ‘position: absolute;’ though.