The code works with any vector layer, including GeoJSON. I'm not sure if I did understand.
-----Mensaje original----- De: Noli Sicad [mailto:nsi...@gmail.com] Enviado el: lunes, 31 de octubre de 2011 10:09 Para: Javier Carrasco CC: OpenLayers-Dev Dev; openlayers-users Asunto: Re: [OpenLayers-Dev] Openlayers, GeoJSON and PopUp attributes Yes, It works in iPad simulator. However, the Popup that I am looking is the one that is using GeoJSON. Thanks for showing. Noli On 10/31/11, Javier Carrasco <jcarra...@prodevelop.es> wrote: > I did an uncomplete/demo code to show OpenLayers popups based on an html > template. I have not tested it on mobile. > > The code is like that: > > var p1 = new SmartPopup(map); // SmartPopup should be renamed to > TemplatePopupManager or similar > p1.addLayer('twitterPopup',layer1); // addLayer(templateId, > OpenLayers.Layer) > > and inside the body > > <div id="twitterPopup" style="visibility:hidden; display:none"> > <img src="%profile_image_url%" class="twimg"/> > <a class="twuser" > href="http://twitter.com/%from_user%">%from_user%:</a> > <a class="twtext" > href="http://twitter.com/%from_user%/status/%id_str%">%text%</a> > </div> > > The words between %...% are attribute names of the feature. > > You can see a demo here > http://gis.prodevelop.es/olsocial/ > > Do you think this is a good approach? > > Regards > Javi > > > > > -----Mensaje original----- > De: openlayers-dev-boun...@lists.osgeo.org > [mailto:openlayers-dev-boun...@lists.osgeo.org] En nombre de Noli Sicad > Enviado el: lunes, 31 de octubre de 2011 4:54 > Para: OpenLayers-Dev Dev; openlayers-users > Asunto: [OpenLayers-Dev] Openlayers, GeoJSON and PopUp attributes > > Hi, > > Leaflet has nice way of incorporating generic PopUp and GeoJSON in > displaying feature attributes as illustrated below. It works in mobile > as well as in desktop browser. > > http://leaflet.cloudmade.com/examples/geojson-example.html > > Openlayers got one, but not on desktop and other framework aside from > Jquery mobile and Secha Touch. > > Openlayers + GeoJSON has PopUp attributes for GeoJSON as seen in > mobile-jq example. > > http://openlayers.org/dev/examples/mobile-jq.html#mappage > > So as Sencha Touch. > > http://openlayers.org/dev/examples/mobile-sencha.html > > However, if you click on Sprinters icon in non mobile devices, the > popup would not work since it only caters to the specific windowing > framework (jQuery-mobile and Sencha Touch). In other words, it is > dependent to windowing toolkit. > > Although, I am interested in mobile device framework i.e. jQTouch, it > does not have a popup control/ (window) to micmic JQM and Sencha > Touch. > > Is there any way to do the GeoJSON attributes PopUp in generic OL PopUp? > > GeoJSON is easier to handle than any other vector data as demonstrate > here below. > > http://leaflet.cloudmade.com/examples/layers-control.html > > Hope OpenLayers would have friendliers way of handling GeoJSON > especially in viewing the it attributes using a generic Popup window. > > Or anybody has implemented this already? Any link? > > (Post this URL below, before I get this as a reply :-) > > http://dev.openlayers.org/releases/OpenLayers-2.11/examples/geojson.html > ) > > Thanks. > > Noli > _______________________________________________ > Dev mailing list > d...@lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/openlayers-dev > _______________________________________________ Dev mailing list d...@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/openlayers-dev