Skip to content

CityOfBoston/represent-map

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 

Repository files navigation

represent-map

Visualize your local tech startup community on a custom Google Map. Host everything locally on your own server, or optionally show data from Startup Genome (http://www.startupgenome.com).

About RepresentMap

You can use RepresentMap to setup a website that visualizes your local startup community on a custom Google map.

This code first came from http://represent.la, our map of the Los Angeles startup community. The response was extremely positive, so we decided to spread the love and share the code with other startup communities. Let's visualize the world's startups together!

RepresentMap was created by:

Requirements

  • PHP5
  • MySQL

Installation

Setup should be super easy. Follow these steps:

  1. Create a new MySQL database and user.
  2. Use phpMyAdmin or another MySQL utility to run the newest "places" and "settings" SQL files in the /db directory.
  3. Open /include/db_example.php with your text editor. Enter your MySQL credentials in there. Also, replace "letsgetmappy" with a new password for the admin panel. Rename the file to "db.php".
  4. Upload all of the files to your server.
  5. You'll probably want to comb through index.php with your favorite text editor and replace all the RepresentLA content (logo, "more info" text, Twitter/Facebook share buttons, etc.) with your own stuff.
  6. Populate your database. We recommend seeding it with some existing data before opening it up to your local community. You can add markers by using the button on the map page, or by importing them with an SQL query. If you use an SQL query, note that you should leave the lat/long values blank when importing. Then, run geocode.php to automatically generate lat/long values for all your rows.
  7. Once visitors to your site have submitted their own markers, point your browser to /admin to approve/reject them.
  8. Challenge your newly-discovered neighbors to ping pong!

Setting up on Heroku

Register for Heroku.

gem install heroku
git clone git@github.com:CityOfBoston/represent-map.git

Go to the main directory of this project

cd represent-map

Edit index.php with your city name, social media links, map view, etc. Replace images/logo.png with your logo.

Create your app and attach a free MySQL instance from ClearDB

heroku create APP_NAME_GOES_HERE
heroku addons:add cleardb:ignite

Get the MySQL URL from ClearDB

heroku config

In include/db.php, set variables from the URL. The MySQL URL should have format mysql://USERNAME:PASSWORD@HOSTNAME/DATABASENAME?reconnect=true

Also set $admin_user and $admin_pass in include/db.php

Now push the app to Heroku and view:

git add .
git commit -m "commit messages"
git push heroku master
heroku open

Setting up on AppFog

Simple instructions for free PHP and MySQL hosting on AppFog:

Register for AppFog, create an app, go to the 'Services' panel, and add MySQL with a memorable name such as 'my-mysqldb'.

Download this repo, AppFog, and tunneling tool Caldecott

git clone git@github.com:CityOfBoston/represent-map.git
gem install af
af login
gem install caldecott

Go to the main directory of this project

cd represent-map

Edit index.php with your city name, social media links, map view, etc.

Replace images/logo.png with your logo.

Set $admin_user and $admin_pass in include/db.php - the rest are imported from AppFog's VCAP_SERVICES environment variable.

Push the code to the AppFog app server

af update

Test the server by visiting the homepage.

You're not done yet! Configure the database with these steps:

af tunnel
(when asked to select a service, select my-mysqldb or whatever you put in for name)
(when asked to connect to mysql, mysqldump, or none, select mysql)

In the MySQL command line, paste the contents of db/settings_1.sql, then press enter. Repeat for db/places_2.sql ( db/places_3.sql if you're using Startup Genome ) and db/events_1.sql ( even if you're not adding events ).

Test the database by going to the homepage and adding a location.

Startup Genome Integration (optional)

Startup Genome is a project that "enables local startup communities to collect, curate, and display their city's data anyway they want." Integrating your map with Startup Genome will allow people to keep their profile updated over time and it's a great way to show the rest of the world what's happening in your startup community. There's also nice interface that lets you and other curators manage your map data.

If you want to pull your map data from Startup Genome, check out the settings in your db.php. Complete instructions are provided there.

Learn more about Startup Genome here: http://www.startupgenome.com

EventBrite Integration (optional)

You can automatically show local events in your community on your map! Just follow these steps:

  1. Make sure you've configured your "db.php" with your Eventbrite API key and search parameters.
  2. Use phpMyAdmin or another MySQL utility to run the newest "events" SQL file in the /db directory.
  3. Run "events_get.php" in your browser anytime you want to get new events. By default, events should be displayed on your map up to 1 month before their start date.
  4. If you want this script to run automatically (once a day would make sense), you can setup a chron on your server. If you don't know how to do that, ask your hosting provider.

License

RepresentMap uses the Creative Commons Attribution-ShareAlike 2.0 Generic (CC BY-SA 2.0) License. Your use of this code and all associated materials is bound by the terms of this license. For full information, please see this website: http://creativecommons.org/licenses/by-sa/2.0/

Attribution: The "Based on RepresentLA" text and link must be left intact and visible on your map unless you've been given explicit, written permission from any of the creators to remove it.

Useful Links

GitHub project: https://github.com/abenzer/represent-map Represent.LA twitter: http://www.twitter.com/representla

Releases

No releases published

Packages

No packages published

Languages

  • CSS 36.1%
  • JavaScript 33.4%
  • PHP 30.5%