Feed Maps    • Home   • Tutorials   • API   • Language   • Tips   • Examples   • Custom Features  

Feed Maps API Reference

MCFM Class

Constructor

No parameters. One global instance of the class can exist per page. The global variable mcfm is declared in the page header javascript.

All the MCFM methods below should be called within the MCFMinit() function in the page header javascript.

Methods

addFeed(feed)

Adds an FMFeed object to the list of feeds.

initMarkerFilters(title)

Sets the displayed title of the Marker Filter section.

Marker Filters are best suited for maps using FM_KML feeds which contain markers of different types.

addMarkerFilter(name, url)

Adds a marker filter

Parameters
Name Type Description
name String the displayed name of the marker filter.
url String the marker icon URL

initDescriptionFilters(title, filterList, sort)

Sets a description filter list, to allow users to select only places which contain specified text within the place descriptions.

Parameters
Name Type Description
title String the displayed title of the description filter section.
filterList String array list of description filter strings (case insensitive).
sort Int / Boolean If set the description filter list will be sorted alphabetically.


MCFM Properties

MCFM Layout Properties

Property Type Default Value Description
layoutContainer String "fmMain" Name of the div containing the Feed Map control
sidebarWidth Int 300 Width of Sidebar in pixels
headerHeight Int 24 Height of the Header Bar in pixels
footerHeight Int 24 Height of the Footer Bar in pixels
headerPadding Int 2 Padding of the Header Bar in pixels
footerPadding Int 2 Padding of the Footer Bar in pixels
optionsHeight Int 22 Height of the options bar (within the sidebar)
headerRows Int 0 If set use multiple rows to display the feed list within the header bar
headerIcons Int 0 If set small icons are displayed next to each feed checkbox in the header bar
mainFeedsTitle String "" The title displayed before the main list of feeds
extraFeedsTitle String "" The title displayed before additional feeds (Photos, Hotels) and options (Street View, Traffic)

MCFM Map properties

Property Type Default Value Description
mapNavControl Int 2 0=No Nav Control 1=Small Nav Control 2=Large Nav Control
mapTypeControl Int 3 0=No Control, 1=Standard Map Type Control, 2=Hierarchical Map Type Control, 3=Menu Map Type Control
mapScaleControl Int 1 0=No Scale Control 1=Scale Control Shown
mapCursor Int 0 The default cursor shape when the cursor is over the map, 0=Hand Cursor 1=Crosshair Cursor
mapType Int 0 Initial map type, 0=Road Map 1=Satellite 2=Hybrid 3=Physical 4=Google Earth (3D)
mapBounds Float array [] either an empty array or an array of 4 floats in the format [ NEx, NEy, SWx, SWy ]. If mapBounds are set, the map will be displayed and centered using these bounds using mapBounds. If mapBounds are not set then the map will be displayed after feeds have been loaded and will be centered using the bounds of these feeds.
mapOverviewMap Int 0 If set, a small overview map is displayed in the bottom-right corner of the map.
mapScrollZoom Int 1 Mouse Wheel Scrolling of the map, 0=Disabled 1=Enabled
mapDoubleClickZoom Int 1 Double-click map zooming (left=Zoom in, right=ZAoom out), 0=Disabled 1=Enabled
mapContinuousZoom Int 1 Smooth map scrolling, 0=Disabled 1=Enabled
mapTerrain Int 1 Terrain Map Control, 0=Disabled 1=Enabled
mapGoogleEarth Int 0 Google Earth 3D Map Type Control, 0=Disabled 1=Enabled. Example
mapStreetView Int 1 If set displays the street view checkbox control in the footer bar
mapTraffic Int 1 If set displays the traffic checkbox control in the header bar
mapGoogleBar Int 0 If set then the Google Local Search Control is displayed in the bottom-left corner of the map.
mapCoords Int 0 If set the current cursor co-ordinates will be displayed at the bottom of the sidebar
mapPanoramio Int 1 If set include a feed labelled 'Photos' in the header bar. Selecting this feed will display Photos from Google's Panoramio service.
mapHotels Int 1 If set include a feed labelled 'Hotels' in the header bar. Set the value to 1 for the standard hotel controls, set to 2 for the advanced hotel controls which include availability search.

