MMap

version 0.2

Class: MMap.MarkerLoader

Two or more markers are read from the context.

Implements:

MMap.Events, MMap.Options

Method: constructor

Constructor of marker loader

Syntax:

var myMarkerLoader = new MMap.MarkerLoader(options);

Arguments:

  1. options - (mixed) Option of marker loader

Options:

  • format - (string) Format of context. An initial value is 'array'.
  • onPreload - (function) It is generated before the marker is read.
  • onFailure - (function) It is generated when failing in reading the marker.
  • onComplete - (function) After information on the marker is acquired, it is generated.
  • onLoad - (function) After the marker is read, it is generated.

Method: load

Syntax:

Example of syntax (Part1)

var context = [
    {
        title: 'Marker1', 
        content: 'Marker1',
        position: {
            latitude: 35.6666870,
            longitude: 139.731859
        }
    },
    {
        title: 'Marker2',
        content: 'Marker2',
        position: {
            latitude: 35.6666870,
            longitude: 139.733859
        }
    }
];
var loader = new MMap.MarkerLoader({
    markers: context
});
loader.load();

or


var context = [
    {
        title: 'Marker1',
        content: 'Marker1',
        position: {
            latitude: 35.6666870,
            longitude: 139.731859
        }
    },
    {
        title: 'Marker2',
        content: 'Marker2',
        position: {
            latitude: 35.6666870,
            longitude: 139.733859
        }
    }
];
loader.load(context);

Example of syntax (Part2)

//When you hand over the options of Request
//http://mootools.net/docs/core/Request/Request
var loader = new MMap.MarkerLoader({
    method: 'get',
    format: 'json',
    url: 'http://example.com/json'
});
loader.load();

or


var loader = new MMap.MarkerLoader();
var context = {
    method: 'get',
    format: 'json',
    url: 'http://example.com/json'
};
loader.load(context);

Copyright(c) 2010 Noritaka Horio All Rights Reserved.