The following HTML demonstrates how to include worldKit within a web page.
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" WIDTH="800" HEIGHT="400" id="worldkit">
<param NAME=movie VALUE="worldkit.swf">
<param NAME=quality VALUE="high">
<param NAME=bgcolor VALUE="#000000">
<embed src="worldkit.swf" quality="high" bgcolor="#000000" WIDTH="800" HEIGHT="400" NAME="worldkit" ALIGN="" TYPE="application/x-shockwave-flash" swLiveConnect="true" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">
</embed>
</object>
Images can also be displayed at an annotation, instead of text . Add a <media:content> to any <item>, with the "url" attribute set to the url of an image.
<media:content url="http://farm1.static.flickr.com/102/309709211_2d1e8ad3ac_o.jpg"/>
It is possible to assign an annotation to multiple categories, to independently control multiple configuration options. For example, in a plot of recent earthquake activity, the size could vary according to the mangitude of the earthquake, and the color could vary according to how recently it occurred.
You'll next need to edit one of the RSS templates on the Edit Templates screen. There are several MoveableType tags implemented by the Meta plugin. Used as follows within an RSS <item>, a lat/lon will be added to the RSS feed whenever they are present.
Finally, dont forget to declare the geo namespace, by adding the following attribute to the root rss tag (xmlns:georss="http://www.georss.org/georss").
This is an example post. geo:lat=19.08 geo:long=74.73
This is an example post. geo:lat=19.08 geo:long=74.73
Since BlogSpot does not offer the ability to upload files, you will need to publish your weblog to another server with that access. Upload the worldKit install to that server, setting <dataurl> to the location of your Atom feed, and <locfield> to "summary".
In addition to points, worldKit can draw polygons, lines, and boxes. In the RSS file, instead of specifying coordinates in <georss:point>, a space seperated list of coordinates is provided in either
<georss:polygon>,
<georss:line>, or
<georss:box>. Each coordinate is a space seperated lat/long pair.
GeoRSS Simple (shown here) and GeoRSS GML are both supported and recommended. The old informal specification of geo:polygon and geo:line is still supported but not recommended.
Here is a simple example of a polygon, a line, and a box in RSS.
<?xml version="1.0"?>
<rss version="2.0" xmlns:georss="http://www.georss.org/georss">
<channel>
...
<item>
<title>An example polygon</title>
<link>http://example.com/geo</link>
<description>Just an example</description>
<georss:polygon>30 -120 30 -100 20 -100 30 -120</georss:polygon>
</item>
...
<item>
<title>An example line</title>
<link>http://example.com/geo</link>
<description>Just an example</description>
<georss:line>50 -0.2 54 3 59 2.56</georss:line>
...
</channel>
</rss>
...
<item>
<title>An example box</title>
<link>http://example.com/geo</link>
<description>Just an example</description>
<georss:box>42.943 -71.032 43.039 -69.856</georss:box>
...
</channel>
</rss>
As for
colors, the line/polygon/box border will be drawn with the hex color listed in config option
<linecolor>. The polygon/box will be filled with colors specified in
<initialplotcolor> and
<restingplotcolor>. The alpha of borders and lines is specified in
<linealpha>, and of fill in
<fillalpha>.
Annotation textboxes are positioned at the first coordinate in the list. Polygons/boxes are filled with 30% transparency, so annotations plotted before are visible. However, those covered annotations are not clickable. One way to adjust this behavior is through the
<zlevel> config option.
If
<zoomto> is set, the zoom will be centered on the first coordinate listed in the line or polygon. Alternately, if
<georss:point> is specified, the zoom will center to that point.
Time Navigation
Time Navigation
worldKit supports time navigation. Many processes investigated with GIS have a significant temporal dimension: urban planning and land use, hydrology, fires, ecological change. In addition to being spatially arranged, controls allow annotations to be revealed according to their timestamp. Looking at examples probably does a better job of explaining:
History of Urbanziation and
Tower Hamlets.
Annotation timestamps for an <item> can be set in subtags:
<dc:date> in RSS 1.0,
<pubDate> in RSS 2.0, and
<issued> in Atom. Most weblog systems will include publication date in feeds automatically.
The format for <pubDate> is defined
here, and basically looks like this example:
<item>
<title>An example RSS 2.0 timestamped item</title>
<link>http://example.com/geo</link>
<georss:point>26.58 -97.83</georss:point>
<pubDate>Sat, 07 Sep 2002 00:00:01 +00:00</pubDate>
</item>
The format for <dc:date> and <issued> is defined
here, and basically looks like this example:
<entry>
<title>An example Atom timestamped item</title>
<link href="http://example.com/geo"/>
<georss:point>26.58 -97.83</georss:point>
<issued>2003-12-13T08:29:29-04:00</issued>
</entry>
worldKit adds a time navigation control to the bottom of the map. Moving the slider reveals all points occuring before that time. There are also key controls: "p" to Play, "r" to Rewind, "s" to Stop. The configuration options are..
- <timenav>: Set to true to enable time navigation. The default value is "false".
- <startdate>: The earliest date for the time navigation control. This value must be specified, in either of the formats above.
- <enddate>: The latest date for the time navigation control. This value must be specified, in either of the formats above.
- <timenavunit>: The number of steps between the start and end, on the navigation control. The default value is "200".
- <timenavpos>: The preset position of time navigation. This value must be between 0 and the value of <timenavunit>. The default value is "0".
Note!: worldKit will only handle timezone offsets, specified numerically. Any items without a timestamp are given a timestamp of the current time.
Ending Events
In experimental phase, worldKit can also "end events". Events that have concluded relative to the time slider control will be hidden. To set the end time of an event, we are currently supporting the
RSS Event Module. As Calendar and Event formats are in flux, a different format may be preferred later on.
The elements are
<ev:startdate> and
<ev:enddate>. Declare the namespace with
xmlns:ev="http://purl.org/rss/1.0/modules/event/". In contrast to the Module Specification, worldKit will support times in either of the formats listed above.
<entry>
<title>An example Atom timestamped item</title>
<link href="http://example.com/geo"/>
<georss:point>26.58 -97.83</georss:point>
<ev:startdate>2003-12-13T08:29:29-04:00</ev:startdate>
<ev:enddate>2003-12-21T12:29:29-04:00</ev:enddate>
</entry>
Javascript API
Javascript API
It is possible for worldKit to respond to certain commands from Javascript, and for worldKit to send commands to Javascript. This allows for interesting integrations within web applications.
For Javascript-Flash communication in either direction, make sure that
swLiveConnect="true" is set in the
embed HTML tag.
It is highly recommended that applications needing Javascript communication use the latest worldKit and require Flash Player 8, as it fixes browser inconstencies.
Javascript to worldKit Communication
Javascript communicates with Flash by calling the
SetVariable function on worldKit embedded in the browser. "document.worldkit" refers to the "id" and "name" assigned in the
<object> and <embed> tags.
document.worldkit.SetVariable(Variable,Value);
These are variables worldKit monitors and responds to:
- JSubComm: Annotations categorized under the value of this variable will be activated.
- JLayComm: Annotations categorized under the value of this variable will be switched from visible to invisible, or vice versa.
- JActComm: Annotations categorized under the value of this variable will set to the color speicifed in <activatecolor>.
- JComm: The annotation assigned the id specified in the value of this variable will be activated..
- JItemActComm: The annotation assigned the id specified in the value of this variable will be set to the color specified in <activatecolor>.
- JLoadComm: Set the value to trigger worldKit to load an RSS feed. Pass "dataurl" or "updateurl" to load feeds specified in the config.xml. Pass "clear" to remove all the current annotations. Or alternatively, pass a url to load an arbitrary RSS feed.
- JRSSComm: Set the value to a string containing RSS. worldKit will parse this RSS string, and display any annotations.
- JZoomComm: Set the value to a location and zoom level, and worldKit will zoom and pan to that location. The format is "lat,lon,zoomlevel".
- JInputComm: Set to "true" to turn on Input-Only Mode. Set to "false" to switch off.
- JNavmodeComm: Set the value to "zoomselect" to activate the red selection box tool, and to "grabber" to activate the click and drag tool.
- JGetItemComm: The annotation assigned the id specified in the value of this variable will pass its contents, each field seperated by "||", through the URL or Javascript function specified in <annotateurl>.
- JGetExtentComm: Pass the name of a javascript function, which will be called with the current extent of the map view, similar to "onzoompan" below.
For example, here are snippets of Javascript and HTML using "JSubComm" and "JLayComm" that create a checkbox to switch "layers" on and off, in a GIS style, and a link to activate a category of points.
<script>
function activate(args) {
document.worldkit.SetVariable("JSubComm",args);
}
function layerSwitch(args) {
document.worldkit.SetVariable("JLayComm",args);
}
</script>
<input type="checkbox" name="restaurant" checked onMouseUp="javascript:layerSwitch('restaurant')">
<a href="javascript:activate('restaurant')"><font color="#FFFF44">Restaurants</font></a>
worldKit to Javascript Communication
User clicks on annotations, or clicks in annotation-input mode, can trigger Javascript code, rather than opening a URL. Javascript callbacks can also be set for zoom/pan, new RSS items, or RSS items expired by "fading". This is useful for filling out forms, loading pictures, etc. without reloading the browser, or precisely controlling the parameters of a new window, or many other tight integrations with web applications.
In each case, worldKit will call a specified function with one argument, args, a string containing kay/value pairs URI encoded.
- To enable Javascript for user clicks on annotations, set <window> to "_javascript:", followed by the name of a callback function. args containts the "lat" and "long" of the click.
- To enable Javascript for Input Mode, set <annotateurl> to "javascript:" followed by the name of a callback function. It returns the "lat", "long", "id", and "link" of the annotation.
- To set a callback for zoom/pan events, set <onzoompan> to "javascript:" followed by the name of a callback function. args contains only the W,S,E,N "extent" of the current view.
- Set <newitemcallback> to "javascript:" followed by the name of a callback function, to receive notification of new RSS items. It returns the "title", "url", "summary", "lat", "lon", and "id" of the annotation.
- Set <fadeditemcallback> to "javascript:" followed by the name of a calllback function, to receive notification of "faded" RSS items. It returns only the "id" of the annotation.
The example code below demonstrates how to receive (myCallback) and parse (parseArgs) messages from worldKit. In the config.xml,
<window> would be set to "_javascript:myCallback".
<script language="Javascript">
function parseArgs(args) {
var AO = new Object();
var AA = args.split("&");
var TA = new Array();
for (var i=0; i<AA.length; i++) {
TA = AA[ i ].split("=");
AO[ TA[0] ] = unescape( TA[1] );
}
return AO;
}
function myCallback(args) {
var ArgObject = parseArgs(args);
//do what you will...
alert (ArgObject["lat"] + "," + ArgObject["long"]);
}
</script>
Annotation Input
Annotation Input
worldKit can be used as an input device. A user can click on the map, and worldKit will open a url, appended with the latitude and longitude of the clicked location. With the lat/long, your CGI can add an annotation to the map, or perform other functions like searching a database.
The map must be active and accepting keyboard input, by a mouse click. A user enters into Input Mode by typing the "i" key. All present annotations will be hidden and the cursor replaced by a crosshair icon. Leave Input Mode by typing "i" again. Within Input Mode, a click on a location trigger input.
Alternately, with the configuration option
<inputonly> set to "true", the map will always be in Input Mode.
Set the url with the configuration option
<annotateurl>. Clicks open this url appended with
"&lat=[LAT]&long=[LONG]&zoom=[ZOOM]&extent=[EXTENT]". extent is the west,south,east,north extent of the current map view. If you want to have Javascript handle the click,
read here.
If the configuration option
<locupdate> is set to "true", worldKit will call the annotation url, with the current center position, any time the map is moved. This can be used with a javascript handler to provide constant updates on the map location.
Note: during Input Mode, the red selection box for zooming (<zoomselect>) will not function.
GeoWiki
GeoWiki
The worldKit GeoWiki a complete application ready to
download, install and use on your server. It is a publicly editable map. Annotations are made directly in the map, can be assigned tags that are displayed as a weighted list, with all submissions and updates data handled in the background with Ajax. There is a working example
here
Unpack the files from the download, and place them in a single directory on your webserver. Make sure the files "rss.xml, tags, tags.count" are all writable. Load the url for this directory in your browser, and it's ready to go.
The app can be customized just like any worldKit map. Choose base map imagery, different extents, etc. It can be used as a guideline for other projects, a working tutorial. This has just be released, so there may be some rough spots. Please feel free to
send feedback.
Files Overview
- config.xml, day.jpg, index.php, worldkit.swf: These are like the usual files included in worldKit.
- rss.xml, tags, tags.count: These files will be handled by the app. If you do edit rss.xml, make sure to leave at least one <item/> tag; the annotate script is very simple and requires it.
- geowiki.css, geowiki.js, xml.gif: Some support files. geowiki.js contains the logic for interaction between the browser and worldKit, and the browser and server.
- annotate.rs.php, gettags.rs.php: These are the server routines called from Javascript. annotate.rs.php receives annotation submissions, and rebuilds rss.xml and the tag files. gettags.rs.php returns the contents of the tag box after an update.
- jsrsClient.js, jsrsServer.php.inc: Javscript Remote Scripting is one of the granddaddy "Ajax" toolkits. I've been using it for a few years. It's simple and widely compatible.
Layers
WMS
worldKit supports WMS. WMS is a protocol for supplying a large amount of map imagery over the web; for instance, worldwide satellite coverage.
To set up WMS in worldKit, take the URL of a WMS request and remove the "width" "height" and "bbox" parameters. Set the value of the
<wms> config option to this modified url. A unique
"id" attribute is also required. A
"category" attribute is optional, and can be used to set the visibility of the WMS layer.
"width" and
"height" attributes optionally set the size of requested tiles; by default they are the size of the map.
"maxtiledeg" sets the degrees of longitude per tile, at the highest level; it's used mainly by OnEarth (below) and by default is 360.
"minview" and
"maxview" attributes optionally set the scale range where the WMS is visible.
Recommended OnEarth configuration listed in the
next section. Some other WMS sources are listed
here. Example configuration is below.
<wms id="landsat">
http://onearth.jpl.nasa.gov/wms.cgi?request=GetMap&layers=modis,global_mosaic&styles=&srs=EPSG:4326&format=image/jpeg
</wms>
wms can result in many simultaneous image requests. <maximgload> sets the maximum number of images downloading at one time. The default is 10. If exceeded, zoom and pan is frozen until the download count drops below this limit.
OnEarth Optimized WMS
OnEarth is a publicly accessible WMS hosted by NASA, serving high resolution (15m/pixel) imagery produced from the Landsat7 satellite. OnEarth also serves Blue Marble Next Generation, daily snapshots from MODIS satellites, and SRTM topography.
OnEarth is an incredibly valuable resource for open and free web mapping. An optimized tile cache of OnEarth imagery has been assembled, and with proper configuration, worldKit can access this high speed cache. The results are, well, awesome! If global imagery required, the recommendation is to use one of the options below. Do not modify your configuration from the ones seen here -- OnEarth will be overloaded unnecessarily and can potentially result in service disruptions.
First, for
Global Landsat Imagery in Pseudocolor..
<wms maxtiledeg="256" width="512" height="512" id="WMSGM"> http://wms.jpl.nasa.gov/wms.cgi?request=GetMap&layers=global_mosaic&srs=EPSG:4326&format=image/jpeg&styles=</wms>
<maxscale>8192</maxscale>
For the same in the
visual spectrum..
<wms maxtiledeg="256" width="512" height="512" id="WMSGM"> http://wms.jpl.nasa.gov/wms.cgi?request=GetMap&layers=global_mosaic&srs=EPSG:4326&format=image/jpeg&styles=visual</wms>
<maxscale>8192</maxscale>
Blue Marble Next Generation is a beautiful, cloud free, 500 meter/pixel imagery set.
<wms maxtiledeg="256" width="480" height="480" id="BMNG"> http://wms.jpl.nasa.gov/wms.cgi?request=GetMap&layers=BMNG&srs=EPSG:4326&format=image/jpeg&styles=
</wms>
<maxscale>256</maxscale>
Blue Marble imagery is available for each month of the year; simply add the month to the styles argument of the WMS url. [Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec]
<wms maxtiledeg="256" width="480" height="480" id="BMNG"> http://wms.jpl.nasa.gov/wms.cgi?request=GetMap&layers=BMNG&srs=EPSG:4326&format=image/jpeg&styles=Jan
</wms>
<maxscale>256</maxscale>
MODIS Rapid Response provides rapid access to daily updates of 250m satellite imagery. This distribution has proved valuable for accessing active fire information, and other natural hazards like hurricanes.
There are two satellites with the MODIS instruments, Aqua and Terra. A number of mapping products are available.
- daily_aqua and daily_terra are visual color composites.
- daily_aqua_721 and daily_terra_721 highlight recently burnt areas, and flooded areas.
- daily_aqua_ndvi and daily_terra_ndvia is strongly correlated with the density and state of vegetation.
Replace the "layers" argument in the config settings below with the mapping option you prefer.
<wms maxtiledeg="256" width="512" height="512" id="daily_aqua">
http://wms.jpl.nasa.gov/wms.cgi?request=GetMap&layers=daily_aqua&srs=EPSG:4326&format=image/jpeg&styles=
</wms>
<maxscale>512</maxscale>
TileMap
Tiling schemes for map data sources is a
hot topic among open source geo developers. Tiling speeds up access to WMS and other sources dramatically. worldKit already supports tiling schemes for OnEarth, as
above.
Tile Map Service is a specification under active development, and worldKit now supports the
global geodetic profile. A demo is posted
here.
Configure a TMS with <tilemap>. An "id" attribute, unique to all configured layers & WMS servers, is required. "global_profile" currently must be set to "1". The value of the option is a URL of a TMS server.
<tilemap id="test" global_profile="1">http://mapserver.refractions.net/cgi-bin/tms/1.0.0/global_mosaic/</tilemap>
Layers
To overlay semi-transparent (or any) images on top of the base map, and below annotations, use the
swflayer tag in the config.xml file. The value of this tag is a relative or absolute url of a swf, png, gif or jpeg file. Conversion utilities and software such as Adobe Illustrator, and Flash of course, can output swf files.
A swf layer must be assigned "id", "width", and "height" attributes. The "id" must be unique among all the swflayers, and is used to switch a layer's visibility in the
Javascript API JLayComm variable. To import multiple layers, use a single swflayer tag for each. The width and height of the swf file must be passed as attributes to the tag (due to limitations in Flash).
Optional attributes control where and how the layer is displayed.
- "extent": An west,south,east,north bounding box specifying the spatial extent of the layer. It can cover a smaller, larger, or partial area relative to the bounding box of the entire map. By default, the extent is assumed to be the same as the base map.
- "minscale": The minimum zoom level at which the layer is visible. By default it's 1 (ie zoomed all the way out).
- "maxscale": The maximum zoom level at which the layer is visible. By default it's set to the <maxzoom> of the map.
- "category": Assign a Category to a swflayer, and control its visibility at startup and through Javascript.
- "preload": Set to "false" and this layer will load only when it's visible. Default is true.
- "mask": Some swf files may extend over the boundaries of the Stage. Set to "true", and only the area covered by "width" and "height" will be visible. Default is false.
For example...
<swflayer id="road" width="400" height="200">highways.swf</swflayer>
<swflayer id="bikepath" width="750" height="375" extent="-122.45,37.6,-122.42,37.98" minscale="4" maxscale="32" category="sustainable" preload="false">bikepath.jpg</swflayer>
Templates
Templates can be configured, so that under defined regions and scales of the map, an image is requested from a mapping server covering the current viewing area This is basically what supports WMS; Templates allow finer grain control of this feature.
Each swftemplate divides a region into a number of equal sized tiles. As the map is panned and zoomed, each swftemplate is checked to see if a new swflayer should be requested and displayed. The value of
<swftemplate> is the url of a WMS cgi, with the values of the bounding box replaced by "WEST,SOUTH,EAST,NORTH", or a center point with "LAT,LON". All attributes are required, except "category".
- "id": Unique identifier.
- "minscale": The minimum zoom level at which a request is made.
- "maxscale": The maximum zoom level at which a request is made.
- "minview": The minimum zoom level at which the layer is visibile.
- "maxview": The maximum zoom level at which the layer is visible.
- "extent": The east,south,west,north bounding box covered by the entire template.
- "tilewidth": Width of a requested tile.
- "tileheight": Height of a requested tile.
- "spanx": The number of tiles covering the x-axis spread of the region.
- "spany": The number of tiles covering the y-axis spread of the region.
- "category": For categorization and Javascript interaction.
For example, the following swftemplate uses the
OnEarth Landsat WMS. It covers the entire globe, in 2x2 tiles, at zoom levels 1 and greater. In practice, remove linebreaks from the value of this option.
<swftemplate category="landsat" id="landsat" tilewidth="376" tileheight="188" extent="-180,-90,180,90" spanx="2" spany="2" minview="1" maxview="50000" minscale="1" maxscale="2">
http://onearth.jpl.nasa.gov/wms.cgi?request=GetMap&width=376&height=188&layers=modis,global_mosaic
&styles=&srs=EPSG:4326&format=image/jpeg&bbox=WEST,SOUTH,EAST,NORTH</swftemplate>
swftemplate can result in many simultaneous image requests. <maximgload> sets the maximum number of images downloading at one time. If exceeded, zoom and pan is frozen until the download count drops below this limit.
GPX
GPX
worldKit has some support for mapping GPS tracklogs, via GPX. GPX is an XML interchange format for GPS data, and many desktop programs that interface with GPS units can output this format.
gpsbabel is a free utility for reading many types of GPS, and writing out GPX, and is available for many OS. openstreetmap.org has a decent
tutorial on using gpsbabel.
At this point, worldKit has support to draw a single tracklog from any one GPX file. Fuller support of the spec should follow in the future.
To specify a GPX tracklog, use the
<gpx> config option. A unique id string must be specified in an
id attribute. The value of this tag is a url for accessing the GPX file. Multiple files can be specified.
<gpx id="gpx1">hike.gpx</gpx>
<gpx id="gpx2">bike.gpx</gpx>
GPX tracklogs are
categorizeable with the optional
"category" attribute, and respect the
style values of <linealpha>, <linecolor>, and <linethickness>.
Dynamic Options
Dynamic Options
There may be scenarios when configuration options are dynamic; for example. if visualizing the results of a search query. In this situation, parameters can be passed into worldKit from the HTML, or the entire config.xml can be dynamically generated.
Most config options can be passed through HTML, rather than the config.xml. Options are specified as HTTP GET arguments on the two worldkit.swf references. The value of the options must be URL encoded.
Categorized options can be dynamically set in this format: option:catgeory=value. For example, "plotsize:metro=20" would set the plotsize for annotations categorized with "metro" to 20.
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="800" HEIGHT="400" id="worldkit">
<param NAME=movie VALUE="worldkit.swf?dataurl=%2fsearch.php%3Dgeo%2Bcrazy">
<param NAME=quality VALUE="high">
<param NAME=bgcolor VALUE="#000000">
<embed src="worldkit.swf?dataurl=%2fsearch.php%3Dgeo%2Bcrazy" quality="high" bgcolor="#000000" WIDTH="800" HEIGHT="400" NAME="worldkit" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">
</embed>
</object>
To have worldKit request another url for config.xml, simply pass
"confurl=[URL]" as above. That url can be a dynamically generated file.
If confurl is set to NULL ("confurl="), then no config.xml is requested and all settings are taken as defaults or through dynamic options.
Flash Component
Flash Component
worldKit can be used as a "Component" in your Flash movies. It can be loaded into a movie from Actionscript, positioned and controlled, almost but not quite as a full component.
This feature is Beta. We have received some reports of sluggish performance. Investigating.
worldKit will function as usual: requesting config.xml, images, and rss, and building a map, all within your Flash application. The only modification necessary to the config is to set
<ascomponent>true</ascomponent>. To include worldKit in your movie, create an empty movie clip then load worldkit.swf. For example..
_root.createEmptyMovieClip("wk",1);
_root["wk"].loadMovie("worldkit.swf");
Note you can pass in
dynamic parameters, in the same ways as for HTML.
You can then position worldKit, or set visibility, etc. But do not set the _width or _height, or _xscale or _yscale; these are still set in config.xml.
_root["wk"]._x = 100;
_root["wk"]._y = 100;
You can control any aspect of worldKit accessible via the
Javascript API, by setting those variables directly in _root.
_root.JZoomComm = "50,0,250"; //zoom to lat=50, long=0, zoom=250;
Changes from older worldKit
Changes from older worldKit
If you are a current user of worldKit, there are a few changes you should be aware of. worldKit is always designed to be as backwards compatible as possible, but in certain cases it's unavoidable.
To determine the your version of worldKit, press
"v" and the number will be displayed. If nothing happens, then you can assume it's pre-2.0 :).
Version 3.1, December 29, 2006
Flash Player 8 is now required.
Version 2.0, March 28, 2005
worldKit to Javascript communication has changed, and this version is not compatible with past implementations. With these changes, javascript communication is now supported on more platforms and browsers; and it should be clearer to implement.
February 3, 2005
swflayer now requires an "id" attribute.
January 27, 2005
Interaction in Input Mode has changed slightly. Typing "i" will toggle Input Mode on or off. Previously, holding "i" enabled Input Mode, and releasing "i" left Input Mode.
January 5, 2005
The recommended namespace for geotags in RSS is now "geo", changed from "icbm" (http://postneo.com/icbm/). The "icbm" tag is still supported, and your feeds will work without change.
The size of points, text, and photos is now accurate. Due to a bug, these sizes were previously skewed. So, if you update worldKit, you may need to make adjustments to the size parameters in config.xml.
If you were a beta user of the Zoomify features, the config option to specify the Zoomify install directory is now
<zoomifydir>.
<dayimg> will no longer work.
If you were a beta user of the Annotation features, longitude is now passed in vairable "long", rather than "lon".
This is an alphabetical index of configuration options, with links to more information throughout the manual.
<activatecolor>
A hex color value. Annotations will change to this color when activated by the JActComm Javascript API. This value is categorizeable. The default value is "0xFF0000".
More detail in: Style. Categories
<annotateurl>
Map clicks, in annotation mode, will open this url appended with the latitude and longitude of the point. The coordinates will be passed as GET arguments "lat" and "long". Javascript can be called by setting this to "javascript".
More detail in: Annotation Input. Weblogs and worldKit Javascript
<ascomponent>
Set this to "true" when using worldKit as a Flash Component. Default is "false".
More detail in: Flash Component
<controlalpha>
A numeric value, 0-100, specifying the degree of transparency of the Control Bar. 0 is invisible, 100 fully visible. Default value is 70.
More detail in: Zoom and Pan. Zoomify for Images
<controlscale>
A numeric value specifying the scale of the Control Bar. Default value is 100.
More detail in: Zoom and Pan. Zoomify for Images
<dataurl>
This url specifies the location of the RSS file containing annotations. If set to NULL, no RSS is requested. Default value is "rss.xml".
More detail in: Configuring RSS
<dayimg>
Relative or absoulte url for the location of the base image. If set to blank, no image is loaded. Default value is "day.jpg".
More detail in: Configuring Images
<displaytype>
The type of display for the base image. "day" simply displays the image. "daynight" masks the base images for the current solar illumination of the earth. "polar" plots annoation in polar coordinates. "zoomify" is for an image processed with Zoomify.
More detail in: Configuring Images
<east>
A float value, -180 to 180, specifying the eastern bounds of the map. Default value is 180.
More detail in: Configuring Images
<enddate>
The latest date for the time navigation control. This value must be specified if <timenav> is "true".
More detail in: Time Navigation
<fade>
Specifies a number of seconds for an annotation to fade to transparent. Useful for visualizing transient information. The default value is "-1", which means to fade.
More detail in: Window/Timing
<fadeditemcallback>
To set a callback to receive notification of "faded" RSS items, set the value to "javascript:" followed by the name of a callback function. By default, no function is called.
More detail in: worldKit -> JS
<fillalpha>
A numeric value, 0-100, specifying the degree of transparency of fill in point and polygon annotations. "0" is invisible, "100" is full visible. The default value is "100".
More detail in: Style. Lines & Polygons. Categories
<grabber>
Set to "true" to enable click and drag Pan. By default it is enabled.
More detail in: Zoom and Pan.
<height>
A numeric value specifying the height of the map within the HTML page. This value must match the HTML value.
More detail in: Configuration Basics
<icon>
This url specifies an image for annotation points. It is categorizable.
More detail in: Icons. Categories
<initiallat>
On startup, the map will be panned to center on this latitude. By default, it is midway between north and south.
More detail in: Zoom and Pan
<initiallong>
On startup, the map will be panned to center on this longitude. By default, it is midway between east and west.
More detail in: Zoom and Pan
<initialplotcolor>
A hex color value. New annotation points will be displayed in this color for 60 seconds. This value is categorizable. Default value is 0xFF0000 (red).
More detail in: Style. Lines & Polygons. Categories
<initialzoom>
A numeric value, 1 or greater, specifying the magnitude of the zoom on startup. Default value is 1.
More detail in: Zoom and Pan
<inputonly>
Set to "true", the map will always be in Input Mode. Default value is "false".
More detail in: Annotation Input
<linealpha>
A numeric value, 0-100, specifying the degree of transparency of lines in points, tracks, line and polygon annotations. "0" is invisible, "100" is full visible. The default value is "70".
More detail in: Style. Lines & Polygons. Categories
<linecolor>
A hex color value. Tracks, point and polygon borders and lines will be displayed in this color. It is categorizable. The default value is "0x000000" (black).
More detail in: Style. Lines & Polygons. Categories
<linethickness>
A numeric value, specifying the thickness of lines in points, tracks, line and polygon annotations. The default value is "0".
More detail in: Style. Lines & Polygons. Categories
<loadimgmsg>
Specify a string for display while images are loading. Must set <showload> to "true" for this to be effective. Default value is "Loading Images..."
More detail in: Window/Timing
<loadrssmsg>
Specify a string for display while RSS is loading. Must set <showload> to "true" for this to be effective. Default value is "Loading Points..."
More detail in: Window/Timing
<locfield>
Set value to the name of the RSS tag to look for annotations. Values accepted are "description", "summary", "category", "dc:suject", or "any" (all four fields will be examined). By default, this option is not set, and no tags are examined.
More detail in: RSS. Typepad and Blogger
<locupdate>
If set to "true", the annotation url, with the current center position, will be called any time the map is moved. Default value is "false".
More detail in: Annotation Input. Javascript
<maximgload>
A numeric value specifying the maximum the number of images to load simultaneously. Default value is "10".
More detail in: Templates/WMS
<maxscale>
A numeric value, 1 or greater, specifying the maximum zoom permissible. Default value is 64.
More detail in: Zoom and Pan
<maxzoom>
If set to "true", the map will zoom and pan to the a bounding box surrounding just the area where annotations are present. Default value is "false".
More detail in: Zoom and Pan
<newitemcallback>
To set a callback to receive notification of new RSS items, set the value to "javascript:" followed by the name of a callback function. By default, no function is called.
More detail in: worldKit -> JS
<nightimg>
Relative or absolute url for the location of the night image, in "daynight" displaytype mode. Default value is "night.jpg".
More detail in: Configuring Images
<north>
A float value, -90 to 90, specifying the northern bounds of the map. Default value is 90.
More detail in: Configuring Images
<onzoompan>
To set a callback for zoom, pan events set the value to "javascript:" followed by the name of a callback function. By default, no function is called.
More detail in: worldKit -> JS
<panc>
A numeric value controlling the speed when panning across the map. Higher values correspond to slower panning. The default value is 16.
More detail in: Zoom and Pan
<plotinterval>
A numeric value specifying the number of seconds between successive annoations. A value of 0 will result in all annotations displayed at the same time. Default value is 5.
More detail in: Window/Timing
<plotshape>
The shape of the annotation point. Accepted values are "square", "circle", and "triangle". This value is categorizable. Default value is "square".
More detail in: Sizes and Colors. Categories
<plotsize>
A numeric value specifying the size of the annotation point. This value is categorizable. Default value is 3.
More detail in: Sizes and Colors. Categories
<polarimg>
Relative or absolute url for the location of the base image in "polar" displaytype mode. Default value is "polar.jpg".
More detail in: Configuring Images
<restingplotcolor>
A hex color value. Annotation points will be displayed in this color after 60 seconds. Set to the same value as "initialplotcolor" if you don't want the change. This value is categorizable. Default value is 0x00FFFF (cyan).
More detail in: Sizes and Colors. Lines & Polygons. Categories
<rssbbox>
Set to "true", the bounding box of the current view is appended to the RSS feed url. This is useful for displaying only part of a large data set. Default value is "false.
More detail in: Configuring RSS
<showload>
Set to "true" to display messages while images and RSS are loading. Default value is "false".
More detail in: Window/Timing
<showonlynew>
When set to "true", only annotations present in the last RSS update will be displayed. Default value is "false".
More detail in: Configuring RSS
<singletextfield>
When set to "true", text is displayed at the top of the map, rather than adjacent to the annotation. The default value is "false".
More detail in: Sizes and Colors
<south>
A float value, -90 to 90, specifying the northern bounds of the map. Default value is -90.
More detail in: Configuring Images
<startdate>
The earliest date for the time navigation control. This value must be specified if <timenav> is "true".
More detail in: Time Navigation
<swflayer>
Specifies the relative or absoulte url of semi-transparent swf files, to be overlayed on the base image. The dimensions of the swf must be specified in "width" and "height" attributes, and a unique identifier must be assigned in the "id" attribute. Other attributes described further on the detailed page.
More detail in: Layers
<swftemplate>
Templates can be configured , so that under defined regions and scales of the map, an image is requested from a mapping server covering the current viewing area. It provides more fine grained control than <wms>. Read more in the details.
More detail in: Templates/WMS
<textboxsize>
The width, in pixels, of the text box visible after a point is activated. Default value is 200.
More detail in: Sizes and Colors
<textinterval>
The time, in seconds, which the text box is visible after a point is first displayed. Default value is 5.
More detail in: Window/Timing
<textsize>
The size, in pixels, of text visible after a point is activated. Default value is 10.
More detail in: Sizes and Colors
<tilemap>
Tile Map Server is a scheme for more efficiently serving WMS requests. Read more in the details.
More detail in: Templates/WMS
<timenav>
Set to true to enable time navigation. Default value is "false".
More detail in: Time Navigation
<timenavpos>
The preset position of time navigation. This value must be between 0 and the value of <timenavunit>. Default value is "0".
More detail in: Time Navigation
<timenavunit>
The number of steps between the start and end, on the navigation control. Default value is "200".
More detail in: Time Navigation
<toolbar>
Set to "true" to display the Control Bar. In Zoomify mode, default is "true", otherwise default is "false".
More detail in: Zoom and Pan. Zoomify for Images
<track>
Set to "true" to display lines between successive annotations, as in a GPS track log. Default value is "false".
More detail in: Sizes and Colors
<trackcats>
Set to "true" to display lines between successive annotations assigned to the same category. <track> must also be set to "true". Default value is "false".
More detail in: Categories and Tracks
<uniqueurls>
Set to "true" to insure RSS requests are unique and avoid hitting the cache. The current timestamp will be appended to the url. Default value is "false".
More detail in: Configuring RSS
<update>
The time, in seconds, between retrievals of the RSS feed. If set to 0, the RSS is retrieved only once. Default value is 60.
More detail in: Configuring RSS
<updateurl>
This url specifies the location of the RSS feed retrieved repeatedly after the first RSS feed in dataurl is retrieved. By default, this value is the same as dataurl.
More detail in: Configuring RSS
<visible>
Set to "false" and annotations will be invisible on load. They can be made visible via Javascript. Default value is "true".
More detail in: Sizes and Colors. Javascript. Categories
<visinterval>
The time, in seconds, which the text box is visible after a point is activated. Default value is 5.
More detail in: Window/Timing
<west>
A float value, -180 to 180, specifying the western bounds of the map. Default value is -180.
More detail in: Configuring Images
<width>
A numeric value specifying the width of the map within the HTML page. This value must match the HTML value.
More detail in: Configuration Basics
<window>
Specifies the name of the window links are opened in. Javascript is called by setting the value "_javascript". It is categorizable. Default value is "_blank" (a new window).
More detail in: Window/Timing. Javascript Categories
<wms>
WMS is a protocol for supplying a large amount of map imagery over the web; for instance, worldwide satellite coverage. Read more in the details.
More detail in: Templates/WMS
<zlevel>
Set to "-1" to plot newer annotations below older ones. Default value is "1", meaning newer annotations are positioned above older ones.
More detail in: Window/Timing
<zoomc>
A float value, greater than 1, controlling the speed of zoom in and out of the map. Higher values correspond to faster zoom. Default value is 1.5.
More detail in: Zoom and Pan
<zoomifydir>
Absolute or relative url specifying the directory where a Zoomify processed image is located. Default value is "." (the same directory as the HTML loading worldKit.
More detail in: Zoomify for Images
<zoomifynav>
Set to "false" to suppress the display of the Zoomify Navigation Box in the upper left corner. Default value is "true".
More detail in: Zoomify for Images
<zoomselect>
Set to "true" to to enable Zoom and Pan by drawing a red selection box on the map. Default value is "false".
More detail in: Zoom and Pan
<zoomto>
If set to a numeric value, annotation clicks will zoom to the level specified, centered on the annotation, rather than opening a url. Default value is undefined.
More detail in: Zoom and Pan. Categories. Lines & Polygons