Geocoder Properties

Property Type Default Value Description
geocoder Int 1 If set the 'find address' control is displayed in the footer bar
geocoderTitle String "" The title displayed before the geocoder text box
geocoderWidth Int 1 The width of the geocoder text box
geocoderCountry String "" The locale used for geocoding (default is USA). Use "uk" for United Kingdom. More information.

MCFM Info Window Properties

Property Type Default Value Description
infoIcon Int 0 Display the place icon in the info window. 0=Display no icon 1=Display half-size icon 2=Display full size icon
infoWidth Int 0 If non-zero, the maximum width of an info window
infoHeight Int 0 If non-zero, the height of the info window description used to display the place description. The description content is scrollable if the height exceeds the .infoHeight.
infoLatLong Int 1 If set the place lat long co-ordinates will be displayed in the info window.
infoDirections Int 0 If set then 'Get Directions' links will be added to the info window content in a tab marked 'Directions'.
infoZoom Int 1 If set then 'Zoom In' and 'Zoom Out' links will be added to the info window content.
infoMagnify Int 1 If set then a 'Magnify' link will be added to the info window content.
infoMagnifyMapType Int 1 The map type shown when the user clicks 'magnify'. 0=Road Map 1=Satellite 2=Hybrid 3=Terrain
infoSpace Int 1 The height in pixels of the gap between the place description and added contentr in the info window.
infoStreetView Int 1 If set a tab marked 'Street View' will be added to the info window.

Note: if the place has a heading value (loaded from a spreadsheet) then the Street View will be added to the main tab beneath the description.
infoTargetFrame string "_blank" Specifies the target frame for links within the info window. Use "_blank" to load in a new tab/window or "_top" to load in the current window (outside the IFrame).

MCFM Side Bar Properties

Property Type Default Value Description
sidebarShow Int 1 0=Sidebar hidden 1=Sidebar visible (default)
sidebarIcon Int 1 0=No Icon 1=Half-size Icon (default) 2=Full-size icon
sidebarDescription Int 0 If set then the place description is included in the sidebar
sidebarLatTitle String "Latitude" The title displayed before the latitude value in the sidebar (if the mapCoords property is set)
sidebarLongTitle String "Longitude" The title displayed before the longitude value in the sidebar (if the mapCoords property is set)
sidebarViewAll Int 0 If set, a link labelled 'View All' is displayed in the sidebar title bar
sidebarOptions Int 1 If set the options section is displayed at the bottom of the sidebar

MCFM Visibility Filter Properties

Property Type Default Value Description
visFilter Int 1 If set only places visible on the map will be displayed in the sidebar
visFilterTitle String "Only Visible Locations" The title displayed next to the Visibility Filter checkbox.

MCFM Paging Properties

Property Type Default Value Description
pagingEnabled Int 1 0=Disabled 1=Enabled.
pageSize Int 1 The number of places displayed per page
pageDetail Int 1 If set the range of visible place indexes will be displayed in the siudebar title bar (e.g. 1 to 100)

MCFM Name Filter Properties

Property Type Default Value Description
nameFilterOn Int 1 0=Disabled 1=Enabled.
nameFilterTitle String "Name" The Name Filter text prefix
nameFilterWidth Int 50 Name Filter width in pixels

MCFM Tooltip Properties

Property Type Default Value Description
tooltipOffsetX Int 12 Horizontal offset from the marker centre to the tooltip corner.
tooltipOffsetY Int 0 Vertical offset from the marker centre to the tooltip corner.

MCFM Street View Properties

Property Type Default Value Description
streetviewWidth Int 500 Width of the Street View panorama
streetviewHeight Int 250 Height of the Street View panorama

MCFM Ad Properties

Property Type Default Value Description
googleMapAds Int 1 Display Google Map ads
adsenseID String "ca-pub-5408854154696215" Adsense ID used for Gooole Map ads
adsenseChannel String "1329995603" Adsense Channel used for Google Map ads
adsenseMinZoom Int 5 Minimum Zoom Level at which to display Google Map ads
adsenseMarkerLimit Int 5 Maximum number of markers displayed on the map at one time
lat49ID Int 46 Lat 49 publisher ID if Lat 49 ads are enabled

