Closed Thread
Results 1 to 2 of 2

Thread: PHP: simple KML file generator

  1. #1
    Join Date
    Aug 2007
    Location
    Gizeh, Al Jizah, Egypt, Egypt
    Posts
    8,675
    Blog Entries
    12
    Rep Power
    81

    PHP: simple KML file generator

    hi guys,
    this is something i made tonight for work. i figured it would be useful for others around here

    whats KML?
    KML file is what google earth uses to store placemarks and other stuff, so if you need to share place marks with others you make a KML file and give it to them
    read more about KMLs here it has much more uses than just storing place marks

    what does this script do?
    this script simply takes some arguments about the KML you want to generate and sends it as a file to download or text to view in browser

    how can i use it?
    i made it in half an hour so its not finished but its working fine.
    it takes 3 arguments
    1-array of place marks that looks like this:
    Code:
    array(
         array(
            'name'=>'my place mark 1' ,   //name/title of the place mark
            'desc'=>'this is my home',      // the description that pops up when you open it
            'coordinates'=>'102.594411,14.998518'   
         )
    ,
        array(
            'name'=>'my place mark 2' , 
            'desc'=>'this is another point',     
            'coordinates'=>'102.594411,14.9983'   
         )
    );
    2. true /false: true means you want the output as a file which will propmt a download(used Jann method)
    3. the file name, make sure it ends with ".kml";

    sample usage:
    Code:

    generatekml
    (
    array(
    array(
    'name'=>'sample point 1',
    'desc'=>'this is <h3>HTML</h3> text',
    'coordinates'=>'102.594411,14.998518'
    )
    ,
    array(
    'name'=>'sample point 2',
    'desc'=>'this is another <h3>HTML</h3> text',
    'coordinates'=>'101.594411,14.998518'
    )
    )
    ,
    true,"test.kml"
    ); 
    +REP me if you like it
    screenshot:
    Attached Thumbnails Attached Thumbnails PHP: simple KML file generator-sample.jpg  
    Attached Files Attached Files
    yo homie i heard you like one-line codes so i put a one line code that evals a decrypted one line code that prints "i love one line codes"
    Code:
    eval(base64_decode("cHJpbnQgJ2kgbG92ZSBvbmUtbGluZSBjb2Rlcyc7"));
    www.amrosama.com | the unholy methods of javascript

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Location
    Advertising world
    Posts
    Many

     
  3. #2
    Jordan Guest

    Re: PHP: simple KML file generator

    Very cool! That could come in handy.

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Simple file uploader
    By Jacki in forum PHP Tutorials
    Replies: 3
    Last Post: 06-27-2010, 11:14 AM
  2. Making a simple Key Generator.
    By Donovan in forum Visual Basic Tutorials
    Replies: 2
    Last Post: 04-25-2009, 04:53 AM
  3. Replies: 1
    Last Post: 01-09-2009, 05:51 AM
  4. Help a noob with a simple .bat file. =)
    By s4nt0s123 in forum General Programming
    Replies: 7
    Last Post: 10-16-2008, 11:00 AM
  5. HELP with simple ASM file.
    By Steve.L in forum General Programming
    Replies: 1
    Last Post: 09-25-2008, 06:40 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts