Develop a KML layer with specifying KML file content as string only? - google-app-engine

We can develop a KML layer as follows:
var crosshairLayer = new google.maps.KmlLayer('KML File PATH');
crosshairLayer.setMap(map);
For this we have to upload a kml file somewhere on internet and then we have to pass kml file URL in the new google.maps.KmlLayer('KML File PATH') constructor.
Can we develop KML Layer specifying KML content only. I dont want to upload the KML file somewhere and then using its URL.

The geoxml3 parser has a parseKmlString method which takes a string containing valid KML and parses it to produce native Google Maps API v3 objects (so you lose the benefit of tile based rendering you get with KmlLayer, whether that will be efficient enough will depend on how complex your KML is).

The api does not support this directly. You'll need to use a 3rd party kml parser. See How to read KML file

Related

Is it possible to convert .pdf file to image in ionic with AngularJS?

I am very new to ionic. So I want to convert my pdf file to an image file in using Angularjs.
Once you have rendered the PDF in your appliaction using PDF.JS, converting a PDF page to an image is nothing special. PDF.JS uses a element to render a PDF (although it can also be set to use an SVG). You can easily convert the underlying canvas to an image using canvas.toDataURL method.
We can use canvaz to pdf convertion for this purpose
For more information :
http://usefulangle.com/post/24/pdf-to-jpeg-png-with-pdfjs

How to embed mxd file to html/php

I have arcgis mxd file, I dont know how to use arcgis, i just have .mxd file and need to embed into html/php to make a maps access via browser ? Maybe using iframe or arcgis have tool to convert ?
Mxd files are published using ArcGIS for Server. But it's not free.
I think there is no other way to directly publish mxd on the web.
I'm not entirely sure why you'd want to host an MXD on the web, but I'm assuming you want to put an interactive map on a website? You can publish services to ArcGIS for Server or ArcGIS Online if you have access to that. Otherwise you can upload a static map. Create a PDF, JPEG, PNG, etc by going to File > Export after opening the MXD file.

How to convert the uploaded file in Box.com?

https://salesforce.stackexchange.com/questions/45823/how-to-download-uploaded-file-in-box-com/46515#46515
In the above link the code will give an url (in the response) to download the file. But i want the file to be downloaded in HTML format. As per the box.com website i.e., https://developers.box.com/view/ they have given that we can convert the files to HTML. How can i do this using salesforce.
#Srilakshmi B S
If you want to download the file as HTML, you'll have to take the file and send it to the Box View service/API for conversion. The Box content API doesn't by itself allow you to convert documents for preview and download into HTML. That means that you'll need two separate tokens if using both API endpoint. If you are in fact planning to use both, there's some documentation here on how:
https://developers.box.com/using-the-view-api-with-the-content-api/

Converting Blob object to html in google app

I have stored user uploaded document (.doc ,.pdf) as a Blob object into data-store.
Instead of allowing user to download the document, I would like to present it as an HTML page
for viewing the doc. how do I convert Blob into HTML ? does google app engine provides any ready made API for the same?
There is no ready made API in AppEngine to convert .doc or .pdf (or or other types of) files to HTML. You would need to find a library for your preferred language to parse the blob file into its parts structured as an object model (like a DOM). Then you would need to write code to convert individual parts of the object model to HTML, unless you are lucky enough to find another library. And no, StackOverflow is not a good place to ask "what library is there...".
No. AppEngine itself does not provide any file format conversion tools. You might want to look into Google Drive API, which might, to some extent, do the format conversion for you.
You can have embed a PDF reader on a web page by using pdf.js.
Most browsers already have a built-in PDF viewer. If you provide a link to a PDF file, when users click on it, many browsers will automatically display the document. Those browsers that do not support this option, will offer a user to download the file to their hard-drive.
This is the easiest solution - you don't have to do anything at all.

How Can I get the raw URL of the uploaded media file?

I have a media field through which I both embed video files from Youtube and upload videos to. I do only want to get the raw URL of the uploaded/embedded videos through the views module but I can't manage it. There are predefined formatters for the video field in the view UI, however the link formatter prints additional data that I don't need. How can I get the raw URL only?
Thanks!
The module below lets you manipulate the view using php.
http://drupal.org/project/views_php

Resources