Windows Phone - offline/location-off search using GeocodeQuery - search

I'm working on a windows phone app where I want to provide a search of the specified place and locate it on Map control. I'm using GeocodeQuery to search for a search term:
private void SearchForTerm(String searchTerm)
{
myGeocodeQuery = new GeocodeQuery();
myGeocodeQuery.SearchTerm = searchTerm;
myGeocodeQuery.GeoCoordinate = new GeoCoordinate(0, 0);
myGeocodeQuery.QueryCompleted += GeocodeQuery_QueryCompleted;
myGeocodeQuery.QueryAsync();
}
The problem is, that this code works only with location service or wifi turned on. With only location on and wifi off I can't search for every place, even if I have it on my map, but don't have downloaded detailed maps.
For example I can zoom in into Italy and I can see Rome, not streets in detail, but the name of the city is Visible. When I search for "Rome", I'll get 0 results.
This looks like the location service feature is not usable when offline, even with maps in phone. I didn't find any tutorial or example explaining this feature in detail. With this example on Nokia developers I have the same problem.

Windows phone gathers location data from three sources
Location Services
Network(Data)
Sim
And a cumulative of the three sources gives the best result. Obviously, you can get the data from location services alone but data from location services aggregated with the data phone gets from wifi or sim location is supposed to be the most accurate location.
just read this once.
also use
myGeolocator.DesiredAccuracyInMeters = value;
for more accuracy

Related

Database connection according to drop-down list

I am an interesting project, but I have a problem that I would like to solve before starting.
I am in the process of building an extranet for a franchise. The franchise therefore has several franchisees in several geographic sectors. They will have to connect from the same login page (same application). In this page there will be a region selector There will be a database per franchisee (constraint imposed)
Do you know a method so that depending on the region selector, the user connects to the chosen base?
for example:
region paca => base 1
region center => base 2
etc,
I know Laravel relatively well, but I have never had the problem so far. If anyone has an idea or would have had the same scenario, I would be very grateful if they would share their info.
Thank you in advance for your help
There is multiple ways to achieve what you want, it depend of what is duplicate.
Just, you have to store the information somewhere, and to have an object that say "option", for example:
"regionA": {
"db": "dbA",
"name": "Region A"
}
Just manage it as you want, that's why I write it in JSON.
Each region have a different server
You just redirect people on good website, and each website use it's own database
One server, but different schema in database
Use different connection, according to the region. For example, the region "A" use the database "software_a".
For example, one will do:
DB:connection("db_regionA")
Another will do:
DB:connection("db_regionB")
One database, one table, all rows says it's region
Just in SELECT request, such as:
SELECT * FROM mytable WHERE region = "A"

can Google Places API do a fuzzy search

Can I set Google Places API to do a fuzzy search? It seems Google map search (which use JavaScript) does that automatically, but it appears the REST API does not. I am frustrated by having to type in the accurate hotel name....any spelling errors bring up no result.
Try Text Search requests,
The Google Places API Text Search Service is a web service that returns information about a set of places based on a string — for example "pizza in New York" or "shoe stores near Ottawa" or "123 Main Street". The service responds with a list of places matching the text string and any location bias that has been set.
The service is especially useful for making ambiguous address queries in an automated system, and non-address components of the string may match businesses as well as addresses. Examples of ambiguous address queries are incomplete addresses, poorly formatted addresses, or a request that includes non-address components such as business names.

Node + Google Street View: How to check if a Street View is available in a certain radius

I'm trying to use Node and Google Street View together (Google doesn't officially support this). However, one of the things I noticed about Street View is that if you supply it with a point that doesn't have a Street View... it doesn't do anything...
I would like to use Node to reference the Google Maps API (Street View specifically) to find a point within a radius that has a Street View.
I saw a few packages like: https://github.com/moshen/node-googlemaps
but the docs aren't all that helpful. I know this API can be used to generate an image of a Street View, but I'm looking to find a point so that I can send it to a client so that they can display an interactive Street View (Street View Service).
Is any of this at all possible? This may have been worded a little bit weirdly... any questions just let me know!
Thanks!
I think this sample provided just that: https://developers.google.com/maps/documentation/javascript/examples/streetview-service
on init, they add a on click listener with sv.getPanoramaByLocation(event.latLng, 50, processSVData);, which let the street view search a point with data within 50m of the given point, then call the processSVData. Within the call back, they check if there is any points returned by checking if (status == google.maps.StreetViewStatus.OK), if so, the location that contains a street view is return in data.location.pano, which is what they used to add a marker.
I think you should be able to do the same thing in the back end too.

Show Solr Autosuggest results with types/categories

we are configuring solr for an e-commerce site which features a range of products across multiple categories and brands. In addition to that there is also a number of landing pages which can be reached through the search. So overall, we have 4 types of possible results, I'll use an electronics site as an example:
Categories (i.e. "Smartphones")
Brands (i.e. "Samsung"
Products (i.e. "Samsung Galaxy S4")
Pages (i.e. "How-To Guide to your Samsung")
What we would like solr to do is
a) show those things in autosuggest (right now it shows the first three, but doesn't show pages as they aren't part of the product catalog through which it searches)
b) show the "type" of the result in the box next to the result. To illustrate, if I would type "Sam", the autosuggest box would look something like this:
Samsung Brand
Samsung Galaxy S4 Product
Samsung Galaxy S5 Product
How-To Guide to your Samsung Page
Android Smartphones Category
Particularly the last point is really important and we couldn't find any way to do this yet. Any help would be greatly appreciated.
You can create a separate core for all the stuff you want to be able to auto complete on, where you keep both the type and the value. That way you get the flexibility of adding new auto complete features later, and you'll avoid introducing a wide set of different documents in your main core.
Another option is to add a type field to your main schema, and create documents for Page objects as well (depending on how you create the existing auto complete categories - if you have three different types of documents in the index already, it would be quick to add a new field that just contains the type of the document as well).

Sphinx "reverse" search

We have a website where users put up ads for stuff they want to sell, with parameters such as price, location, title and description. These can then be searched for using sphinx and allowing users to specify min- and maxprice, a location with a searchradius (using google maps) etc. Users can choose to save these searches and get emails when new ads appear that fit their search. Herein lies the problem: We want to perform a reverse search every time an ad is posted. With the price, location, title and description as parameters we want to search through all the saved "searches" and get the ones that would have found the ad. The min- and maxprice should just be performed in a query i suppose, and some Quorom syntax to get all ads with at least 2 or mby just 1 occurance in the title/description. Our problem lies mostly in the geo-search. How do we find all searches where the "search-circles" would include our newly posted location without performing a search for every saved search?
That is the main-question, any comment on our suggested solution to the other problems is also very welcome. Thank you in advance / Jenny
The standard 'geo-search' support on sphinx should work just as well on a Prospective Index, as a normal retrospective search.
Having built a sphinx 'index' of all the saved searches...
And you run a query using the 'ad' as the search query:- rather than the 'filter' using a fixed radius, you just use the radius from the attribute (ie the radius stored on the particular query) - if using the API cant use setFilterRange directly, need to use setSelect, to make a new virtual attribute.
$cl->setSelect("*,IF(#geodist<radius,1,0) as myfilter");
$cl->setFilter('myfilter',array(1));
(and yes, the min/maxprice can just be done with normal filters too - just inverting the logic to that you would use in a retrospective search)
... the complication is in the 'full-text' query, if the saved search is anything more than a single keyword, but you appear to have already figured out that part.

Resources