This application displays images of Instagram into Google Maps. You can launch it immediately with this tutorial.
Information
Ingredients
- Template: Map
- API Loigcs: Instagram Recent Media
Functions
- Retrieving your images from Instagram.
- Displaying the images on Google Maps.
Create the application
Frontend
Choose the
Map Template.Customize the UI in K5 Playground.
Backend
Edit the API Logic of
GET sample_locationsendpoint.Delete the
Sample DataAPI logic.Add the
Instagram Recent MediaAPI Logic from SNS menu at the right pane.Set the
accessTokenfor Instagram API.Add the
FUJITSU Empty LogicAPI Logic from Custom menu at the right pane.Edit the code.
Format
/users/self/media/recent/response forGET /sample_locationresponse.1
2
3
4
5
6
7
8
9
10
11
12var images = results.data.map(function(image) {
return {
name: image.caption.text,
lng: image.location.longitude,
lat: image.location.latitude,
type: 'cultural',
image: image.images.low_resolution.url,
likes: image.likes.count,
comments: image.comments.count,
}
});
next(images);
Download the application.
Customize the application
Frontend
Edit the
frontend\app\config.js.Set API key for Google Map.
1
2
3
4bootstrapURLKeys: {
key: process.env.GOOGLE_API_KEY || '[Add Google API Key here]',
language: 'en',
},Edit the
frontend\app\components\pages\MapPage.js.Modify props of
MapPin001to display images on the map.1
2
3
4
5
6
7
8
9
10
11<MapPin001
style={pointStyle}
lng={point.lng}
lat={point.lat}
title={
<div>
<h2>{point.name}</h2>
<img style={{ width: 120 }} src={point.image} />
</div>
}
/>Edit the
frontend\app\components\pages\MapPage.js.Change default
stateto show images.1
2
3
4state = {
visibles: [0],
openDrawer: false,
};
Deploy the application
Backend
1 | cd backend |
Frontend
1 | cd frontend |
Download
Version
- Map Template: v1.0.0