Welcome to Geeklog, Anonymous Saturday, June 22 2024 @ 02:21 am EDT

Geeklog Forums

OpenLayers Map Integration

Status: offline


Forum User
Registered: 01/29/02
Posts: 39
This isn't really a how-to, just a note to say that add the ability to add even more flexible maps to GL should be trivial. Developers: this is great ground for extension.

If GL would publish RSS as GeoRSS the feed could easily be placed into this map (e.g., this story, link, etc is relevant to this place). In the Geo world we call this spatially enabling data. GeoRSS, GeoJSON, and Google's KML are the standards for posting these data to the web. GeoRSS seems to make the most sense for us. GeoRSS is essentially RSS feeds with Latitude/Longitude included. These would allow geomashups to occur. See GL news stories on a map, click the dot to see a bubble with a summary+image+link to the whole story.

Here is how to mod GL to spatially enable it.

Add three fields say to items in GL. Place name, Latitude, Longitude.

1. User enters item (link, story, etc.)
2. User enters place name
3. User submits
4. GL send place name to a geo locator service to retrieve lat/long/suggested place name (or selectable list)
5. User selects returned result to "tag" entry with coordinate
6. Feed is spatially enabled and visible in maps/services that consume it.

See this article for example services

See http://gallery.openlayers.org/ for examples of the power of OpenLayers (supports Google Maps too).

But here is the Hello World example

The 10 second example of what must be included in a static page to show the map.
Text Formatted Code

<link rel="stylesheet" href="../../OpenLayers-2.6/OpenLayers-2.6/theme/default/style.css" type="text/css" />
    <style type="text/css">
        #map {
            width: 512px;
            height: 512px;
            border: 1px solid black;
    <script src="../../OpenLayers-2.6/OpenLayers-2.6/lib/OpenLayers.js"></script>
    <script type="text/javascript">
        var map, layer;
        function init(){
            map = new OpenLayers.Map( 'map' );
            layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
                    {layers: 'basic'} );

  <body onload="init()">
    <h1 id="title">Basic Single WMS Example</h1>

    <div id="tags"></div>

    <div id="shortdesc">Show a Simple Map</div>

    <div id="map"></div>

    <div id="docs">
        This example shows a very simple layout with minimal controls.  This example uses a single WMS base layer.

Status: offline


Forum User
Registered: 01/29/02
Posts: 39
Here is what example GeoRSS looks like

Text Formatted Code

<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="http://yelp.com/css/atom.css" type="text/css" media="screen"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#">
        <rights>Copyright 2007 Yelp, Inc. All rights reserved.</rights>
        <title>Yelp - Recent Reviews Near Ann Arbor, MI</title>
        <link href="http://www.yelp.com/?location=Ann+Arbor%2C+MI"/>
                <name>Recent Reviews Near Ann Arbor, MI</name>

                <title>Sam S.&#39;s Review Of State Theatre - Ann Arbor (4/5)</title>
                <link rel="alternate" type="text/html" href="http://www.yelp.com/biz/r-dZCCNtld2ik0QRoTwuUQ?hrid=pve0e49KrVsvgX_wXpZHYA" />
                <summary type="html">I gotta give this place props for hosting independent movies. Man, I really tire of that Hollywood bullshit; I actually feel retarded afterwards.&lt;br /&gt;&lt;br /&gt;My main gripe is that the seats are not ergonomic at&amp;#8230;</summary>
                <title>Jane S.&#39;s Review Of Special Moments Photography - Plymouth (1/5)</title>
                <link rel="alternate" type="text/html" href="http://www.yelp.com/biz/IEsTnmfhN7vFfzt724qojw?hrid=ZvALNYOlSodoOciFsmeLZA" />
                <summary type="html">I was very unsatisfied for several reasons. First, the photographer did not have the lighting for family portraits right at all! Two faces are almost completely obscured by shadows. Also, the backdrop&amp;#8230;</summary>
                <title>Tony C.&#39;s Review Of Bennett Optometry - Ann Arbor (4/5)</title>
                <link rel="alternate" type="text/html" href="http://www.yelp.com/biz/Oa5c1Zzr6RlkGjx-0KYr1A?hrid=vUiuwPLri6D5LTPrC76UlA" />
                <summary type="html">I just got my eyes checked out here about two months ago and overall, I was satisfied with my experience.  The optometrist I got was young, but very knowledgeable and didn't seem to be in a hurry to&amp;#8230;</summary>
                <title>Liam C.&#39;s Review Of Zack&#39;s of Plymouth - Plymouth (2/5)</title>
                <link rel="alternate" type="text/html" href="http://www.yelp.com/biz/F0iuCrXUd_fEJ-LZh8wMFw?hrid=2VLIUcC_oI8b_aLTMjYx8w" />
                <summary type="html">If you like greasy diners with vaguely ethnic workers yelling in orgy-borgy talk back int he kitchen... you're gonna love this place.&lt;br /&gt;&lt;br /&gt;It's cleaner than it's competitors....gotta give them props on&amp;#8230;</summary>

All times are EDT. The time is now 02:21 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content