PHP - Map Coordinates
I've created a topic before about making this game in php and mysql, which would be on a -250x250 grid but would only display 11x11, displaying your character in the center/middle of the table and being able to click the surrounding squares to change coordinates. I thought I'd realized how to make one of these map explore games but I've really got no ideas for some bits, so if anyone has any general hints or any tutorials for learning how to make something like this it would be greatly appreciated. Thanks in advance people
Similar TutorialsHi, i want to have a map of the us in which in my game people can control and it turns there colour using co ordinates, i know how to get the coordinates from below but i dont know how to set the borders for each country or save the info into a table ie where controlledby texas player1 washington none and if it's controlled by the player then changed the colour of the square to there colour ie red? i hope this makes sense and someone can point me in the right direction Code: [Select] <? $foo_x=$_POST['foo_x']; $foo_y=$_POST['foo_y']; echo "X=$foo_x, Y=$foo_y "; ?> <form action='' method=post> <input type="image" alt=' Finding coordinates of an image' src="map.jpg" name="foo" style=cursor:crosshair;/> </form> Hi, I am working on a project that involves mobile (android) and the application being designed connects to the database within PHPMYADMIN storing some table data entries. The language on the app being used is Flutter / DART and I do apologize, I am not familar at all with this language and my collegue has been writing his mobile code in this. I am the one who is going in and writing the PHP code that tells the data from the mobile app to be stored in a table. Hopefully this makes sense to you all still... Now... as shown below a diagram of how we have this app kicking and talking.
Thank for whom all can assist with this, but this is really the last piece of the puzzle then the app is finally done.
php output code: <!DOCTYPE html> <html> <head> <title>Test</title> <style> table { border-collapse: collapse; width: 100%; color: #588c7e; font-family: monospace; font-size: 25px; text-align: left; } th { background-color: #588c7e; color: white; } tr:nth-child(even) {background-color: #f2f2f2} </style> </head> <body> <table> <tr> <th>Id</th> <th>First Name</th> <th>Last Name</th> <th>Image</th> </tr> <?php $conn = mysqli_connect("localhost", "****", "****", "pmapp"); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } $sql = "SELECT id, first_name, last_name FROM pmvisit"; $result = $conn->query($sql); if ($result->num_rows > 0) { // output data of each row while($row = $result->fetch_assoc()) { echo "<tr><td>" . $row["id"]. "</td><td>" . $row["first_name"] . "</td><td>" . $row["last_name"]. "</td></tr>"; } echo "</table>"; } else { echo "0 results"; } $conn->close(); ?> </table> </body> </html> Edited February 16, 2020 by Barand obscuring pwd Hello, Id like to know how to extract bold coordinates from this url (PHP). I have never done that kind of stuff before. Important: Not just this specific url, but all urls with different coordinates every time. http://maps.google.com/maps?q=46.055603,14.507732&num=1&t=m&z=12 Thanks in advance. im trying to update a GPS table for example: UPDATE markers SET lat = '38.40907441955112' AND lng = '14.943452775478363' WHERE ApID = '35911' i tried with float 20,18 it isnt updatng correctly Hi all! I hope that you are all having a great time with PHP. Well I am too. Problem: I want all users who register to a mock site to have a unique, yet random ID. This ID is used to give the user virtual coordinates. So what I thought was to give the users a 'coordinate' like x=123, y=123 . i.e. (123,123) One of my goals is to calculate the virtual distance between two users. I figured out the real-world solution to this problem (I hope that it is correct!). It is as follows: Code: [Select] User 1: (123,123), User 2: (111,111). Distance: (((123-111)^2)+((123-111)^2)))^1/2 Now to my problem... Is it possible for me to arrange a list of user-records for each user in order of the 'closest' (shortest distance) users to those farthest? Without having my databases ruined with too much entries, that is... My other problem is as to how to make the 'coordinates' unique to each user. All I know about that is about assigning random numbers for each, and this is not that efficient. If you think that my entire approach to the situation is bonkers , do let me know. I thank you for any help in advance! Regards, Thauwa Hi there, I am building a custom configuration program, where i want people to choose various items, e.g. 1. Size of a table, colour, how many drawers, other features. I want to store all my options in mysql tables. At the end of the process I want to somehow get mysql to get line co-ordinates from a table and dynamically draw a plan view and elevation view of the table showing the options that the customer has chosen. I was wondering if anyone has ever been able to do this. I'm not sure how to start, or if php is capable of doing this. any ideas would be great. I need a map which locates all the stores addresses(Less than 10). Those address must be retreived from the database. But the database don't contain any lat or long field. Therefore geocoding an address into their corresponding lat and long coordinates must be done and appropriate markers must be placed.
The code which I have at the moment is as follows:-
<?php require_once '../model/stores.php'; $obj=new Stores(); $result=$obj->getStores(); $new_array = array(); while($row=mysql_fetch_assoc($result)){ $new_array[] = $row['stores_address']; } $add_js = json_encode( $new_array ); ?> <html> <head> <style> #map_canvas { width: 500px; height: 500px; } </style> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script> <script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script> <script> $(document).ready(function () { var map; var elevator; var myOptions = { zoom: 1, center: new google.maps.LatLng(0, 0), mapTypeId: 'terrain' }; map = new google.maps.Map($('#map_canvas')[0], myOptions); //var addresses = ['Norway', 'Africa', 'Asia','North America','South America']; var addresses = <?php echo $add_js ?>;; for (var x = 0; x < addresses.length; x++) { $.getJSON('http://maps.googleapis.com/maps/api/geocode/json? address=' +addresses[x]+'&sensor=false', null, function (data) { var p = data.results[0].geometry.location var latlng = new google.maps.LatLng(p.lat, p.lng); new google.maps.Marker({ position: latlng, map: map }); }); } }); </script> </head> <body> <div id="map_canvas"></div> </body> </html>I have looked on various forums and other web resources but no use as none of them worked out for me...Hope any genius would help me to solve the problem. Edited by Naseem, 15 August 2014 - 12:25 AM. |