GitHub user Madhuka opened a pull request:

    https://github.com/apache/incubator-zeppelin/pull/765

    [ZEPPELIN-157] GAdding Map Visualization for Zeppelin

    ### What is this PR for?
    Adding Map Visualization for Zeppelin using Leaflet[1]
    
    [1] http://leafletjs.com/
    
    
    ### What type of PR is it?
    Improvement
    
    ### Todos
    
    - [x] Checking compatible license 
    - [x] Adding chart library (leafletjs)
    - [x] Adding new button for chart mapping
    - [x] Loading GIS Mapp in Zeppelin
    
    ### What is the Jira issue?
    [ZEPPELIN-157](https://issues.apache.org/jira/browse/ZEPPELIN-157)
    
    ### How should this be tested?
    `import org.apache.commons.io.IOUtils
    import java.net.URL
    import java.nio.charset.Charset
    
    // Zeppelin creates and injects sc (SparkContext) and sqlContext 
(HiveContext or SqlContext)
    // So you don't need create them manually
    
    // load map data
    val myMapText = sc.parallelize(
        IOUtils.toString(
            new 
URL("https://gist.githubusercontent.com/Madhuka/74cb9a6577c87aa7d2fd/raw/2f758d33d28ddc01c162293ad45dc16be2806a6b/data.csv";),
            Charset.forName("utf8")).split("\n"))
            
    case class Map(Country:String, Name:String, lat : Float, lan : Float, 
Altitude : Float)
    
    val myMap = myMapText.map(s=>s.split(",")).filter(s=>s(0)!="Country").map(
        s=>Map(s(0),
               s(1),
               s(2).toFloat,
               s(3).toFloat,
               s(4).toFloat
              )
    )
    
    // Below line works only in spark 1.3.0.
    // For spark 1.1.x and spark 1.2.x,\n// use 
myMap.registerTempTable(\"myMap\") instead.\n
    myMap.toDF().registerTempTable("myMap")`
    
    ### Screenshots (if appropriate)
    Can found in #152 
    
    ### Questions:
    * Does the licenses files need update?No
    * Is there breaking changes for older versions?No
    * Does this needs documentation? #152 contains documentation (I will add 
new doc and sample in new PR)

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/Madhuka/incubator-zeppelin leaflet-map

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-zeppelin/pull/765.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #765
    
----
commit 9f70fd13ca7aed5958bbe45597b4a061b327abac
Author: madhuka <madhukaudan...@gmail.com>
Date:   2016-03-07T09:25:33Z

    adding leaflet

commit e34337415431b301d6a4406f7316a25b49898a66
Author: madhuka <madhukaudan...@gmail.com>
Date:   2016-03-07T10:21:21Z

    adding map visualization for zeppelin

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to