cvs: presentations / afup05.xml /slides/intro afup05_ref.xml ws6.xml ws7.xml ws8.xml ws9.xml
| From: | Rasmus Lerdorf | Date: | Wed, 09 Nov 2005 11:33:37 +0000 |
| Subject: | cvs: presentations / afup05.xml /slides/intro afup05_ref.xml ws6.xml ws7.xml ws8.xml ws9.xml | ||
| Groups: | php.pres | ||
| Request: | Send a blank email to pres+get-1215@lists.php.net to get a copy of this message | ||
rasmus Wed Nov 9 06:33:37 2005 EDT
Added files:
/presentations afup05.xml
/presentations/slides/intro ws6.xml ws7.xml ws8.xml ws9.xml
afup05_ref.xml
Log:
AFUP Talk
http://cvs.php.net/co.php/presentations/afup05.xml?r=1.1&p=1 Index: presentations/afup05.xml +++ presentations/afup05.xml <presentation template="php2" navmode="html" titlecolor="#1111aa" navbarbackground="url(images/trans-ffffff.png)" logo1="images/php-med-trans-light.gif" titlesize="2em" navbarheight="4.1em" > <!-- --> <topic>PHP</topic> <title>PHP</title> <event>AFUP</event> <location>Paris</location> <date>Nov.9, 2005</date> <speaker>Rasmus Lerdorf</speaker> <email>rasmus@php.net</email> <slide>slides/intro/titlepage.xml</slide> <slide>slides/intro/serverside.xml</slide> <slide>slides/intro/idea.xml</slide> <slide>slides/lamp/failfast.xml</slide> <slide>slides/intro/who-uses.xml</slide> <slide>slides/keynotes/dev1.xml</slide> <slide>slides/keynotes/dev2.xml</slide> <slide>slides/intro/php5.xml</slide> <slide>slides/intro/xml_eg.xml</slide> <slide>slides/keynotes/web20.xml</slide> <slide>slides/intro/ajax.xml</slide> <slide>slides/intro/ws2.xml</slide> <slide>slides/intro/ws1.xml</slide> <slide>slides/intro/ws3.xml</slide> <slide>slides/intro/ws4.xml</slide> <slide>slides/intro/ws5.xml</slide> <slide>slides/intro/ws6.xml</slide> <slide>slides/intro/ws7.xml</slide> <slide>slides/intro/ws8.xml</slide> <slide>slides/intro/ws9.xml</slide> <slide>slides/intro/afup05_ref.xml</slide> </presentation> http://cvs.php.net/co.php/presentations/slides/intro/ws6.xml?r=1.1&p=1 Index: presentations/slides/intro/ws6.xml +++ presentations/slides/intro/ws6.xml <slide title="Geocoding API"> <blurb> Finally, a free geocoding API </blurb> <example title="REST Query to look up an address" result="0" fontsize="1.8em" marginright="0em"><![CDATA[http://api.local.yahoo.com/MapsService/V1/geocode?appid=YahooDemo&location=94539]]></example> <example title="Returned XML" result="0" fontsize="1.4em" marginright="0em"><![CDATA[<ResultSet xsi:schemaLocation="urn:yahoo:maps http://api.local.yahoo.com/MapsService/V1/GeocodeResponse.xsd"> <Result precision="zip"> <Latitude>37.5173</Latitude> <Longitude>-121.9263</Longitude> <Address/> <City>FREMONT</City> <State>CA</State> <Zip>94539</Zip> <Country>US</Country> </Result> </ResultSet>]]></example> <example fontsize="1.2em" title="We can parse it like this" result="1" marginright="0em" required_extension="simplexml"><![CDATA[<?php $url = 'http://api.local.yahoo.com/MapsService/V1/geocode'; $url .= '?appid=YahooDemo&location=94539'; $xml = simplexml_load_file($url); $ret['precision'] = (string)$xml->Result['precision']; $ret['warning'] = (string)$xml->Result['warning']; foreach($xml->Result->children() as $key=>$val) { if(strlen($val)) $ret[(string)$key] = (string)$val; } echo "<pre>"; print_r($ret); echo "</pre>"; ?>]]></example> <example title="Closest Match" result="0" fontsize="1.8em" marginright="0em"><![CDATA[http://api.local.yahoo.com/MapsService/V1/geocode?appid=YahooDemo&location=701%20First,%20Sunnyvale]]></example> <example title="Returned XML" result="0" fontsize="1.4em" marginright="0em"><![CDATA[<ResultSet xsi:schemaLocation="urn:yahoo:maps http://api.local.yahoo.com/MapsService/V1/GeocodeResponse.xsd"> <Result precision="address" warning="The exact location could not be found, here is the closest match: 701 First Ave, Sunnyvale, CA 94089"> <Latitude>37.416384</Latitude> <Longitude>-122.024853</Longitude> <Address>701 FIRST AVE</Address> <City>SUNNYVALE</City> <State>CA</State> <Zip>94089-1019</Zip> <Country>US</Country> </Result> </ResultSet>]]></example> <link fontsize="3em" marginleft="3em" leader="Docs: " href="http://developer.yahoo.net/maps/"/> </slide> http://cvs.php.net/co.php/presentations/slides/intro/ws7.xml?r=1.1&p=1 Index: presentations/slides/intro/ws7.xml +++ presentations/slides/intro/ws7.xml <slide title="Map Tiles API"> <blurb> You can also ask for a single map tile of any location at any size. </blurb> <example title="REST Query to get a tile" result="0" fontsize="1.4em" marginright="0em"><![CDATA[http://api.local.yahoo.com/MapsService/V1/mapImage?appid=YahooDemo&location=94539]]></example> <example title="Returned XML" result="0" fontsize="1.4em" marginright="0em"><![CDATA[<Result> http://img.maps.yahoo.com/mapimage?MAPDATA=NE6uked6wXUvMKeeO65.zg9FRNGF36TLiC8QU14ROsDkbVumowh8Jm3JSJUKwebcVHHXcvWDLt8WExnWh59FAevHEV5ynmh6WyJ3zNdmrLJYh3S95w-- </Result> ]]></example> <example fontsize="1.2em" title="Example" result="1" marginright="0em"><![CDATA[<html><head><title>Map Tile Demo</title> <script type="text/javascript"> <?php function request_cache($url, $dest_file, $timeout=43200) { if(!file_exists($dest_file) || filemtime($dest_file) < (time()-$timeout)) { $stream = fopen($url,'r'); $tmpf = tempnam('/tmp','YWS'); file_put_contents($tmpf, $stream); fclose($stream); rename($tmpf, $dest_file); } } $cities = array("San Francisco", "Los Angeles", "Seattle", "Atlanta", "Chicago", "Dallas", "Vancouver, Canada", "New York City", "Toronto", "Miami, FL", "Boston"); $width = 600; $height = 300; $zoom = 7; $url = "http://api.local.yahoo.com/MapsService/V1/mapImage?appid=YahooDemo"; $url .= "&image_height=$height&image_width=$width&zoom=$zoom"; $url .= "&location="; $i=0; foreach($cities as $city) { $q = $url.rawurlencode($city); $tmp = '/tmp/yws_tile_'.md5($q); request_cache($q, $tmp); $xml = simplexml_load_file($tmp); if($i==0) $first = (string)$xml; echo <<<EOB image$i = new Image(); image$i.src = "$xml"; EOB; $i++; } ?> </script> </head><body> <?php echo <<<EOB <div id="img_container" style="float:left; height:{$height}px; width:{$width}px; padding: 0px 10px 0px 10px;"> <img id="the_img" src="$first" height="$height" width="$width"/></div> EOB; $i=0; foreach($cities as $city) { $q = rawurlencode($city); echo <<<EOB <a href="http://maps.yahoo.com/beta/index.php?#trf=0&q1=$q" onmouseover="document.getElementById('the_img').src=image$i.src; this.style.backgroundColor='white';" onmouseout="this.style.backgroundColor='#eeee33';">$city</a><br /> EOB; $i++; } ?> </body></html>]]></example> </slide> http://cvs.php.net/co.php/presentations/slides/intro/ws8.xml?r=1.1&p=1 Index: presentations/slides/intro/ws8.xml +++ presentations/slides/intro/ws8.xml <slide title="Embedded Map API"> <blurb> There are actually 4 different APIs. Actionscript-Flash, Flex-Flash, Javascript controlling a Flash map, and Javascript controlling an AJAX/DHTML map. I know nothing about Actionscript, nor Flex. Sorry. </blurb> <example title="Simple Embedded Flash map" result="1" fontsize="1.6em" marginright="0em"><![CDATA[<script type="text/javascript" src="http://api.maps.yahoo.com/v2.0/fl/javascript/apiloader.js"> </script> <div id="mapContainer" style="height: 400px; width: 930px;"></div> <script type="text/javascript"> var mymap = new Map("mapContainer", "YahooDemo", "San Francisco, CA", 6); mymap.addTool(new PanTool(), true); mymap.addWidget(new NavigatorWidget()); </script>]]></example> <blurb> It's actually a little bit disappointing how simple it is. We don't even need PHP here. Of course, chances are you are going to put things onto the map, in which case you are likely to need PHP to fetch data from a backend to plot. </blurb> <example title="Simple Embedded DHTML map" result="1" fontsize="1.6em" rfontsize="1em" marginright="0em"><![CDATA[<script type="text/javascript" src="http://api.maps.yahoo.com/ajaxymap?v=2.0&appid=YahooDemo"> </script> <div id="jsmapContainer" style="height: 400px; width: 930px;"></div> <script type="text/javascript"> <?php $url = 'http://api.local.yahoo.com/MapsService/V1/geocode'; $url .= '?appid=YahooDemo&location=San%20Francisco,CA'; $xml = simplexml_load_file($url); ?> var latlon = new YGeoPoint(<?php echo $xml->Result->Latitude?>, <?php echo $xml->Result->Longitude?>); var jsmap = new YMap(document.getElementById('jsmapContainer')); jsmap.addPanControl(); jsmap.addZoomLong(); jsmap.drawZoomAndCenter(latlon, 6); </script>]]></example> </slide> http://cvs.php.net/co.php/presentations/slides/intro/ws9.xml?r=1.1&p=1 Index: presentations/slides/intro/ws9.xml +++ presentations/slides/intro/ws9.xml <slide title="Adding Markers"> <blurb> You can either add markers one by one by calculating a location and adding the marker, or in the Flash API you can use an overlay. There is a very handy GeoRSS overlay that you just feed a Geocoded RSS file to. Each entry needs to have this: </blurb> <example title="GeoRSS Sample Item" result="0" fontsize="1.5em" marginright="0em"><![CDATA[<item> <title>M 3.3, Southern California</title> <description>November 08, 2005 22:03:46 GMT</description> <link>http://earthquake.usgs.gov/recenteqsww/Quakes/ci14197132.htm</link> <geo:lat>33.5325</geo:lat> <geo:long>-116.6910</geo:long> <dc:subject>3</dc:subject> <dc:subject>pasthour</dc:subject> <dc:subject>11.60 km</dc:subject> </item>]]></example> <example title="Adding GeoRSS to the Flash map" result="1" fontsize="1.4em" marginright="0em"><![CDATA[<script type="text/javascript" src="http://api.maps.yahoo.com/v2.0/fl/javascript/apiloader.js"> </script> <div id="mapContainer" style="height: 500px; width: 930px;"></div> <script type="text/javascript"> var mymap = new Map("mapContainer", "YahooDemo", "San Francisco, CA", 12); mymap.addTool(new PanTool(), true); mymap.addWidget(new NavigatorWidget()); olay = new GeoRSSOverlay( 'http://earthquake.usgs.gov/recenteqsww/catalogs/eqs7day-M2.5.xml'); mymap.addOverlay(olay); </script>]]></example> <blurb> Ok, again, disappointing that we didn't need PHP. But to do the same on the DHTML map we need some PHP help </blurb> <example title="Simple Embedded DHTML map" result="1" fontsize="1.4em" rfontsize="1em" marginright="0em"><![CDATA[<script type="text/javascript" src="http://api.maps.yahoo.com/ajaxymap?v=2.0&appid=YahooDemo"> </script> <div id="jsmapContainer" style="height: 500px; width: 930px;"></div> <?php include 'simple_rss.php'; $url = 'http://earthquake.usgs.gov/recenteqsww/catalogs/eqs7day-M2.5.xml'; $feed = rss_request($url, $timeout=3600); ?> <script type="text/javascript"> <?php $url = 'http://api.local.yahoo.com/MapsService/V1/geocode'; $url .= '?appid=YahooDemo&location=San%20Francisco,CA'; $xml = simplexml_load_file($url); ?> var marker = new Array(); var latlon = new YGeoPoint(<?php echo $xml->Result->Latitude?>, <?php echo $xml->Result->Longitude?>); var jsmap = new YMap(document.getElementById('jsmapContainer')); jsmap.addPanControl(); jsmap.addZoomLong(); jsmap.drawZoomAndCenter(latlon, 12); <?php $i = 0; while(!empty($feed[$i])) { $info = $feed[$i]['title'][0]."<br />"; $info .= $feed[$i]['description'][0]."<br />"; $info .= '<a href="'.$feed[$i]['link'][0].'">more info</a>'; $info = addslashes($info); $lat = $feed[$i]['lat'][0]; $lon = $feed[$i]['long'][0]; echo <<<EOB marker[$i] = new YMarker(new YGeoPoint($lat,$lon)); marker[$i].addLabel("<b>$i</b>"); YEvent.Capture(marker[$i], EventsList.MouseClick, new Function("marker[$i].openSmartWindow('$info');")); jsmap.addOverlay(marker[$i]); EOB; flush(); $i++; if($i>9) break; } ?> </script>]]></example> </slide> http://cvs.php.net/co.php/presentations/slides/intro/afup05_ref.xml?r=1.1&p=1 Index: presentations/slides/intro/afup05_ref.xml +++ presentations/slides/intro/afup05_ref.xml <slide title="Resources"> <blurb> </blurb> <blurb> </blurb> <blurb> </blurb> <blurb> </blurb> <link fontsize="3em" marginleft="3em" leader="Slides: " href="http://talks.php.net/show/afup05"/> <link fontsize="3em" marginleft="3em" leader="APC: " href="http://pecl.php.net/package/APC"/> <link fontsize="3em" marginleft="3em" leader="Yahoo: " href="http://developer.yahoo.net/"/> <link fontsize="3em" marginleft="3em" leader="Flickr: " href="http://flickr.com/services/api/"/> </slide>
http://cvs.php.net/co.php/presentations/afup05.xml?r=1.1&p=1 Index: presentations/afup05.xml +++ presentations/afup05.xml <presentation template="php2" navmode="html" titlecolor="#1111aa" navbarbackground="url(images/trans-ffffff.png)" logo1="images/php-med-trans-light.gif" titlesize="2em" navbarheight="4.1em" > <!-- --> <topic>PHP</topic> <title>PHP</title> <event>AFUP</event> <location>Paris</location> <date>Nov.9, 2005</date> <speaker>Rasmus Lerdorf</speaker> <email>rasmus@php.net</email> <slide>slides/intro/titlepage.xml</slide> <slide>slides/intro/serverside.xml</slide> <slide>slides/intro/idea.xml</slide> <slide>slides/lamp/failfast.xml</slide> <slide>slides/intro/who-uses.xml</slide> <slide>slides/keynotes/dev1.xml</slide> <slide>slides/keynotes/dev2.xml</slide> <slide>slides/intro/php5.xml</slide> <slide>slides/intro/xml_eg.xml</slide> <slide>slides/keynotes/web20.xml</slide> <slide>slides/intro/ajax.xml</slide> <slide>slides/intro/ws2.xml</slide> <slide>slides/intro/ws1.xml</slide> <slide>slides/intro/ws3.xml</slide> <slide>slides/intro/ws4.xml</slide> <slide>slides/intro/ws5.xml</slide> <slide>slides/intro/ws6.xml</slide> <slide>slides/intro/ws7.xml</slide> <slide>slides/intro/ws8.xml</slide> <slide>slides/intro/ws9.xml</slide> <slide>slides/intro/afup05_ref.xml</slide> </presentation> http://cvs.php.net/co.php/presentations/slides/intro/ws6.xml?r=1.1&p=1 Index: presentations/slides/intro/ws6.xml +++ presentations/slides/intro/ws6.xml <slide title="Geocoding API"> <blurb> Finally, a free geocoding API </blurb> <example title="REST Query to look up an address" result="0" fontsize="1.8em" marginright="0em"><![CDATA[http://api.local.yahoo.com/MapsService/V1/geocode?appid=YahooDemo&location=94539]]></example> <example title="Returned XML" result="0" fontsize="1.4em" marginright="0em"><![CDATA[<ResultSet xsi:schemaLocation="urn:yahoo:maps http://api.local.yahoo.com/MapsService/V1/GeocodeResponse.xsd"> <Result precision="zip"> <Latitude>37.5173</Latitude> <Longitude>-121.9263</Longitude> <Address/> <City>FREMONT</City> <State>CA</State> <Zip>94539</Zip> <Country>US</Country> </Result> </ResultSet>]]></example> <example fontsize="1.2em" title="We can parse it like this" result="1" marginright="0em" required_extension="simplexml"><![CDATA[<?php $url = 'http://api.local.yahoo.com/MapsService/V1/geocode'; $url .= '?appid=YahooDemo&location=94539'; $xml = simplexml_load_file($url); $ret['precision'] = (string)$xml->Result['precision']; $ret['warning'] = (string)$xml->Result['warning']; foreach($xml->Result->children() as $key=>$val) { if(strlen($val)) $ret[(string)$key] = (string)$val; } echo "<pre>"; print_r($ret); echo "</pre>"; ?>]]></example> <example title="Closest Match" result="0" fontsize="1.8em" marginright="0em"><![CDATA[http://api.local.yahoo.com/MapsService/V1/geocode?appid=YahooDemo&location=701%20First,%20Sunnyvale]]></example> <example title="Returned XML" result="0" fontsize="1.4em" marginright="0em"><![CDATA[<ResultSet xsi:schemaLocation="urn:yahoo:maps http://api.local.yahoo.com/MapsService/V1/GeocodeResponse.xsd"> <Result precision="address" warning="The exact location could not be found, here is the closest match: 701 First Ave, Sunnyvale, CA 94089"> <Latitude>37.416384</Latitude> <Longitude>-122.024853</Longitude> <Address>701 FIRST AVE</Address> <City>SUNNYVALE</City> <State>CA</State> <Zip>94089-1019</Zip> <Country>US</Country> </Result> </ResultSet>]]></example> <link fontsize="3em" marginleft="3em" leader="Docs: " href="http://developer.yahoo.net/maps/"/> </slide> http://cvs.php.net/co.php/presentations/slides/intro/ws7.xml?r=1.1&p=1 Index: presentations/slides/intro/ws7.xml +++ presentations/slides/intro/ws7.xml <slide title="Map Tiles API"> <blurb> You can also ask for a single map tile of any location at any size. </blurb> <example title="REST Query to get a tile" result="0" fontsize="1.4em" marginright="0em"><![CDATA[http://api.local.yahoo.com/MapsService/V1/mapImage?appid=YahooDemo&location=94539]]></example> <example title="Returned XML" result="0" fontsize="1.4em" marginright="0em"><![CDATA[<Result> http://img.maps.yahoo.com/mapimage?MAPDATA=NE6uked6wXUvMKeeO65.zg9FRNGF36TLiC8QU14ROsDkbVumowh8Jm3JSJUKwebcVHHXcvWDLt8WExnWh59FAevHEV5ynmh6WyJ3zNdmrLJYh3S95w-- </Result> ]]></example> <example fontsize="1.2em" title="Example" result="1" marginright="0em"><![CDATA[<html><head><title>Map Tile Demo</title> <script type="text/javascript"> <?php function request_cache($url, $dest_file, $timeout=43200) { if(!file_exists($dest_file) || filemtime($dest_file) < (time()-$timeout)) { $stream = fopen($url,'r'); $tmpf = tempnam('/tmp','YWS'); file_put_contents($tmpf, $stream); fclose($stream); rename($tmpf, $dest_file); } } $cities = array("San Francisco", "Los Angeles", "Seattle", "Atlanta", "Chicago", "Dallas", "Vancouver, Canada", "New York City", "Toronto", "Miami, FL", "Boston"); $width = 600; $height = 300; $zoom = 7; $url = "http://api.local.yahoo.com/MapsService/V1/mapImage?appid=YahooDemo"; $url .= "&image_height=$height&image_width=$width&zoom=$zoom"; $url .= "&location="; $i=0; foreach($cities as $city) { $q = $url.rawurlencode($city); $tmp = '/tmp/yws_tile_'.md5($q); request_cache($q, $tmp); $xml = simplexml_load_file($tmp); if($i==0) $first = (string)$xml; echo <<<EOB image$i = new Image(); image$i.src = "$xml"; EOB; $i++; } ?> </script> </head><body> <?php echo <<<EOB <div id="img_container" style="float:left; height:{$height}px; width:{$width}px; padding: 0px 10px 0px 10px;"> <img id="the_img" src="$first" height="$height" width="$width"/></div> EOB; $i=0; foreach($cities as $city) { $q = rawurlencode($city); echo <<<EOB <a href="http://maps.yahoo.com/beta/index.php?#trf=0&q1=$q" onmouseover="document.getElementById('the_img').src=image$i.src; this.style.backgroundColor='white';" onmouseout="this.style.backgroundColor='#eeee33';">$city</a><br /> EOB; $i++; } ?> </body></html>]]></example> </slide> http://cvs.php.net/co.php/presentations/slides/intro/ws8.xml?r=1.1&p=1 Index: presentations/slides/intro/ws8.xml +++ presentations/slides/intro/ws8.xml <slide title="Embedded Map API"> <blurb> There are actually 4 different APIs. Actionscript-Flash, Flex-Flash, Javascript controlling a Flash map, and Javascript controlling an AJAX/DHTML map. I know nothing about Actionscript, nor Flex. Sorry. </blurb> <example title="Simple Embedded Flash map" result="1" fontsize="1.6em" marginright="0em"><![CDATA[<script type="text/javascript" src="http://api.maps.yahoo.com/v2.0/fl/javascript/apiloader.js"> </script> <div id="mapContainer" style="height: 400px; width: 930px;"></div> <script type="text/javascript"> var mymap = new Map("mapContainer", "YahooDemo", "San Francisco, CA", 6); mymap.addTool(new PanTool(), true); mymap.addWidget(new NavigatorWidget()); </script>]]></example> <blurb> It's actually a little bit disappointing how simple it is. We don't even need PHP here. Of course, chances are you are going to put things onto the map, in which case you are likely to need PHP to fetch data from a backend to plot. </blurb> <example title="Simple Embedded DHTML map" result="1" fontsize="1.6em" rfontsize="1em" marginright="0em"><![CDATA[<script type="text/javascript" src="http://api.maps.yahoo.com/ajaxymap?v=2.0&appid=YahooDemo"> </script> <div id="jsmapContainer" style="height: 400px; width: 930px;"></div> <script type="text/javascript"> <?php $url = 'http://api.local.yahoo.com/MapsService/V1/geocode'; $url .= '?appid=YahooDemo&location=San%20Francisco,CA'; $xml = simplexml_load_file($url); ?> var latlon = new YGeoPoint(<?php echo $xml->Result->Latitude?>, <?php echo $xml->Result->Longitude?>); var jsmap = new YMap(document.getElementById('jsmapContainer')); jsmap.addPanControl(); jsmap.addZoomLong(); jsmap.drawZoomAndCenter(latlon, 6); </script>]]></example> </slide> http://cvs.php.net/co.php/presentations/slides/intro/ws9.xml?r=1.1&p=1 Index: presentations/slides/intro/ws9.xml +++ presentations/slides/intro/ws9.xml <slide title="Adding Markers"> <blurb> You can either add markers one by one by calculating a location and adding the marker, or in the Flash API you can use an overlay. There is a very handy GeoRSS overlay that you just feed a Geocoded RSS file to. Each entry needs to have this: </blurb> <example title="GeoRSS Sample Item" result="0" fontsize="1.5em" marginright="0em"><![CDATA[<item> <title>M 3.3, Southern California</title> <description>November 08, 2005 22:03:46 GMT</description> <link>http://earthquake.usgs.gov/recenteqsww/Quakes/ci14197132.htm</link> <geo:lat>33.5325</geo:lat> <geo:long>-116.6910</geo:long> <dc:subject>3</dc:subject> <dc:subject>pasthour</dc:subject> <dc:subject>11.60 km</dc:subject> </item>]]></example> <example title="Adding GeoRSS to the Flash map" result="1" fontsize="1.4em" marginright="0em"><![CDATA[<script type="text/javascript" src="http://api.maps.yahoo.com/v2.0/fl/javascript/apiloader.js"> </script> <div id="mapContainer" style="height: 500px; width: 930px;"></div> <script type="text/javascript"> var mymap = new Map("mapContainer", "YahooDemo", "San Francisco, CA", 12); mymap.addTool(new PanTool(), true); mymap.addWidget(new NavigatorWidget()); olay = new GeoRSSOverlay( 'http://earthquake.usgs.gov/recenteqsww/catalogs/eqs7day-M2.5.xml'); mymap.addOverlay(olay); </script>]]></example> <blurb> Ok, again, disappointing that we didn't need PHP. But to do the same on the DHTML map we need some PHP help </blurb> <example title="Simple Embedded DHTML map" result="1" fontsize="1.4em" rfontsize="1em" marginright="0em"><![CDATA[<script type="text/javascript" src="http://api.maps.yahoo.com/ajaxymap?v=2.0&appid=YahooDemo"> </script> <div id="jsmapContainer" style="height: 500px; width: 930px;"></div> <?php include 'simple_rss.php'; $url = 'http://earthquake.usgs.gov/recenteqsww/catalogs/eqs7day-M2.5.xml'; $feed = rss_request($url, $timeout=3600); ?> <script type="text/javascript"> <?php $url = 'http://api.local.yahoo.com/MapsService/V1/geocode'; $url .= '?appid=YahooDemo&location=San%20Francisco,CA'; $xml = simplexml_load_file($url); ?> var marker = new Array(); var latlon = new YGeoPoint(<?php echo $xml->Result->Latitude?>, <?php echo $xml->Result->Longitude?>); var jsmap = new YMap(document.getElementById('jsmapContainer')); jsmap.addPanControl(); jsmap.addZoomLong(); jsmap.drawZoomAndCenter(latlon, 12); <?php $i = 0; while(!empty($feed[$i])) { $info = $feed[$i]['title'][0]."<br />"; $info .= $feed[$i]['description'][0]."<br />"; $info .= '<a href="'.$feed[$i]['link'][0].'">more info</a>'; $info = addslashes($info); $lat = $feed[$i]['lat'][0]; $lon = $feed[$i]['long'][0]; echo <<<EOB marker[$i] = new YMarker(new YGeoPoint($lat,$lon)); marker[$i].addLabel("<b>$i</b>"); YEvent.Capture(marker[$i], EventsList.MouseClick, new Function("marker[$i].openSmartWindow('$info');")); jsmap.addOverlay(marker[$i]); EOB; flush(); $i++; if($i>9) break; } ?> </script>]]></example> </slide> http://cvs.php.net/co.php/presentations/slides/intro/afup05_ref.xml?r=1.1&p=1 Index: presentations/slides/intro/afup05_ref.xml +++ presentations/slides/intro/afup05_ref.xml <slide title="Resources"> <blurb> </blurb> <blurb> </blurb> <blurb> </blurb> <blurb> </blurb> <link fontsize="3em" marginleft="3em" leader="Slides: " href="http://talks.php.net/show/afup05"/> <link fontsize="3em" marginleft="3em" leader="APC: " href="http://pecl.php.net/package/APC"/> <link fontsize="3em" marginleft="3em" leader="Yahoo: " href="http://developer.yahoo.net/"/> <link fontsize="3em" marginleft="3em" leader="Flickr: " href="http://flickr.com/services/api/"/> </slide>