You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zeppelin.apache.org by Madhuka <gi...@git.apache.org> on 2016/03/07 11:37:44 UTC

[GitHub] incubator-zeppelin pull request: [ZEPPELIN-157] GAdding Map Visual...

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 <ma...@gmail.com>
Date:   2016-03-07T09:25:33Z

    adding leaflet

commit e34337415431b301d6a4406f7316a25b49898a66
Author: madhuka <ma...@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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-zeppelin pull request: [ZEPPELIN-157] Adding Map Visuali...

Posted by felixcheung <gi...@git.apache.org>.
Github user felixcheung commented on the pull request:

    https://github.com/apache/incubator-zeppelin/pull/765#issuecomment-215224988
  
    @Madhuka let us know if we could help!


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-zeppelin pull request: [ZEPPELIN-157] Adding Map Visuali...

Posted by Madhuka <gi...@git.apache.org>.
Github user Madhuka commented on the pull request:

    https://github.com/apache/incubator-zeppelin/pull/765#issuecomment-196011931
  
    1. You have do it from script for now. (more thing we can add later as you explain)
    
    2. It is not  about embeds a leaflet div into a paragraph.[This](https://www.youtube.com/watch?v=7TsKmJd_nes) will help you to understand map tutorial


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-zeppelin pull request: [ZEPPELIN-157] Adding Map Visuali...

Posted by corneadoug <gi...@git.apache.org>.
Github user corneadoug commented on the pull request:

    https://github.com/apache/incubator-zeppelin/pull/765#issuecomment-197129759
  
    * Too many logs in the console, we got to turn them off:
    https://github.com/tombatossals/angular-leaflet-directive/issues/1026
    * The Resize handle is hidden by the map, so I can't resize it
    * The extend height is throwing an error:
    <img width="742" alt="screen shot 2016-03-16 at 12 07 57 pm" src="https://cloud.githubusercontent.com/assets/710411/13800798/d39080b0-eb6f-11e5-8626-2234b2ee7c92.png">
    
    * Also an hashkey error:
    <img width="380" alt="screen shot 2016-03-16 at 12 08 16 pm" src="https://cloud.githubusercontent.com/assets/710411/13800800/d6f17606-eb6f-11e5-8d96-934a8178540c.png">



---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-zeppelin pull request: [ZEPPELIN-157] Adding Map Visuali...

Posted by randerzander <gi...@git.apache.org>.
Github user randerzander commented on the pull request:

    https://github.com/apache/incubator-zeppelin/pull/765#issuecomment-195813797
  
    How to specify which columns should be used for lat/long/description? Should there be a settings option we can use like other charts have?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-zeppelin pull request: [ZEPPELIN-157] Adding Map Visuali...

Posted by ankurmitujjain <gi...@git.apache.org>.
Github user ankurmitujjain commented on the pull request:

    https://github.com/apache/incubator-zeppelin/pull/765#issuecomment-207391542
  
    @Madhuka any update on this?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-zeppelin pull request: [ZEPPELIN-157] Adding Map Visuali...

Posted by randerzander <gi...@git.apache.org>.
Github user randerzander commented on the pull request:

    https://github.com/apache/incubator-zeppelin/pull/765#issuecomment-197093663
  
    @corneadoug @prabhjyotsingh any additional comments? Several people waiting to use and build on top of this PR once it merges.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---