Download the Kiva toolbar! - (what's this?)

May 24, 2012, 03:29:18 PM *
Welcome, Guest. Please login or register (it's quick and free!) for full access to all community features and functions, including instant messaging and message viewing preferences.

Login with username, password and session length

Cool Forum Options
: Not available. Login or register :)
: Popular Topics on Kiva Friends

Kivapedia
: View recent changes on Kivapedia
: Online shopping that helps support Kiva
: List of Kiva microfinance institutions
: List of Kiva group lenders
: Kiva Timeline : More...


.
Welcome to Kiva Friends, an active community for Kiva users, staff and supporters. Don't know what Kiva is? Read this!
   
   Home   Search Calendar Help Tags Login Register  

Pages: [1] 2  All   Go Down
  Bookmark This  |  E-Mail This  |  Print It  
Author Topic: Embedable Kiva Maps  (Read 4501 times)
0 Members and 1 Guest were last seen viewing this topic.
michaellindahl
Kiva Supporter
**
Posts: 12


View Profile
« on: May 24, 2009, 07:36:58 PM »

I really want to have a map show where I have loaned on my website.  How can I get the map on my lender page to be on my website?


UPDATE: I did it Smiley  Credit to Christopher who's work I replied on (http://cjw.me.uk/mykiva-loan-map/)

1.) Get editgrid account, and Save As.. this page to your account   http://www.editgrid.com/user/michaellindahl/My_Kiva_Loans_-_Take_2/
2.) Update My Loans tab with Get Kiva export on Summary Tab
3.) Edit Setting tab (Everything but Map factor)
4.) Make sure the API key is for the URL/domain the map is going on
4.) Update the Add. Info with copy and paste from your loans, edit location info (this set may be unnecessary)
5.) Drag and Drop Image off your Kiva userpage, rename to be ###.png (may use automator action to make faster if on a Mac) (also optional)
6.) Click on Editgrid Kiva Loan 'Homepage'  the Map should look good
7.) Take the page contents, by using Develop>Show Web Inspector>Resources>Index Page (in Safari) or other method.'
8.) Put on your site and go through code to take out the side bar
« Last Edit: May 26, 2009, 09:30:27 PM by michaellindahl » Logged
saabnet
Kiva Supporter
San Francisco Bay Area
*****
Gender: Male
Posts: 972


Poverty2Prosperity.org

View Profile
WWW
« Reply To This #1 on: May 24, 2009, 08:02:18 PM »

I really want to have a map show where I have loaned on my website.  How can I get the map on my lender page to be on my website?

I think the easiest way is going to be to take a screenshot of your loan page in map view and then embed that image in your website, updating every so often as you make new loans. I've embedded mine here as an example (using the attach feature).

-Scott


* saabnetloans.jpg (54.42 KB, 801x504 - viewed 74 times.)
Logged

michaellindahl
Kiva Supporter
**
Posts: 12


View Profile
« Reply To This #2 on: May 24, 2009, 08:13:08 PM »

I think the easiest way is going to be to take a screenshot of your loan page in map view and then embed that image in your website, updating every so often as you make new loans. I've embedded mine here as an example (using the attach feature).

-Scott

Thats actually not a bad idea, however I am not the easy type of guy.  I will do that for the time being tho.  Christopher has found the exact type of thing that I am looking for here: http://cjw.me.uk/mykiva-loan-map/   I have started to do this on my own using editgrid.com (username: michaellindahl) However I don't believe it is working as when I click on Editgrid Kiva Loan 'Homepage it says "The Google Maps API server rejected your request.  This could be because the API key used on this site was registered for a different web site.  You can generate a new key for this web site at %1$s."  I have the API registered to michaellindahl.com because that is where the map is going to be.

Chris any help??
Logged
tomviolence
Kiva Supporter
Movin' to Florida
*****
Gender: Male
Posts: 336


A mile and a half on a bus takes a long time

View Profile
« Reply To This #3 on: May 24, 2009, 08:15:07 PM »

I looked at the source. I assume if you did not look at the source, coding java on your page might be difficult. Since it is dynamic - (Meaning it needs to look at your page to see what is there) -it might be hard to translate that to a different website.

