Browse files

Tidy up formatting

  • Loading branch information...
1 parent 6ed8fa9 commit d7bf487fd7427417b5d0ae6ddac17e5c583745de Pat Patterson committed Jan 30, 2012
Showing with 13 additions and 7 deletions.
  1. +13 −7 README.markdown
View
20 README.markdown
@@ -1,19 +1,21 @@
Introduction
============
-GoogleStaticMap.cls makes it easy to interact with the [Google Static Map API v2](http://code.google.com/apis/maps/documentation/staticmaps/) from a Force.com application. The class is self contained with no external dependencies.
+GoogleStaticMap.cls makes it easy to interact with the [Google Static Map API v2](http://code.google.com/apis/maps/documentation/staticmaps/) from a [Force.com](http://www.force.com/) application. The class is self contained with no external dependencies.
Simple Example
--------------
If you're OK with default formatting, you can request a map with only one or two lines of code.
-In your Apex controller:
+**In your Apex controller:**
+
```
String[] afcEastCities = new String[]{'Boston, MA','New York, NY','Buffalo, NY','Miami,FL'};
String afcEastMapUrl = new GoogleStaticMap().addMarkers(afcEastCities).url;
```
-In your Visualforce Page:
+**In your Visualforce Page:**
+
```
<apex:image value="{!afcEastMapUrl}" />
```
@@ -24,7 +26,8 @@ Use Custom Icons
----------------
The formatting can be controlled at the lowest level if you need to communicate more detail or would like to implement a specific design.
-In your Apex controller:
+**In your Apex controller:**
+
```
GoogleStaticMap.MapMarker dolphins = new GoogleStaticMap.MapMarker('Miami, FL').icon('http://goo.gl/2pFtB');
GoogleStaticMap.MapMarker bills = new GoogleStaticMap.MapMarker('Buffalo, NY').icon('http://goo.gl/7uRWT');
@@ -33,7 +36,8 @@ GoogleStaticMap.MapMarker patriots = new GoogleStaticMap.MapMarker('Boston, MA')
String afcEastMapUrl = new GoogleStaticMap().addMarkers(new GoogleStaticMap.MapMarker[]{dolphins,bills,jets,patriots}).url;
```
-In your Visualforce Page:
+**In your Visualforce Page:**
+
```
<apex:image value="{!afcEastMapUrl}" />
```
@@ -43,14 +47,16 @@ Draw Paths
----------
Paths can also be drawn, with our without markers and with custom formatting.
-In your Apex controller:
+**In your Apex controller:**
+
```
String[] homes = new String[]{'Albany, NY','Wellesley, MA','New York, NY','Pittsburgh, PA','01945','Ann Arbor, MI','Chicago, IL'};
GoogleStaticMap.MapPath moves = new GoogleStaticMap.MapPath(homes).color('0x000000ff');
String movesUrl = new GoogleStaticMap().addPath(moves).url;
```
-In your Visualforce Page:
+**In your Visualforce Page:**
+
```
<apex:image value="{!movesUrl}">
```

0 comments on commit d7bf487

Please sign in to comment.