[OpenLayers-Commits] r11592 - sandbox/crschmidt/ovi-mobile/examples

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Tue Mar 1 04:34:05 EST 2011


Author: crschmidt
Date: 2011-03-01 01:34:05 -0800 (Tue, 01 Mar 2011)
New Revision: 11592

Modified:
   sandbox/crschmidt/ovi-mobile/examples/ovi-jq.html
   sandbox/crschmidt/ovi-mobile/examples/ovi-jq.js
Log:
Add ordinal (so you can find the thing you were looking for), 
and remove some extra HTML.


Modified: sandbox/crschmidt/ovi-mobile/examples/ovi-jq.html
===================================================================
--- sandbox/crschmidt/ovi-mobile/examples/ovi-jq.html	2011-03-01 09:14:53 UTC (rev 11591)
+++ sandbox/crschmidt/ovi-mobile/examples/ovi-jq.html	2011-03-01 09:34:05 UTC (rev 11592)
@@ -2,7 +2,7 @@
 <html>
     <head>
         <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
-        <title>OpenLayers with jQuery Mobile</title>
+        <title>Ovi Maps</title>
         <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0;">
         <meta name="apple-mobile-web-app-capable" content="yes">
         <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.css">
@@ -15,14 +15,6 @@
         <script src="ovi-jq.js"></script>
     </head>
     <body>
-        <h1 id="title">OpenLayers with jQuery Mobile</h1>
-        <div id="tags">
-          mobile, jquery
-        </div>
-        <p id="shortdesc">
-          Using jQuery Mobile to display an OpenLayers map.
-        </p>
-
         <div data-role="page" id="mappage">
           <div data-role="content">
             <div id="map"></div>

Modified: sandbox/crschmidt/ovi-mobile/examples/ovi-jq.js
===================================================================
--- sandbox/crschmidt/ovi-mobile/examples/ovi-jq.js	2011-03-01 09:14:53 UTC (rev 11591)
+++ sandbox/crschmidt/ovi-mobile/examples/ovi-jq.js	2011-03-01 09:34:05 UTC (rev 11592)
@@ -49,7 +49,8 @@
         styleMap: new OpenLayers.StyleMap({
             'fillColor': 'red',
             'fillOpacity': .8,
-            'pointRadius': 10
+            'pointRadius': 10,
+            'label': '${ordinal}'
         })});
     map.addLayer(searchLayer);
 /*    var sprintersLayer = new OpenLayers.Layer.Vector("Sprinters", {
@@ -120,7 +121,9 @@
                 'success': function(data) {
                     searchLayer.destroyFeatures();
                     var center = map.getCenter().transform(new OpenLayers.Projection("EPSG:900913"), new OpenLayers.Projection("EPSG:4326"));
+                    var ordinal = 0;
                     $.each(data.results, function() {
+                        ordinal+=1;
                         var place = this;
                         var feature = new OpenLayers.Feature.Vector(
                             new OpenLayers.Geometry.Point(place.properties.geoLongitude, place.properties.geoLatitude).transform(gg, sm), place.properties
@@ -138,11 +141,11 @@
                         }
                         addr = addr.join(", "); 
                         feature.attributes.address = addr;
-
+                        feature.attributes.ordinal = ordinal;
                         $('<li>')
                             .hide()
                             .append($('<h2 />', {
-                                text: place.properties.title
+                                text: "("+ordinal+") "+place.properties.title
                             }))
                             .append($('<p />', {
                                 html: '<b>' + addr + '</b> ('+OpenLayers.Util.toFloat(distance,3)+'km)'



More information about the Commits mailing list