I created a window app in which one of my page i.e 'A' shows routing directions between two points on map. Now in this page i am passing the lat and long of my current location from the previous page i.e 'B' by query string. After getting the lat and long from page 'B' I am calling my service to get the list of nearest CNG stations along with their latitude and longitude and then populate that list in my listpicker on page 'A'. Initially when we navigate to our page 'A' our map shows routing distance between my location and the first list item. Also on the selection change of listpicker i am populating the routing distance and show it in my map.
Issue- now my Requirement is to refresh this page.And the whole process should repeat in the same way as described above. Please provide me some ideas on how to move ahead with this requirement as i am new to windows app development . Thanks!
Once you have navigated to your new Page here you can start a Dispatcher time that checks on periodic interval Here you can get the new latitude and longitude and update your UI accordingly. Make sure you stop the dispatcher before you navigate again from this page.
Related
I have been behind the 8-ball all quarter for my class some how I am supposed to be able to do this in 4 hours.
My Assignment
The purpose of this assignment is to utilize a map to display a route using overlays/polylines.
The goal of this assignment is to enhance the assignment from week 5 (web service to retrieve directions) to display the retrieved directions as a route on a map in addition to a list of steps.
You are required to write a single application that runs on a tablet configuration (Nexus 10 or some variation of a 10 inch screen tablet)
User Interface Requirements
The left side of the screen (ListView, left-pane) will contain the interface outlined in the week 5 assignment. A user can enter a source and destination and retrieve a list of directions based on that input. So, the interface is a couple textfields, a button, and a list.
The right side of the screen (right-pane, details view) will contain a Map that displays the directions as a segmented line (route). The map and route gets updated/displayed after the directions are retrieved (selection of the button). An initial map should be displayed with some default settings when the screen is first loaded.
Other Requirements
The Map should display the entire route (start and end point) at the appropriate zoom level (depending on the distance). The correct map type should also be used depending on the distance.
You are required to use a Marker to display the starting point and ending destination.
You are required to use the MapFragment class.
You are required to use API V2 from Google Maps and the Google Play Services API.
You are required to use the XMLPullParser class for parsing the XML.
This application will look very similar to the Google maps application that is used on the web (with a lot less detail, no zooming in out of the map, etc), concerning the route displayed, and left pane to enter source / destination and direction list.
Using Android Studio I have tried Creating an Application using the Map Activity, but it creates and application that will not compile and it looks like it wants me to use Google Keys. I can't hand in an assignment that requires Keys assigned to me.
I already have 4 hours into this and I can't even get started. I read that v3 of googles map API's doesn't need keys, but I can't find anything that tells me how to use them and Android Studio Doesn't seem to give you options as to what to download and use.
I really need help.
I need some help with a Gravity Forms issue. Currently I have 2 fields, a latitude and longitude field. The user enters those items, submits, then I need to re-direct the user to another page where a Google map gets plotted with a pin reflecting the latitude and longitude that the user entered.
Gravity Forms admin posted a solution that was kind of along these lines, however, I cannot for the life of me get it to work. It is at http://www.gravityhelp.com/forums/topic/google-map-on-preview-and-singlephp for those of you who have access to the forum.
Basically, I want to pass the user entries over to a page and then populate a short code on the page (Gravity Forms admin said he had to do this via the template file) which will produce the Google map (using a mapping plugin like http://wordpress.org/plugins/wp-google-maps-shortcode/)
So like this: user on page 1, user enters lat/long data, submits, after submission user is redirected to page 2 where there is the Google Map plugin and shortcode, shortcode parameters for latitude and longitude are populated by the user's submitted entries from page 1, map gets displayed.
I have tried this solution below to get the parameters out of the form after submission, but this is as good as I have thus far and don't know how to make this thing work (added to my functions.php file and yes, I know it is referring to a specific form # 5):
add_action('gform_after_submission_5', 'after_submission_value', 10, 2);
function after_submission_value($entry, $form){
$latitudeval = $entry['2'];
$longitudeval= $entry['3']; }
As a follow up question, using this method above, what happens if 2 people at the exact same time enter parameters? Just curious.
I am open to any other methods, or suggestions too for a solution.
Thank you in advance for the help!
If you use Street, City, State, Zip, or Country instead of latitude/longitude (or map the latter to the former), then you can use this plugin:
https://www.danielabernathy.com/plugins/gravity-forms-google-maps-add-on/
I am building a web service with GeoDjango which involves user submitted events including a location. I created a model field for my location using django.contrib.gis.db:
location = models.PointField(srid=900913)
I chose to specify 900913 as I read that this is the projection used by Google Maps and I am getting the location by placing a marker on a Google map. The coordinate is presented to me in lat/lng form. I am storing this point in a PostGIS DB using GEOS:
location = geos.Point(data['lng'], data['lat'], srid=900913)
If I want to view this point on a map, I get the lat and lng from my DB (e.g. lat = location.coords[1]) and use them to centre my map and this works fine.
When I want to browse a map and display events from DB which lie inside the map bounds I use GeoDjango's within query and the maps bounds (in lat/lng format):
bounds = geos.Polygon.from_bbox((swLng, swLat, neLng, neLat))
events = Event.objects.filter(location__within=bounds)
This appears to work fine and I display pins on the map corresponding to the lat/lng of these events.
So far nothing would suggest that anything is going wrong, however I am completely new to this stuff and I want to ensure that I'm getting it right for when I inevitably want to use my location data in more complex ways. The reason I'm suspicious is that my Django admin pane does not display the location correctly on the OpenStreetMap. It shows a point which appears to correspond to the (0,0) point shown here. The displayed text version of the location field is SRID=900913;POINT(-1.277482509613037 50.874104373286066), which is clearly still in lat/lng. As I move my mouse around the admin map I can see the displayed coords in the bottom right corner are in 900913 format, and not in lat/lng.
Please can you explain how I can store my location points in the correct format, and what advantages this has over simply using lat/lng (my guess is that if I want to specify say a distance in km for lookups, I can't use my lat/lng locations).
I am new to Android Development and need help desperately.
i am developing Google Map Application for Taxi Hailing.
i develop Prototype that how it will work with using Peer to Peer technology.
My challange:
i can show user and Taxi Driver location on map. but i do not know how to show Taxi location on map when user start His App.
I read lot of article but No result.
As i have little Idea that create a Virtual Pool on Server for Both applicaition and get Lat and Long from Taxi Location and store in Virtual Pool, from their get location and show on User's App. But no idea will it work or not.
can anyone please help me how i can Show Taxi location online on Google Map.
To show the users current location simply setMyLocationEnabled(true) on your GoogleMap object
To get the users current location see my answer to: Location servise GPS Force closed
My suggestion for storing taxi locations would be to use parse.com as the server side. Again, from the taxi (assuming you have a device there) use my implementation of GPSTracker to update the location on parse.com.
Now when the user open your app let it poll parse.com for taxi locations every, say 5 seconds (only while showing map that is).
In order to only show taxis that are nearby, you can use the users current location.
If there is few taxis, it is simplest to poll all locations and let the user device select those nearby, see my answer to Android Maps v2 - animate camera to include most markers.
Alternatively think as if you draw a square around the users position. Calculate the leftmost corner in top topleft=(lat_topleft, lon_topleft) and right corner in bottom botright=(lat_botright, lon_botright). Now you can do a search like, shown as SQL for demonstration, it is a bit different when working with parse.com:
SELECT taxilocations FROM taxis WHERE user_lat > topleft AND userlat < botright
Thereby only polling for taxis within the box drawn around the user.
This would be my take on it, hope it helps you.
I have a google maps application which displays markers based on data (lat,lon). As the user moves the map I have to refresh the data and show new points.
Now I am wondering to minimize the calls to the db, is there a way to refresh the data only if the map moved by certain % of the total span distance (ex: 15%). For example current maps show a distance of 1000km span, refresh the data only if the map moves horizontal/vertical by at least 150km.
Look at how the variable pixelThreshold is used on this old V2 mashup. It does the same thing but it works in all directions because in the moveend event handler I compare the distance between the map center before and after the move.
That is an API V2 application but it should be easy to apply the same strategy to a V3 application.