I am not a web programer, so I am not sure how easily you could re-write the java to pull from your lender page to update your website. There is a query function you could rework.

A simpler way to do it would be create a frame on your site, and embed your lender page it.

The absolute easiest would be do a print screen and save the jpg to post as a static image.

The API is http://www.phpinsider.com/php/code/GoogleMapAPI/
Logged

"Famines will be famines, banquets will be banquets
Some spend winter in a palace, some spend it in blankets
Dont wag your fingers at them and turn to walk away
Dont shoot someone tomorrow that you can shoot today
Time to end the praying
Listen what they're saying"

The Housemartins - "Get up off your knees" - from "London 0 Hull 4"
michaellindahl
Kiva Supporter
**
Posts: 12


View Profile
« Reply To This #4 on: May 24, 2009, 08:26:23 PM »

I looked at the source. I assume if you did not look at the source, coding java on your page might be difficult. Since it is dynamic - (Meaning it needs to look at your page to see what is there) -it might be hard to translate that to a different website.

I am not a web programer, so I am not sure how easily you could re-write the java to pull from your lender page to update your website. There is a query function you could rework.

A simpler way to do it would be create a frame on your site, and embed your lender page it.

The absolute easiest would be do a print screen and save the jpg to post as a static image.

The API is http://www.phpinsider.com/php/code/GoogleMapAPI/

Yea I did look at the source code and I knew I couldn't just copy and paste, as I tried that failed because I didn't know what I needed. I screen capture would be the easiest, as I stated earlier, and I am looking for a dynamic map, so easy won't be the route I am taking... I am going to do what Chris did however I have hit a snap, and hope Chris will show up and help me...
Logged
tomviolence
Kiva Supporter
Movin' to Florida
*****
Gender: Male
Posts: 336


A mile and a half on a bus takes a long time

View Profile
« Reply To This #5 on: May 24, 2009, 08:35:17 PM »

he is using a wordpress plugin from

http://avi.alkalay.net/2006/11/google-maps-plugin-for-wordpress.html

which tells you to register your API key at: http://code.google.com/apis/maps/signup.html

If you aren't using wordpress - might not work .......
Logged

"Famines will be famines, banquets will be banquets
Some spend winter in a palace, some spend it in blankets
Dont wag your fingers at them and turn to walk away
Dont shoot someone tomorrow that you can shoot today
Time to end the praying
Listen what they're saying"

The Housemartins - "Get up off your knees" - from "London 0 Hull 4"
michaellindahl
Kiva Supporter
**
Posts: 12


View Profile
« Reply To This #6 on: May 24, 2009, 09:09:05 PM »

he is using a wordpress plugin from

http://avi.alkalay.net/2006/11/google-maps-plugin-for-wordpress.html

which tells you to register your API key at: http://code.google.com/apis/maps/signup.html

If you aren't using wordpress - might not work .......


I believe I can embed it with something like this: http://www.takitwithme.com/embed.html

However my problem now is that I cannot get the Editgrid Kiva Loan 'Homepage to show my loans, for some reason this is not working.  I have used the API Key for michaellindahl.com and editgrid.com/user/michaellindahl (both act same, but editgrid doesn't have google pop up and say you need a good API key..)
http://www.editgrid.com/user/michaellindahl/Kiva_Loans-no_additional_data


UPDATE: Since I cut data it was smart and linked to the old stuff and not my loans, it is almost perfect.  I Had to reput "='My loans'!G2/'My loans'!F2" into the Percent Paid field on the KML tab.  Also had to add another row on KML tab

I want the map to look like chris's where the bubble are green and if there is a lot of loans in one area it will say (I have three loans to Peru and it looks like one now)  Also on the front page the # of Loans doesn't show up.


NEED ANSWERS TO:
1 # of loans on front page doesn't show up Is that important?
2 Map to be green bubbles with number of loans in area?
3 How do i embed on my iWeb site?
« Last Edit: May 24, 2009, 09:51:39 PM by michaellindahl » Logged
Christopher
Kiva Supporter
London
*****
Gender: Male
Posts: 449



