How to display stored locations from a database on a map?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I want to build an app which will display restaurants stored in a database (name, lat, long etc...) on a map within certain radius from the user. The user can then click on a particular restaurant to view more information or add a review about that restaurant. I know how to fetch the name of restaurants from the database using JSON and PHP and display them in a list view. But I want to be able to display them on a map. Could someone please point me in the correct direction on how to get this done?
android phpmyadmin latitude-longitude android-maps-v2
add a comment |
I want to build an app which will display restaurants stored in a database (name, lat, long etc...) on a map within certain radius from the user. The user can then click on a particular restaurant to view more information or add a review about that restaurant. I know how to fetch the name of restaurants from the database using JSON and PHP and display them in a list view. But I want to be able to display them on a map. Could someone please point me in the correct direction on how to get this done?
android phpmyadmin latitude-longitude android-maps-v2
2
Please post your efforts for SO members to help you better.
– RussellB
Nov 15 '18 at 9:39
See this project on Github. It does something like you say. It Locates car instead of restruants.
– Sayok Majumder
Nov 15 '18 at 10:12
@SayokMajumder sir, can you please share .sql file.
– Abhilash Karanth
Nov 15 '18 at 11:11
@AbhilashKaranth I don't have any specific sql files for the project. The database are hosted online and details are put inside webfiles.
– Sayok Majumder
Nov 15 '18 at 11:27
add a comment |
I want to build an app which will display restaurants stored in a database (name, lat, long etc...) on a map within certain radius from the user. The user can then click on a particular restaurant to view more information or add a review about that restaurant. I know how to fetch the name of restaurants from the database using JSON and PHP and display them in a list view. But I want to be able to display them on a map. Could someone please point me in the correct direction on how to get this done?
android phpmyadmin latitude-longitude android-maps-v2
I want to build an app which will display restaurants stored in a database (name, lat, long etc...) on a map within certain radius from the user. The user can then click on a particular restaurant to view more information or add a review about that restaurant. I know how to fetch the name of restaurants from the database using JSON and PHP and display them in a list view. But I want to be able to display them on a map. Could someone please point me in the correct direction on how to get this done?
android phpmyadmin latitude-longitude android-maps-v2
android phpmyadmin latitude-longitude android-maps-v2
edited Nov 15 '18 at 13:03
Fantômas
32.9k156491
32.9k156491
asked Nov 15 '18 at 9:38
Abhilash KaranthAbhilash Karanth
23
23
2
Please post your efforts for SO members to help you better.
– RussellB
Nov 15 '18 at 9:39
See this project on Github. It does something like you say. It Locates car instead of restruants.
– Sayok Majumder
Nov 15 '18 at 10:12
@SayokMajumder sir, can you please share .sql file.
– Abhilash Karanth
Nov 15 '18 at 11:11
@AbhilashKaranth I don't have any specific sql files for the project. The database are hosted online and details are put inside webfiles.
– Sayok Majumder
Nov 15 '18 at 11:27
add a comment |
2
Please post your efforts for SO members to help you better.
– RussellB
Nov 15 '18 at 9:39
See this project on Github. It does something like you say. It Locates car instead of restruants.
– Sayok Majumder
Nov 15 '18 at 10:12
@SayokMajumder sir, can you please share .sql file.
– Abhilash Karanth
Nov 15 '18 at 11:11
@AbhilashKaranth I don't have any specific sql files for the project. The database are hosted online and details are put inside webfiles.
– Sayok Majumder
Nov 15 '18 at 11:27
2
2
Please post your efforts for SO members to help you better.
– RussellB
Nov 15 '18 at 9:39
Please post your efforts for SO members to help you better.
– RussellB
Nov 15 '18 at 9:39
See this project on Github. It does something like you say. It Locates car instead of restruants.
– Sayok Majumder
Nov 15 '18 at 10:12
See this project on Github. It does something like you say. It Locates car instead of restruants.
– Sayok Majumder
Nov 15 '18 at 10:12
@SayokMajumder sir, can you please share .sql file.
– Abhilash Karanth
Nov 15 '18 at 11:11
@SayokMajumder sir, can you please share .sql file.
– Abhilash Karanth
Nov 15 '18 at 11:11
@AbhilashKaranth I don't have any specific sql files for the project. The database are hosted online and details are put inside webfiles.
– Sayok Majumder
Nov 15 '18 at 11:27
@AbhilashKaranth I don't have any specific sql files for the project. The database are hosted online and details are put inside webfiles.
– Sayok Majumder
Nov 15 '18 at 11:27
add a comment |
1 Answer
1
active
oldest
votes
Try this.. it will show the marker for that location
MarkerOptions mp = new MarkerOptions();
LatLng newLatLng = new LatLng(lat, lng); // latitude and longitude
mp.position(newLatLng);
mp.icon(BitmapDescriptorFactory.fromResource(R.drawable.your_icon));
mp.title("Title");
mp.snippet(location); // location
googleMap.addMarker(mp);
sir, latitude and longitude of that location should be reflected from mysql database. Suppose a restaurant registered with us and we have to show their details if it is nearer to user while he is searching. I am looking for this kind of code
– Abhilash Karanth
Nov 15 '18 at 11:09
Okay Sir, You have list of restaurants details with location in your db. if user going to search restaurant means at the time you can the get current location of the user. Now calculate the distance with restaurant locations, filter out the restaurant list send to app. app will show all the restaurants on map.
– veerendran
Nov 15 '18 at 11:34
yes sir, i am trying to find out solution for above task. But still didn't get the desired output
– Abhilash Karanth
Nov 15 '18 at 11:39
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53316398%2fhow-to-display-stored-locations-from-a-database-on-a-map%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Try this.. it will show the marker for that location
MarkerOptions mp = new MarkerOptions();
LatLng newLatLng = new LatLng(lat, lng); // latitude and longitude
mp.position(newLatLng);
mp.icon(BitmapDescriptorFactory.fromResource(R.drawable.your_icon));
mp.title("Title");
mp.snippet(location); // location
googleMap.addMarker(mp);
sir, latitude and longitude of that location should be reflected from mysql database. Suppose a restaurant registered with us and we have to show their details if it is nearer to user while he is searching. I am looking for this kind of code
– Abhilash Karanth
Nov 15 '18 at 11:09
Okay Sir, You have list of restaurants details with location in your db. if user going to search restaurant means at the time you can the get current location of the user. Now calculate the distance with restaurant locations, filter out the restaurant list send to app. app will show all the restaurants on map.
– veerendran
Nov 15 '18 at 11:34
yes sir, i am trying to find out solution for above task. But still didn't get the desired output
– Abhilash Karanth
Nov 15 '18 at 11:39
add a comment |
Try this.. it will show the marker for that location
MarkerOptions mp = new MarkerOptions();
LatLng newLatLng = new LatLng(lat, lng); // latitude and longitude
mp.position(newLatLng);
mp.icon(BitmapDescriptorFactory.fromResource(R.drawable.your_icon));
mp.title("Title");
mp.snippet(location); // location
googleMap.addMarker(mp);
sir, latitude and longitude of that location should be reflected from mysql database. Suppose a restaurant registered with us and we have to show their details if it is nearer to user while he is searching. I am looking for this kind of code
– Abhilash Karanth
Nov 15 '18 at 11:09
Okay Sir, You have list of restaurants details with location in your db. if user going to search restaurant means at the time you can the get current location of the user. Now calculate the distance with restaurant locations, filter out the restaurant list send to app. app will show all the restaurants on map.
– veerendran
Nov 15 '18 at 11:34
yes sir, i am trying to find out solution for above task. But still didn't get the desired output
– Abhilash Karanth
Nov 15 '18 at 11:39
add a comment |
Try this.. it will show the marker for that location
MarkerOptions mp = new MarkerOptions();
LatLng newLatLng = new LatLng(lat, lng); // latitude and longitude
mp.position(newLatLng);
mp.icon(BitmapDescriptorFactory.fromResource(R.drawable.your_icon));
mp.title("Title");
mp.snippet(location); // location
googleMap.addMarker(mp);
Try this.. it will show the marker for that location
MarkerOptions mp = new MarkerOptions();
LatLng newLatLng = new LatLng(lat, lng); // latitude and longitude
mp.position(newLatLng);
mp.icon(BitmapDescriptorFactory.fromResource(R.drawable.your_icon));
mp.title("Title");
mp.snippet(location); // location
googleMap.addMarker(mp);
answered Nov 15 '18 at 10:42
veerendranveerendran
364
364
sir, latitude and longitude of that location should be reflected from mysql database. Suppose a restaurant registered with us and we have to show their details if it is nearer to user while he is searching. I am looking for this kind of code
– Abhilash Karanth
Nov 15 '18 at 11:09
Okay Sir, You have list of restaurants details with location in your db. if user going to search restaurant means at the time you can the get current location of the user. Now calculate the distance with restaurant locations, filter out the restaurant list send to app. app will show all the restaurants on map.
– veerendran
Nov 15 '18 at 11:34
yes sir, i am trying to find out solution for above task. But still didn't get the desired output
– Abhilash Karanth
Nov 15 '18 at 11:39
add a comment |
sir, latitude and longitude of that location should be reflected from mysql database. Suppose a restaurant registered with us and we have to show their details if it is nearer to user while he is searching. I am looking for this kind of code
– Abhilash Karanth
Nov 15 '18 at 11:09
Okay Sir, You have list of restaurants details with location in your db. if user going to search restaurant means at the time you can the get current location of the user. Now calculate the distance with restaurant locations, filter out the restaurant list send to app. app will show all the restaurants on map.
– veerendran
Nov 15 '18 at 11:34
yes sir, i am trying to find out solution for above task. But still didn't get the desired output
– Abhilash Karanth
Nov 15 '18 at 11:39
sir, latitude and longitude of that location should be reflected from mysql database. Suppose a restaurant registered with us and we have to show their details if it is nearer to user while he is searching. I am looking for this kind of code
– Abhilash Karanth
Nov 15 '18 at 11:09
sir, latitude and longitude of that location should be reflected from mysql database. Suppose a restaurant registered with us and we have to show their details if it is nearer to user while he is searching. I am looking for this kind of code
– Abhilash Karanth
Nov 15 '18 at 11:09
Okay Sir, You have list of restaurants details with location in your db. if user going to search restaurant means at the time you can the get current location of the user. Now calculate the distance with restaurant locations, filter out the restaurant list send to app. app will show all the restaurants on map.
– veerendran
Nov 15 '18 at 11:34
Okay Sir, You have list of restaurants details with location in your db. if user going to search restaurant means at the time you can the get current location of the user. Now calculate the distance with restaurant locations, filter out the restaurant list send to app. app will show all the restaurants on map.
– veerendran
Nov 15 '18 at 11:34
yes sir, i am trying to find out solution for above task. But still didn't get the desired output
– Abhilash Karanth
Nov 15 '18 at 11:39
yes sir, i am trying to find out solution for above task. But still didn't get the desired output
– Abhilash Karanth
Nov 15 '18 at 11:39
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53316398%2fhow-to-display-stored-locations-from-a-database-on-a-map%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
Please post your efforts for SO members to help you better.
– RussellB
Nov 15 '18 at 9:39
See this project on Github. It does something like you say. It Locates car instead of restruants.
– Sayok Majumder
Nov 15 '18 at 10:12
@SayokMajumder sir, can you please share .sql file.
– Abhilash Karanth
Nov 15 '18 at 11:11
@AbhilashKaranth I don't have any specific sql files for the project. The database are hosted online and details are put inside webfiles.
– Sayok Majumder
Nov 15 '18 at 11:27