This gadget allows users to monitor the City of Portland, Oregon's Police 911 Dispatch Incidents on a Google Maps backdrop by subscribing to the geoRSS feed of the 100 most recent, closed, non-confidential calls for service received by the City of Portland's 911 system.
The incidents are shown as clickable and color coded icons with tool tips. Incidents that happened an hour or less ago will be fully opaque; at more than an hour but less than three hours, the icons will be displayed at 50% opacity; at greater than three hours, the icons will be shown at 25% opacity.
Leave the gadget on the screen and it will update itself every few minutes with the latest information. Clicking on the icon will bring up more details about the incident. Together with Google Street View, users can truly immerse themselves into the incident environment
Showing posts with label Mashup. Show all posts
Showing posts with label Mashup. Show all posts
Monday, July 8, 2013
Monday, December 26, 2011
Google Gadget for monitoring crime incidents in Malaysia
This is a Google Gadget for monitoring crime incidents in Malaysia; the incidents are posted by users of www.malaysiacrime.com. The gadget works by subscribing to the georss feed of www.malaysiacrime.com site and displaying the incidents over a Google Maps backdrop. The crime incidents are icons color coded according to the categories - general, rempit, gun, parang, rape, and murder. There is also a list view which can be used to sort the crime incidents according to the date and time. Clicking on the icon will bring up more details about the crime incident.
Monday, July 18, 2011
Google Gadget for monitoring UK earthquakes
This gadget will allow you to subscribe to the British Geological Survey (BGS)'s recent UK earthquake GeoRSS feed. It shows the latest earthquakes as color coded (by depth and age) icons with tool tips on a Google Maps backdrop - the older the earthquake, the more transparent the icon will look.
The gadget has a list tab which displays the earthquake information as a text list with hyperlinks for more details - the list can be sorted by the earthquake magnitude, depth as well as the date-time. Using the list, you can easily find and locate the largest, the latest or the deepest earthquakes.
You can leave this gadget on the screen and it will update itself as it receives the latest feed. Upon receiving the data, it will automatically zoom to the latest earthquake epicenter. Clicking on an earthquake icon will bring up more information about the earthquake from the BGS site.
Monday, November 22, 2010
Monitor New Zealand Earthquakes with this Google Gadget
This gadget will allow you to subscribe to the New Zealand GeoNet real-time earthquake rss feed. It shows the latest earthquakes as color coded (by depth and age) icons with tool tips on a Google Maps backdrop - the older the earthquake, the more transparent the icon will look.
The gadget has a list tab which displays the earthquake information as a text list with hyperlinks for more details - the list can be sorted by the earthquake magnitude, depth as well as the date-time. Using the list, you can easily find and locate the largest, the latest or the deepest earthquakes.
You can leave this gadget on the screen and it will update itself as it receives the latest feed. Upon receiving the data, it will automatically zoom to the latest earthquake epicenter. Clicking on an earthquake icon will bring up more information about the earthquake from the GeoNet site.
Monday, November 15, 2010
A Google Gadget for monitoring natural disasters
You can use this gadget to monitor natural disasters around the world
as published by the Global Disaster Alert and Coordination System
(http://www.gdacs.org).
It shows the latest natural disasters like earthquakes, volcano eruptions, tropical cyclones, and floods as color coded icons with tool tips on a Google Maps backdrop; the icon colors indicate the alert level - green, orange, and red. The icon will look more transparent the older the event was published.
There is also a list view which can be used to sort the natural disaster events according to the date/time, region, and disaster type. Clicking on the icon will bring up more details about the disaster event.
It shows the latest natural disasters like earthquakes, volcano eruptions, tropical cyclones, and floods as color coded icons with tool tips on a Google Maps backdrop; the icon colors indicate the alert level - green, orange, and red. The icon will look more transparent the older the event was published.
There is also a list view which can be used to sort the natural disaster events according to the date/time, region, and disaster type. Clicking on the icon will bring up more details about the disaster event.
Monday, October 25, 2010
Google Gadget for monitoring earthquakes (EMSC source)
This gadget will allow you to subscribe to the European-Mediterranean Seismological Center (EMSC) real-time, worldwide earthquake rss feed. It shows the latest 50 earthquakes as color coded (by depth and age) icons with tool tips on a Google Maps backdrop - the older the earthquake, the more transparent the icon will look.
The gadget has a list tab which displays the earthquake information as a text list with hyperlinks for more details - the list can be sorted by the earthquake magnitude, depth as well as the date-time. Using the list, you can easily find and locate the largest, the latest or the deepest earthquakes for the past day.
You can leave this gadget on the screen and it will update itself as it receives the latest feed. Upon receiving the data, it will automatically zoom to the latest earthquake epicenter. Clicking on an earthquake icon will bring up more information about the earthquake from the EMSC site.
The gadget has a list tab which displays the earthquake information as a text list with hyperlinks for more details - the list can be sorted by the earthquake magnitude, depth as well as the date-time. Using the list, you can easily find and locate the largest, the latest or the deepest earthquakes for the past day.
You can leave this gadget on the screen and it will update itself as it receives the latest feed. Upon receiving the data, it will automatically zoom to the latest earthquake epicenter. Clicking on an earthquake icon will bring up more information about the earthquake from the EMSC site.
Monday, September 27, 2010
Google Gadget for monitoring earthquakes (USGS source)
This gadget will allow you to subscribe to the US Geological Survey (USGS) real-time, worldwide earthquake list. It shows the latest magnitude 1 and above earthquakes for the past day as color coded (by depth and age) icons with tool tips on a Google Maps backdrop - the older the earthquake, the more translucent the icon will look.
The gadget has a list tab which displays the earthquake information as a text list with hyperlinks for more details - the list can be sorted by the earthquake magnitude, depth as well as the date-time. Using the list, you can easily find and locate the largest, the latest or the deepest earthquakes for the past day.
You can leave this gadget on the screen and it will update itself as it receives the latest feed. Upon receiving the data, it will automatically zoom to the latest earthquake epicenter. Clicking on an earthquake icon will bring up more information about the earthquake from the USGS site.
The gadget has a list tab which displays the earthquake information as a text list with hyperlinks for more details - the list can be sorted by the earthquake magnitude, depth as well as the date-time. Using the list, you can easily find and locate the largest, the latest or the deepest earthquakes for the past day.
You can leave this gadget on the screen and it will update itself as it receives the latest feed. Upon receiving the data, it will automatically zoom to the latest earthquake epicenter. Clicking on an earthquake icon will bring up more information about the earthquake from the USGS site.
Friday, April 30, 2010
Google Gadget for creating charts on Singapore's OneMap
The Singapore Land Authority (SLA) launched an alternative to Google Maps recently - called OneMap. It's built on ESRI's ArcGIS server and it comes with its OneMap Javascript API, which is essentially a wrapper around ESRI's API. This gives me a chance to work with ESRI's Javascript API and I decided to port the Charting Google Mapplet I wrote earlier to OneMap. The figure below is a screen shot of the gadget running in iGoogle's expanded Canvas mode.
This gadget will create pie charts on Singapore's OneMap from text files formatted as comma separated values (CSV). The CSV data must have a header row, SVY21 easting and northing columns to point to the locations to place the charts on. The charts created can be clicked on to show the values.
For IE8 users, please run in IE7 or IE8 compatibility mode as IE8 breaks OneMap.The figure below shows the problem of OneMap with Internet Explorer 8 on iGoogle. I am not able to determine the source of the problem but you can click IE's Page button and choose Compatibility View Settings to turn add google.com to the Compatibility View websties .
To run this gadget, click this link http://www.google.com/ig/adde?moduleurl=http://dominoc925-pages.appspot.com/gadgets/chart_onemap_ig.xml&source=imag.
This gadget will create pie charts on Singapore's OneMap from text files formatted as comma separated values (CSV). The CSV data must have a header row, SVY21 easting and northing columns to point to the locations to place the charts on. The charts created can be clicked on to show the values.
For IE8 users, please run in IE7 or IE8 compatibility mode as IE8 breaks OneMap.The figure below shows the problem of OneMap with Internet Explorer 8 on iGoogle. I am not able to determine the source of the problem but you can click IE's Page button and choose Compatibility View Settings to turn add google.com to the Compatibility View websties .
To run this gadget, click this link http://www.google.com/ig/adde?moduleurl=http://dominoc925-pages.appspot.com/gadgets/chart_onemap_ig.xml&source=imag.
Wednesday, April 7, 2010
How to create custom Google Maps Marker Tool Tips
The default Google Maps markers have mouse over tool tips but with the standard light yellow box. With some relatively simple Javascript code and cascading style sheet declarations, you can quickly create your own marker tool tips with a custom style. The basic steps are:
As shown below in the sample html code, define a style class (e.g. toolTip) for the tool tip so that the tool tip has a light yellow background with small text and a solid dark gray border.
Create the Tool TIp Child DIV Element
Traditionally, a Google Maps instance is placed on a web page through a DIV element in the HTML code. In this example, that element has an ID of "map". To show tool tips on this Google Maps instance, we need to create a child DIV element underneath it using Javascript.
Create the markers
Now create the markers and add them as overlays on the map. If you are using custom icons, the clickable property must be set to be true in order to trigger the mouse events.
Create and register the mouse event handlers
To show the tool tips as the mouse move over the markers, create and register the showToolTip function. Basically, this function simply shows the child tool tip DIV element. Also create and register the hideToolTip function, which just hides the child tool tip DIV element.
That's all there is to it.
- Declare a tool tip style.
- Create a child DIV element for the tool tip under the parent Google Maps DIV element.
- Create the markers and set the tool tip text property
- Show the tool tip DIV element when the mouse hovers over the marker
- Hide the tool tip DIV element when the mouse exits the marker
As shown below in the sample html code, define a style class (e.g. toolTip) for the tool tip so that the tool tip has a light yellow background with small text and a solid dark gray border.
<html>
<head>
<title>My first tool tip</title>
<style type="text/css">
.toolTip {
font-size: small;
background-color:#ffff71;
border:1px #7f7f7f solid;
}
</style>
</head>
<body>
<div id="map" style="height: 450px;" >
Loading...
</div>
</body>
</html>
Traditionally, a Google Maps instance is placed on a web page through a DIV element in the HTML code. In this example, that element has an ID of "map". To show tool tips on this Google Maps instance, we need to create a child DIV element underneath it using Javascript.
var map;
var toolTip;
var divToolTip = "toolTip";
var divMapId = "map";
var icon = new GIcon(G_DEFAULT_ICON);
var pnt = new GLatLng(1.3629,103.8263);
//Create a new Google Maps instance
map = new GMap2(document.getElementById(divMapId));
//create the child tool tip DIV element and hide it
toolTip = document.createElement(divToolTip);
document.getElementById(divMapId).appendChild(toolTip);
toolTip.style.visibility="hidden";
Create the markers
Now create the markers and add them as overlays on the map. If you are using custom icons, the clickable property must be set to be true in order to trigger the mouse events.
//Create the marker
var opt = {};
opt.icon = icon;
opt.draggable = false;
//clickable must be set to true to trigger the mouse events
opt.clickable = true;
opt.dragCrossMove = false;
var mkr = new GMarker (pnt, opt);
mkr.tooltip='<div class="toolTip">'+ 'My first tooltip' + '<\/div>';
map.addOverlay(mkr);
Create and register the mouse event handlers
To show the tool tips as the mouse move over the markers, create and register the showToolTip function. Basically, this function simply shows the child tool tip DIV element. Also create and register the hideToolTip function, which just hides the child tool tip DIV element.
//Register the marker event handlers
GEvent.addListener(mkr,"mouseover", function() {
showToolTip(mkr);
});
GEvent.addListener(mkr,"mouseout", function() {
hideToolTip();
});
//function to hide the tool tip
function hideToolTip () {
toolTip.style.visibility="hidden";
};
//function to show the tool tip
function showToolTip(marker) {
toolTip.innerHTML = marker.tooltip;
var point=map.getCurrentMapType().getProjection().fromLatLngToPixel(map.getBounds().getSouthWest(),map.getZoom());
var offset=map.getCurrentMapType().getProjection().fromLatLngToPixel(marker.getPoint(),map.getZoom());
var anchor=marker.getIcon().iconAnchor;
var width=marker.getIcon().iconSize.width;
var pos = new GControlPosition(G_ANCHOR_BOTTOM_LEFT, new GSize(offset.x - point.x - anchor.x + width,- offset.y + point.y +anchor.y));
pos.apply(toolTip);
toolTip.style.visibility="visible";
};
That's all there is to it.
Thursday, April 1, 2010
Singapore Weather Google Gadget
This embedded Google Gadget shows the current weather in Singapore on a Google Maps backdrop. You can leave this gadget on the screen and it will update itself with the latest weather information from the National Environment Agency (NEA) rss feed. The weather information is displayed as icons which will display tool tips of the location as you hover over the icons.
Tuesday, February 10, 2009
Javascript code to read GeoMedia WebMap 6.1 generated tiles
In my previous post, I talk about using GeoMedia WebMap 6.1 to pre-generate map tiles in png format for use in Google Maps. After you have created all the png map tiles, it will no longer be necessary to start up the GeoMedia WebMap service to serve the png map tiles to the Internet browser clients. All you need to do is to write your own web page and Javascript code to wrap the png map tiles into a custom Google Maps tile layer.

Assuming you have created the png map tiles in the following folder C:\WebMap Publisher Projects\mygooglemaps\tilecache\ and the files are all named in the following naming convention mygooglemaps_1_(zoom)_(x)_(y).png, as shown in the figure above, we can write the following Javascript code.
//If the tiles I have created have zoom levels ranging from 10 to 18 and the
//geographical area ranges from 103 deg E to 104 deg E and
//1 deg N to 2 deg N, then I can code in the constants as follows.
var minZoom = 10;
var maxZoom = 18;
var minLng = 103;
var maxLng = 104;
var minLat = 1;
var maxLat = 2 ;
var copyright;
var copyrights;
var tileLayer;
var tileLayers;
var custommap;
//Get a pointer to the Google Maps canvas area on the web page.
//The id is "map" in this example.
map = new GMap(document.getElementById("map"));
//Display the large zoom slider control
map.addControl(new GLargeMapControl());
//Create a new copyright within the data's geographical extents
copyright = new GCopyright ( 1,
new GLatLngBounds ( new GLatLng(minLng, minLat),new GLatLng(maxLng, maxLat)),
minZoom,
'Copyright 2009 dominoc');
copyrights = new GCopyrightCollection('dominoc Copyrights');
copyrights.addCopyright ( copyright);
//Create a new map tile layer that has the zoom levels of the png
//map tiles and copyrights
tileLayers = [ new GTileLayer (copyrights, minZoom, maxZoom)];
//Define the callback function for retrieving the png map tiles
tileLayers[0].getTileUrl = function ( tile, zoom) {
var url = "http://localhost/mygooglemaps/tilecache/mygooglemaps_1" + "_" + zoom + "_" + tile.x + "_" + tile.y + ".png";
return url;
};
tileLayers[0].isPng = function() { return true; }
tileLayers[0].getOpacity = function() { return 1.0; }
tileLayers[0].minResolution = function() { return minZoom; }
tileLayers[0].maxResolution = function() { return maxZoom; }
//Finally, create the new map type for the map tiles with
//the button named "dominoc" and display it.
//Display the message "No data available" where there are no
//tiles.
custommap = new GMapType ( tileLayers, new GMercatorProjection(maxZoom + 1), "dominoc", {errorMessage: "No data available"});
map.addMapType(custommap);
map.addControl(new GMapTypeControl());
A sample display of the result in shown in the screen shot below.

Monday, February 2, 2009
Generate Google Maps tiles with GeoMedia WebMap 6.1
You can use GeoMedia WebMap 6.1 to create Google Maps mashups map tiles with data from GeoMedia warehouses. The WebMap Publisher commands that come out of the box allow you to quickly publish a mashup site, all through easy to use graphical wizards. Although GeoMedia WebMap can dynamically generate the map tiles as users browse the mashup, it can be really slow for users, instead of the couple of seconds wait that they are accustomed to on the public Google Maps site. To improve the performance of the mashup site, there are a couple of things you can do: (a) pre-create the map tiles before hand and (b) group the legend entries. If you don't group the legend entries, each legend entry will have its own set of map tiles; so by grouping the legend entries into a single group, only a single set of map tiles will be generated per zoom scale.
GeoMedia WebMap version 6.1 has a couple of bugs which will give you with some grief. One of them is that the Publisher graphical commands are unable to group the legend entries eventhough there is an option for it on the graphical user interface. The other is that the batch tile generation script has some syntax errors. I have gone through that frustration and will be able to share the steps to actually generate the map tiles successfully in batch and as a group. The steps can be broken down into 3 major tasks: (a) Create a blank Publisher Web Application site, (b) Publish a GeoMedia Workspace to the Web Application, and (c) Generate the map tiles in batch.
Create a blank Publisher Web Application
GeoMedia WebMap version 6.1 has a couple of bugs which will give you with some grief. One of them is that the Publisher graphical commands are unable to group the legend entries eventhough there is an option for it on the graphical user interface. The other is that the batch tile generation script has some syntax errors. I have gone through that frustration and will be able to share the steps to actually generate the map tiles successfully in batch and as a group. The steps can be broken down into 3 major tasks: (a) Create a blank Publisher Web Application site, (b) Publish a GeoMedia Workspace to the Web Application, and (c) Generate the map tiles in batch.
Create a blank Publisher Web Application
- On the Windows desktop, select Start > All Programs > GeoMedia WebMap > Publisher > Server Configuration Utility.
The Publisher Server Configuration Utility dialog box appears. - Click Add.
The GeoMedia WebMap Publisher Application And Service Wizard appears. - Click Next.
The New Web Application and Service Wizard appears. - Click Next and in the Name field type in a name, e.g. mygooglemaps
- Click Next in the following screens until the wizard is completed.
- Click Next.
The new web site is created.
- In GeoMedia, open up a workspace with your warehouses connected and features displayed in the map window.
- In the Legend, click the Groups tab.
- In the Legend, right click on the white space.
A context menu appears. - Select New Group. Name the group as Group1 if you like. Drag and drop the legend entries onto the group so that they appear underneath the group node, as shown below.
- Click the GeoMedia WebMap Publisher Administrator
button.
The Open Application dialog box appears. - In the Open Application dialog box, select a Publisher Web Application, e.g. mygooglemaps.
- Click Open.
The GeoMedia WebMap Publisher Administrator dockable toolbar appears. - Click the Map Content
button.
The Map Content dialog box appears. - Click the Themes node.
- Click Add Theme.
- In the tree field, right click on the Theme1 node.
- Select Add Map.
- Click Get from active map window.
- Expand the Map1 node.
- Click on the Legend node.
- Click Synchronize Legend.
- Expand the Legend node and click the Group1 node. Toggle on Publish this group as a single layer in mashups.
Note: in version 6.1, this option does not work properly. Each legend entry will be pulished as a single map tile layer per zoom scale on the mashup web site eventhough the group option is on. - Click OK.
- In the GeoMedia WebMap Publisher Administrator toolbar, click the Settings
button.
The Settings dialog box appears. - Click the Map tab.
- In the Map format field, select PNG.
- In the Viewer type field, select Browser (GM Mashups).
- Click OK.
- In the GeoMedia WebMap Publisher Administrator toolbox, click Publish and Populate the GeoWorkspace button
and select Publish the GeoWorkspace Contents to the Metadata.
The contents are published to the web site. - Close GeoMedia if you like.
- In Windows Explorer, browse to the GeoMedia WebMap folder containing the batch tile generation files tilegen.bat and tilegen.vbs (in C:\Program Files\GeoMedia WebMap\Publisher\TileGen\) as shown below.
- Copy the TileGen folder to your mashup web site folder C:\WebMap Publisher Projects\mygooglemaps\ as shown below.
- Using your favorite text editor, create the file tilegen.xml and placed in the folder containing the batch tilegen files e.g. C:\WebMap Publisher Projects\mygooglemaps\TileGen\.
Note: An example of the contents of the tilegen.xml file is as follows:
<?xml version="1.0" encoding="utf-8" ?>
<tilegen appname="wpgm"
minzoom="1"
maxzoom="4"
xmin="-180"
xmax="180"
ymin="85.0511287798066"
ymax="-85.0511287798066"
autorange="no"
overwrite="no">
<le>1</le> </le><le>2
</tilegen>
However, the ymin and ymax attributes do not work properly because of a coding error in the tilegen.vbs script. You can modify the tilegen.vbs file to correct the error if you like if you want to use the range to limit the map tiles generation. - I prefer to use the following as the tilegen.xml file. Replace appname="mygooglemaps" with the name of your Publisher Web Application. You can define the min and max zoom levels of map tiles to generate (the levels range from 1 to 17, I think). I set autorange to "yes" to let GeoMedia WebMap automatically determine the range of the map tiles to generate.
<?xml version="1.0" encoding="utf-8" ?>
<tilegen appname="mygooglemaps"
minzoom="1"
maxzoom="4"
autorange="yes"
overwrite="no">
</tilegen> - Open up a command prompt and change the directory to the location of my tilegen files. Type in the following:
C:\> tilegen tilegen.vbs - At the end of the process, you can browse the tilecache folder to see the generated map tiles as shown below.
Thursday, July 24, 2008
Terrain in GeoMedia WebMap Mashup
In addition to the Satellite, street map, and hybrid map types, Google Maps also publishes a terrain map type. If you use the default GeoMedia WebMap 6.1 Publisher template to create a new Google Maps mashup, you will notice that there is no terrain button in the web page; only the Map, Satellite, Hybrid, and No Backdrop buttons are available. See the screen shot below.

To enable the display of terrain shaded relief data from Google, you need to add in the terrain map type to the Google Maps javascript code. Here are the steps to do it.

To enable the display of terrain shaded relief data from Google, you need to add in the terrain map type to the Google Maps javascript code. Here are the steps to do it.
- Go to the GeoMedia WebMap Publisher created mashup folder, e.g. C:\GeoMediaWebMapProjects\mymashup\
- Change directory to the System folder.
- Use a text editor to open the file gm.js.
- Inside the text editor, locate the function initView.
- Look for the following lines in the function.
objMapViewEle = document.getElementById("map"); //testoutput("creating new custom map type");
var tileLayers = [new GTileLayer(new GCopyrightCollection(), 0, 18)];
var custommap = new GMapType(tileLayers, G_NORMAL_MAP.getProjection(), "No Backdrop",{errorMessage:"No Data Available"}); //testoutput("creating GMap2");
objMapView = new GMap2(objMapViewEle);
objMapView.addControl(new GLargeMapControl());
objMapView.addMapType(custommap);
objMapView.addControl(new GMapTypeControl());
gOverviewMapControl = new GOverviewMapControl(new GSize(150,150)); objMapView.addControl(gOverviewMapControl);
objMapView.addControl(new GScaleControl()); - Add in the following line in bold:
objMapView.addMapType(custommap); objMapView.addMapType(G_PHYSICAL_MAP); objMapView.addControl(new GMapTypeControl()); - Save and close the file gm.js.
- Now, open up the mashup web page in an Internet browser. You should be able to see the Terrain button. Clicking on the button will display the terrain data in the map window as shown in the screen shot below.
Subscribe to:
Posts (Atom)