From: Alexandre A. S. <aas...@gm...> - 2011-08-31 16:20:36
|
Hi Tim, of course I can... public void addKMLFile(String KMLContent) { //Read kml file KML kmlReader= new KML(); kmlReader.getJSObject().setProperty("extractStyles", true); kmlReader.getJSObject().setProperty("extractAttributes", true); VectorFeature[] features= kmlReader.read(KMLContent); //loop for all artefacts in the file for (VectorFeature feature: features) { yourLayer.addFeature(feature); } } Cheers, Alex ________________________________________ De: Tim Dudman [tim...@ri...] Enviado el: miércoles, 31 de agosto de 2011 17:20 Para: Alexandre Ascasibar Sequeiros CC: gwt...@li... Asunto: Re: [Gwt-openlayers-users] GWT OpenLayers KML layer Thanks for the quick response Alex. Reading the file from the server using GWT is no problem. Would it be possible to show me an example of the GWT Openlayers API calls I need to make to get the KML onto the map using the KML object and VectorFeature array? I'm assuming it's only a few lines of code but I can't find any examples... Thanks again, Tim. Tim Dudman Principal Consultant RiskAware Ltd Tel: +44 (0) 117 9330543 Web: www.riskaware.co.uk<http://www.riskaware.co.uk> On 31 August 2011 15:52, Alexandre Ascasibar Sequeiros <aas...@gm...<mailto:aas...@gm...>> wrote: Hi Tim, The method read of the object KML allows you to transform a KML content into an array of VectorFeature[]. If you have this KML content in a file in the client you have to use a GWT upload widget in order to read the file. If the file it's in the server you have to create a GWT RPC service in order to read the file. I hope it helps. Cheers, Alex ________________________________________ De: Tim Dudman [tim...@ri...<mailto:tim...@ri...>] Enviado el: miércoles, 31 de agosto de 2011 16:01 Para: gwt...@li...<mailto:gwt...@li...> Asunto: [Gwt-openlayers-users] GWT OpenLayers KML layer All, Is it possible to add a KML layer to GWT OpenLayers? If so, could someone show me an example of adding a KML layer based on a KML file URL? Thanks in advance, Tim. RiskAware Limited. Registered in England. Company Number: 3812608. VAT Number: 740 891 815. Registered Address: 9th Floor, Colston Tower, Colston Street, Bristol, BS1 4XE. The information in this email is intended solely for the addressee(s) and may contain privileged material. Access to this email by anyone else is unauthorised. Any review, retransmission, dissemination or any use of this information by persons or entities other than the intended recipient is strictly prohibited. RiskAware Ltd reserves the right to monitor all outgoing and incoming e-mails. ______________________ This message including any attachments may contain confidential information, according to our Information Security Management System, and intended solely for a specific individual to whom they are addressed. Any unauthorised copy, disclosure or distribution of this message is strictly forbidden. If you have received this transmission in error, please notify the sender immediately and delete it. ______________________ Este mensaje, y en su caso, cualquier fichero anexo al mismo, puede contener informacion clasificada por su emisor como confidencial en el marco de su Sistema de Gestion de Seguridad de la Informacion siendo para uso exclusivo del destinatario, quedando prohibida su divulgacion copia o distribucion a terceros sin la autorizacion expresa del remitente. Si Vd. ha recibido este mensaje erroneamente, se ruega lo notifique al remitente y proceda a su borrado. Gracias por su colaboracion. ______________________ RiskAware Limited. Registered in England. Company Number: 3812608. VAT Number: 740 891 815. Registered Address: 9th Floor, Colston Tower, Colston Street, Bristol, BS1 4XE. The information in this email is intended solely for the addressee(s) and may contain privileged material. Access to this email by anyone else is unauthorised. Any review, retransmission, dissemination or any use of this information by persons or entities other than the intended recipient is strictly prohibited. RiskAware Ltd reserves the right to monitor all outgoing and incoming e-mails. ______________________ This message including any attachments may contain confidential information, according to our Information Security Management System, and intended solely for a specific individual to whom they are addressed. Any unauthorised copy, disclosure or distribution of this message is strictly forbidden. If you have received this transmission in error, please notify the sender immediately and delete it. ______________________ Este mensaje, y en su caso, cualquier fichero anexo al mismo, puede contener informacion clasificada por su emisor como confidencial en el marco de su Sistema de Gestion de Seguridad de la Informacion siendo para uso exclusivo del destinatario, quedando prohibida su divulgacion copia o distribucion a terceros sin la autorizacion expresa del remitente. Si Vd. ha recibido este mensaje erroneamente, se ruega lo notifique al remitente y proceda a su borrado. Gracias por su colaboracion. ______________________ |