MCFM Link Properties

Property Type Default Value Description
linksHtml String "Free Mapping Tools from <a target='_blank' href='http://www.mapchannels.com'>Map Channels</a>" Link html displayed on the right hand side of the footer bar

FMFeed Class

Constructor

var feed = new FMFeed(title, source, type, visible (optional) )

Return type : an FMFeed object

Parameters

Name Type Description
title string assigned name of the feed
source string source of the feed - either the URL of the feed or a Google spreadsheet key (for type FM_SPREADSHEET)
type int the feed type (see table below)
visible boolean true = feed is initially visible, false = feed is initially hidden. If this parameter is not specified the feed is initially visible.


Feed Types :
Value Description Domain Restrictions Note
FM_GEOXML GeoXml source - the url of a KML or GeoRSS file. Loads in the feed as a single overlay with no side bar listings. No domain restrictions apply
FM_KML Local KML files - supports the Google My Maps KML format. Some Google Earth KML formatting is not supported. Must be in the same domain
FM_GEORSS A GeoRSS feed to load using the Google AJAX Feeds API. The feed will usually be updated hourly. No domain restrictions apply
FM_SPREADSHEET The id of a Google Spreadsheet No domain restrictions apply
FM_TXT The url of a tab-delimited file containing map data. Must be in the same domain Must include a column labelled 'link'

FMFeed Methods

setMarkerStyle(iconUrl, iconWidth, iconHeight, iconAnchorX, iconAnchorY, infoAnchorX, infoAnchorY, shadowIconUrl (optional), shadowIconWidth (optional), shadowIconHeight (optional))

Assigns the marker style for all places in the feed.

Parameters
Name Type Description
iconUrl string the url of the icon image
iconWidth int the width in pixels of the icon image
iconHeight int the height in pixels of the icon image
iconAnchorX int Icon horizontal offset
iconAnchorY int Icon vertical offset
infoAnchorX int Marker InfoWindow horizontal offset
infoAnchorY int Marker InfoWindow vertical offset
shadowIconUrl string the url of the icon shadow image (optional)
shadowIconWidth int the width in pixels of the shadow icon image (optional)
shadowIconHeight int the width in pixels of the shadow icon image (optional)
Sets the url of the shadow icon image and sets custom anchor values

setPolyStyle(lineWidth, lineOpacity, lineCol, polyFill, polyOutline, polyOpacity, polyCol )

Sets the style used by polyline and polygons

Parameters
Name Type Description
lineWidth int line thickness in pixels
lineOpacity float line opacity (0 to 1)
lineCol string Line colour in RGB format, e.g. FF0000
polyFill int 0=Empty polygon interior 1=Fill polygon interior
polyOutline int 0=No Polygon Border 1=Polygon Border
polyOpacity float Opacitiy of polygon interior (0 to 1)
polyCol string Fill colour of polygon in RGB format, e.g. FF0000

setTag(htmlTag)

Sets an HTML tag that is added to the info window of each place in the feed. Takes one string parameter.

setFields(x,y,t,d,l, h,p,m)

Specifies which column of spreadsheet data represents which place data fields. Only applies to feeds of FM_SPREADSHEET and FM_TXT types.

Each parameter is either a single character string in the range of "A" to "Z", or "" if the field is not used.

Parameters
Name Type Description
x string the longitude column
y string the latitude column
t string the title column
d string the description column
l string the link column
h string the street view heading (yaw) column (use only if there is a valid streetview available for this location).
p string the street view pitch column (use only if there is a valid streetview available for this location).
m string the street view magnification (zoom) column (use only if there is a valid streetview available for this location).

Example 1   Example 2




  Directories:  • Map Channels Events  • Map Channels Hotels
  Related Sites:  • Mashed World  • Mashed Tickets  • See Bournemouth  • EntCal.com  • TripGeo  • Street Cities  • My Maps Plus
(c) www.mapchannels.com, 2007-2012   Terms   Contact