
This image explains how Mapeed works. Your application uses Google Maps to display images maps (Map/Satellite) and
uses Mapeed to display markers.
We need to have to have all POI coordinates (latitude/longitude) on our servers to perform our fast clustering algorithm.
So you need to
synchronize your data
using our web interface or web API.
Then you need to add few line of JavaScript using our API as describe below.
| Description | Map |
|---|---|
The simplest javascript code to display markers and clusters using Mapeed.
With only two lines of code, you have the Mapeed plugin on your map with default Mapeed behavior: When you click on a cluster, Mapeed adapts zoom and position of the to display cluster content. Now, let's see how we can bind a behavior on the click event. |
View full code |
How to bind actions on click for clusters and markers.There are two callbacks on Mapeed.Map object called when a user clicks on a marker or a cluster when zoom in is not possible anymore (markers at the same address). Those callbasks are :
Here is how to use them to open an infoWindow :
View full code
Now, your map is interactive. Let's see how to customize window's content. |
View full code |
Set info window content by Ajax.
Actions are the same as the example above but it runs an Ajax request to get window content.
The code is based on Prototype JavaScript Framework but can be done with any JavaScript framework.
View full code
Well done ! Your map is now enhanced by the Mapeed plugin. Enjoy this unique readability ! |
View full code |
Optional step : customize the design.
Mapeed provides default images for markers and clusters as you can see on our demos.
View full code
|
View full code |
The Mapeed plugin gives you the ability to trigger server-side operations, by simply invoke some javascript methods on the Mapeed JS Classes.
| Function | Description |
|---|---|
|
Constructor
new Mapeed.Map(gmap, options) |
Constructeur of the main Mapeed object.
Paramters are: gmap: Google map object (GMap2 class) options: Hash map of options. Currently it's only 4 callbacks describe in above section "How to integrate Mapeed plugin"
|
| isZoomMax() | Returns true if map cannot be zoom in |
| getMarkers() | Returns an Array of Mapeed.Marker/Mapeed.Cluster visible on the map. |
| getMarkerCount() | Returns numbers of markers visible on the map. |
| getMarkerForId(id, function(marker)) | Returns marker (or cluster) visible on the map for an specific id. Callback is called after marker search. marker parameter is false if not found. |
| Function | Description |
|---|---|
| getId() | Returns your ID associated with this Mapeed marker. |
| getGLatLng() | Returns a google GLatLng object representing latitude/longitude of this Mapeed marker. |
| getGMarker() | Returns a google GMarker associated with this Mapeed marker. |
| setGMarker(gMarker) | Set GMarker (google marker) for this Mapeed marker. Use to change marker image. |
| Function | Description |
|---|---|
| getCount() | Returns number of markers included in the cluster. |
| getGLatLngBounds() | Returns a google GLatLngBounds object representing area covered by the cluster. |
| zoomIn(gMap) |
gmap:
Google map object (GMap2 class)
Update center and zoom of the google map to display all markers included in the cluster. |
After having created your account, you will be able to
log in
to manage your account.
On the tab "My map", you will be able to upload tour CSV file. The result will appear after our processing.
Markers can be sent by HTTP using our API with HTTP authentication
Authenticating is done with an authentication token. You will get it on your dashboard when you are logged in.
You have to use this token as login and just X as password.
URL is to post your file is like this:
http://www.mapeed.com/api/beta/YOUR_MAP_KEY/import
YOUR_MAP_KEY
is also available on your dashboard page. You have two keys, one for your production map, one for you development map.
If your plan supports https, you can use https instead of http to use this upload API.
A complete curl command:
curl -u YOUR_AUTHENTICATION_TOKEN:X -X PUT http://www.mapeed.com/api/beta/YOUR_MAP_KEY/import -T YOUR_CSV_FILE -H 'Content-Type: text/csv'
You can inspect reponse header ad body (add -v to curl command to get request/response content)
| Description | Status | Response Body |
|---|---|---|
| Import succeeded | 200 OK |
|
| Import failed because an import is already scheduled or running | 409 Conflict |
|
| Import failed because have reached number of uploads per hour or per day according to your plan. | 409 Conflict |
|