View Profile
WWW
« Reply To This #7 on: May 25, 2009, 07:31:19 AM »

Chris any help??

Hi, a few pointers to get you up and running...
While I am using WordPress and various plugins this is not necessary to get the Editgrid map into a webpage hosted by yourself.
You need to get it up and running in Editgrid first - take care to make sure you have published your spreadsheet (so that the data can then be pulled by your website for use), and that the data is in the correct format when you paste it in (the Kiva export format has changed quite a bit since I wrote all of the bits and pieces, and some of the names of entrepreneurs don't paste very well and can stop things working - if you see any strange characters in the excel spreadsheet delete them first before pasting).

When you have a working Editgrid spreadsheet you then need to work on a page to display it on your website.
It needs something like the following code in the head section (of course you need to change it to your Editgrid spreadsheet and the Google API Key needs to be for your site):
Code:
    <link rel="exhibit/data" type="application/jsonp"
    href="http://www.editgrid.com/user/cweddell/My_Kiva_Loans.exhibit.jsonp.xsl"
  ex:jsonp-callback="editgridCallback" />

    <script src="http://static.simile.mit.edu/exhibit/api-2.0/exhibit-api.js"
        type="text/javascript"></script>
    <script src="http://static.simile.mit.edu/exhibit/extensions-2.0/time/time-extension.js"
        type="text/javascript"></script>
   <script src="http://static.simile.mit.edu/exhibit/extensions-2.0/map/map-extension.js?gmapkey=ABQIAAAAFrXIFYaXR106t_pQnPLo1hQjFBJcbMRHtccPiXxL2U5Hp7ZBIBR9d1CjbfWhjjmqYnkMAA1-5qhUIQ"
       type="text/javascript"></script>

Then something like the following needs to be in the body:
Code:
<div id="exhibit-loan">
                <div ex:role="coder" ex:coderClass="Color" id="item-colors" style="display: none">
                    <span ex:color="#800517">Active</span>
                    <span ex:color="#437C17">Raised</span>
                    <span ex:color="#000000">PaidBack</span>
                    <span ex:color="#E8A317">Fundraising</span>
                    <span ex:color="white">Defaulted</span>
                    <span ex:color="white">Refunded</span>
                </div>
   <table width="100%">
       <tr valign="top">
           <td colspan="3"><h1>My Kiva Loans</h1></td>                   
           <td><a href="javascript:unhide('hiderow');">Show filters</a> or Search: <div ex:role="facet" ex:facetClass="TextSearch"></div></td>
           </tr>
       </table>
          <table width="100%" id="hiderow" class="hidden">     
           <tr valign="top">
             <td width="25%"><div ex:role="facet" ex:expression=".Country" ex:facetLabel="Country" ex:showMissing="false"></div></td>
             <td width="25%"><div ex:role="facet" ex:expression=".Status" ex:facetLabel="Status" ex:showMissing="false"></div></td>
             <td width="25%"><div ex:role="facet" ex:expression=".Activity" ex:facetLabel="Activity" ex:showMissing="false"></div></td>
             <td width="25%"><div ex:role="facet" ex:expression=".Due" ex:facetLabel="Due (Year-Month)" ex:showMissing="false"></div></td>
           </tr>
                  </table>
              <table width="100%">
           <tr valign="top">
           <td colspan="4" ex:role="viewPanel">
               <table ex:role="lens" class="nobelist" style="display: none">
                   <tr>
                       <td>
                       <img width="100" height="100" ex:src-content=".imageURL" />
                       </td>
                       <td width="350px">
                       <a ex:href-subcontent="http://www.kiva.org/app.php?page=businesses&action=about&id={{.BusinessID}}" target="_blank"><span style="text-alight:left;" ex:content=".label"></span></a><br />
                       <span ex:content=".location"></span><br />
                       MFI: <span ex:content=".Partner"></span><br />
                       Status: <b ex:content=".Status"></b><br />
                       Loan amount: <span ex:content=".loan_amount"></span><br />
                       Percentage repaid: <span ex:content=".percent_paid_back"></span>     
                       </td>
                       <td width="250px">
                       <br />
                       Start: <span ex:content=".start"></span>&nbsp;for&nbsp;<span ex:content=".Term"></span>&nbsp;months<br />
                       Activity: <span ex:content=".Activity"></span>&nbsp;-&nbsp;<span ex:content=".loan_use"></span><br />
                       <br />
                       </td>
                   </tr>
               </table>
              <!--map-->
              <div ex:role="view"
                   ex:viewClass="Map"
                   ex:latlng=".latlng"
                   ex:showSummary="false"
                   ex:mapHeight="600"
                   ex:showFooter="false"
                   ex:color="#669933">
       <table ex:role="lens" class="nobelist" style="display: none">
           <tr>
               <td>
               <img width="100" height="100" ex:src-content=".imageURL" />
               </td>
               <td>
               <a ex:href-subcontent="http://www.kiva.org/app.php?page=businesses&action=about&id={{.BusinessID}}" target="_blank"><span style="text-alight:left;" ex:content=".label"></span></a><br />
               <span ex:content=".location"></span><br />
               Status: <b ex:content=".Status"></b><br />
               Activity: <span ex:content=".Activity"></span>&nbsp;-&nbsp;<span ex:content=".loan_use"></span><br />
               </td>
           </tr>
       </table>
              </div>
              <!--tiles-->
              <div ex:role="view"
                  ex:orders=".BusinessID"
                  ex:directions="descending"
                  ex:showAll="false"
                  ex:abbreviatedCount="10"
                  ex:possibleOrders=".Country, .Activity, .Partner, .Due, .Status, .Term, .BusinessID">
              </div>
              <!--timeline-->
              <div ex:role="view"
                   ex:viewClass="Timeline"
                   ex:start=".start"
                   ex:end=".finish"
                   ex:showSummary="false"
                   ex:colorKey=".Status"
                   ex:timelineHeight="2000"
                   ex:topBandHeight="99"
                   ex:bottomBandHeight="1"
                   ex:bottomBandPixelsPerUnit="100"
                   ex:topBandUnit="year"
                   ex:colorCoder="item-colors">
       <table ex:role="lens" class="timelist" style="display: none">
           <tr>
               <td>
               <img width="100" height="100" ex:src-content=".imageURL" />
               </td>
               <td>
               <a ex:href-subcontent="http://www.kiva.org/app.php?page=businesses&action=about&id={{.BusinessID}}" target="_blank"><span style="text-alight:left;" ex:content=".label"></span></a><br />
               <span ex:content=".location"></span><br />
               Status: <b ex:content=".Status"></b><br />
               Start: <span ex:content=".start"></span>&nbsp;for&nbsp;<span ex:content=".Term"></span>&nbsp;months<br />
               Activity: <span ex:content=".Activity"></span>&nbsp;-&nbsp;<span ex:content=".loan_use"></span><br />
               </td>
           </tr>
       </table>
              </div>
            </td>
       </tr>
   </table>
   </div>

This is only a quick cut and paste from the source of http://cjw.me.uk/mykiva-loan-map/ so might not work out of the box and will probably need a bit of hacking around with - as I never updated it using the cleaner code.

Hope this helps
Christopher
Logged

If you think you're too small to make a difference try sleeping in a closed room with a mosquito, or give kiva.org a try.
michaellindahl
Kiva Supporter
**
Posts: 12


View Profile
« Reply To This #8 on: May 25, 2009, 10:58:33 AM »

Hi, a few pointers to get you up and running...
While I am using WordPress and various plugins this is not necessary to get the Editgrid map into a webpage hosted by yourself.
You need to get it up and running in Editgrid first - take care to make sure you have published your spreadsheet (so that the data can then be pulled by your website for use), and that the data is in the correct format when you paste it in (the Kiva export format has changed quite a bit since I wrote all of the bits and pieces, and some of the names of entrepreneurs don't paste very well and can stop things working - if you see any strange characters in the excel spreadsheet delete them first before pasting).

When you have a working Editgrid spreadsheet you then need to work on a page to display it on your website.
It needs something like the following code in the head section (of course you need to change it to your Editgrid spreadsheet and the Google API Key needs to be for your site):
Code:
    <link rel="exhibit/data" type="application/jsonp"
    href="http://www.editgrid.com/user/cweddell/My_Kiva_Loans.exhibit.jsonp.xsl"
  ex:jsonp-callback="editgridCallback" />

    <script src="http://static.simile.mit.edu/exhibit/api-2.0/exhibit-api.js"
        type="text/javascript"></script>
    <script src="http://static.simile.mit.edu/exhibit/extensions-2.0/time/time-extension.js"
        type="text/javascript"></script>
   <script src="http://static.simile.mit.edu/exhibit/extensions-2.0/map/map-extension.js?gmapkey=ABQIAAAAFrXIFYaXR106t_pQnPLo1hQjFBJcbMRHtccPiXxL2U5Hp7ZBIBR9d1CjbfWhjjmqYnkMAA1-5qhUIQ"
       type="text/javascript"></script>

Then something like the following needs to be in the body:
Code:
<div id="exhibit-loan">
                <div ex:role="coder" ex:coderClass="Color" id="item-colors" style="display: none">
                    <span ex:color="#800517">Active</span>
                    <span ex:color="#437C17">Raised</span>
                    <span ex:color="#000000">PaidBack</span>
                    <span ex:color="#E8A317">Fundraising</span>
                    <span ex:color="white">Defaulted</span>
                    <span ex:color="white">Refunded</span>
                </div>
   <table width="100%">
       <tr valign="top">
           <td colspan="3"><h1>My Kiva Loans</h1></td>                   
           <td><a href="javascript:unhide('hiderow');">Show filters</a> or Search: <div ex:role="facet" ex:facetClass="TextSearch"></div></td>
           </tr>
       </table>
          <table width="100%" id="hiderow" class="hidden">     
           <tr valign="top">
             <td width="25%"><div ex:role="facet" ex:expression=".Country" ex:facetLabel="Country" ex:showMissing="false"></div></td>
             <td width="25%"><div ex:role="facet" ex:expression=".Status" ex:facetLabel="Status" ex:showMissing="false"></div></td>
             <td width="25%"><div ex:role="facet" ex:expression=".Activity" ex:facetLabel="Activity" ex:showMissing="false"></div></td>
             <td width="25%"><div ex:role="facet" ex:expression=".Due" ex:facetLabel="Due (Year-Month)" ex:showMissing="false"></div></td>
           </tr>
                  </table>
              <table width="100%">
           <tr valign="top">
           <td colspan="4" ex:role="viewPanel">
               <table ex:role="lens" class="nobelist" style="display: none">
                   <tr>
                       <td>
                       <img width="100" height="100" ex:src-content=".imageURL" />
                       </td>
                       <td width="350px">
                       <a ex:href-subcontent="http://www.kiva.org/app.php?page=businesses&action=about&id={{.BusinessID}}" target="_blank"><span style="text-alight:left;" ex:content=".label"></span></a><br />
                       <span ex:content=".location"></span><br />
                       MFI: <span ex:content=".Partner"></span><br />
                       Status: <b ex:content=".Status"></b><br />
                       Loan amount: <span ex:content=".loan_amount"></span><br />
                       Percentage repaid: <span ex:content=".percent_paid_back"></span>     
                       </td>
                       <td width="250px">
                       <br />
                       Start: <span ex:content=".start"></span>&nbsp;for&nbsp;<span ex:content=".Term"></span>&nbsp;months<br />
                       Activity: <span ex:content=".Activity"></span>&nbsp;-&nbsp;<span ex:content=".loan_use"></span><br />
                       <br />
                       </td>
                   </tr>
               </table>
              <!--map-->
              <div ex:role="view"
                   ex:viewClass="Map"
                   ex:latlng=".latlng"
                   ex:showSummary="false"
                   ex:mapHeight="600"
                   ex:showFooter="false"
                   ex:color="#669933">
       <table ex:role="lens" class="nobelist" style="display: none">
           <tr>
               <td>
               <img width="100" height="100" ex:src-content=".imageURL" />
               </td>
               <td>
               <a ex:href-subcontent="http://www.kiva.org/app.php?page=businesses&action=about&id={{.BusinessID}}" target="_blank"><span style="text-alight:left;" ex:content=".label"></span></a><br />
               <span ex:content=".location"></span><br />
               Status: <b ex:content=".Status"></b><br />
               Activity: <span ex:content=".Activity"></span>&nbsp;-&nbsp;<span ex:content=".loan_use"></span><br />
               </td>
           </tr>
       </table>
              </div>
              <!--tiles-->
              <div ex:role="view"
                  ex:orders=".BusinessID"
                  ex:directions="descending"
                  ex:showAll="false"
                  ex:abbreviatedCount="10"
                  ex:possibleOrders=".Country, .Activity, .Partner, .Due, .Status, .Term, .BusinessID">
              </div>
              <!--timeline-->
              <div ex:role="view"
                   ex:viewClass="Timeline"
                   ex:start=".start"
                   ex:end=".finish"
                   ex:showSummary="false"
                   ex:colorKey=".Status"
                   ex:timelineHeight="2000"
                   ex:topBandHeight="99"
                   ex:bottomBandHeight="1"
                   ex:bottomBandPixelsPerUnit="100"
                   ex:topBandUnit="year"
                   ex:colorCoder="item-colors">
       <table ex:role="lens" class="timelist" style="display: none">
           <tr>
               <td>
               <img width="100" height="100" ex:src-content=".imageURL" />
               </td>
               <td>
               <a ex:href-subcontent="http://www.kiva.org/app.php?page=businesses&action=about&id={{.BusinessID}}" target="_blank"><span style="text-alight:left;" ex:content=".label"></span></a><br />
               <span ex:content=".location"></span><br />
               Status: <b ex:content=".Status"></b><br />
               Start: <span ex:content=".start"></span>&nbsp;for&nbsp;<span ex:content=".Term"></span>&nbsp;months<br />
               Activity: <span ex:content=".Activity"></span>&nbsp;-&nbsp;<span ex:content=".loan_use"></span><br />
               </td>
           </tr>
       </table>
              </div>
            </td>
       </tr>
   </table>
   </div>

This is only a quick cut and paste from the source of http://cjw.me.uk/mykiva-loan-map/ so might not work out of the box and will probably need a bit of hacking around with - as I never updated it using the cleaner code.

Hope this helps
Christopher

Okay So that did help, I took that spreadsheet and edited to my needs and now my map looks better!! Smiley Smiley Smiley
Before with the one that has instructions: http://www.editgrid.com/user/michaellindahl/Kiva_Loans-no_additional_data.myloansexhibit.html
After, editing your personal one: http://www.editgrid.com/user/michaellindahl/My_Kiva_Loans_-_Take_2.myloansexhibit.html

Okay What I did to make it work, I took your personal editgrid spreadsheet replaced it with my data, looked at the EditGrid Kiva Loan Homepage, took that code and took off all the stuff that made up the side bar and poof! Its running on my site Thumbs Up Thanks!
http://www.michaellindahl.com/Site/Kiva.html
Logged
tomviolence
Kiva Supporter
Movin' to Florida
*****
Gender: Male
Posts: 336


A mile and a half on a bus takes a long time

View Profile
« Reply To This #9 on: May 25, 2009, 11:24:03 AM »

not working for me -


Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; InfoPath.2; .NET CLR 3.5.30729; .NET CLR 3.0.30618)
Timestamp: Mon, 25 May 2009 16:21:42 UTC


Message: Syntax error
Line: 1
Char: 2
Code: 0
URI: http://www.editgrid.com/user/michaellindahl/My_Kiva_Loans_-_Take_2.exhibit.jsonp.xsl

Logged

"Famines will be famines, banquets will be banquets
Some spend winter in a palace, some spend it in blankets
Dont wag your fingers at them and turn to walk away
Dont shoot someone tomorrow that you can shoot today
Time to end the praying
Listen what they're saying"

The Housemartins - "Get up off your knees" - from "London 0 Hull 4"
Pages: [1] 2  All   Go Up
  Bookmark This  |  E-Mail This  |  Print It  
 
Jump to:  

 
Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC
Thanks to PixelSlot
Valid XHTML 1.0! Valid CSS!
Page created in 0.992 seconds with 23 queries.