Fusion Tables Layer infoWindow list - google-maps-api-3

I am trying to print queried FusionTablesLayer rows into a separate div rather than open the information in a standard infoWindow when a marker is clicked. Basically I am trying to show the info for each marker, just like you would get when doing a normal google maps search. The Google Maps API v3 seems to only pull information from FusionTablesLayers when you click on a particular marker. All of the JSON examples I have found to perform a similar task seem to use the SQL API for Fusion Tables, which has been deprecated. I need to find a way to query the table using an orderBy distance. The map query I am using is below and this query works perfectly for populating the points on the map.
var Layer = new google.maps.FusionTablesLayer({
query: {
select: 'Latitude',
from: 'table_id',
orderBy: "ST_DISTANCE(Latitude, LATLNG"+latlng+")",
limit: 50
}
});

The Fusion Tables API V1.0 is not deprecated.
You can also use queries from the visualization API
Here is an example with a simple sidebar

Related

How do I hide the table id of a Fusion Table so the user cannot see the source of the fusion table layer on a Google Map?

I am using Fusion Tables to add a FusionTablesLayer to my Google Map that shows some markers. I do not want the user to know where the data is coming from (ie: Fusion Table Id).
How can I hide the table id from the user? Currently it is located in JavaScript:
var tableId = "not_hidden_from_user";
var layer = new google.maps.FusionTablesLayer({
map: map,
heatmap: { enabled: false },
query: {
select: "col12",
from: tableId,
where: ""
}
});
I know that Google needs to access the Fusion Table but I was hoping there was a way to keep the source from the user. The goal is to filter the Fusion Table and show only certain markers to certain users. I am using ASP.Net.
Sometimes the simpler solution is the best. Instead of cracking your head looking for way to hide the table, I suggest to consider to obfuscate the entire javascript file. I am using this service: https://javascriptobfuscator.com without any problem. But you can test also:
http://www.danstools.com/javascript-obfuscate/
http://javascript2img.com/

How can I querying a key value without retriving all data in Firebase?

I'm learning angularjs, firebase, angularfire by building a sample app. It's a dictionary app that any one can add a word, add several explanation to the word, add several common usage to the word, add example centences to the word. People can freely add new word via this web app. OR people can freely realtime search a word and display the content of that word. When I build the app.
I found everytime when I search a word, I have to load all the data and then check if the query string exist in the data and then display the content if exist. So, it's quite heavy if the library become very big.
How can I query a string if it exist from the server side and if exist, just download that piece of data?
Here is a very simple example that is on the firebase site (Retreiving data). I suggest you take a look at that page, there is a lot more info there about this subject. Now the example:
var ref = new Firebase("https://dinosaur-facts.firebaseio.com/dinosaurs");
ref.orderByChild([the child node to compare to]).equalTo([what you are searching]).on("child_added", function(snapshot) {
//do something with the data in snapshot
});

Prepare Query for Search Multiple Collections using Meteor?

In my application 2 collections are there.
1.profile - Fields are : username,id,city and postalcode
2.material - id,version,descrption and usage
In single collection we use as shown below :
var query = {};
query.username = 'xxxx';
query.city= 'yyyy';
Need Multiple Collections Query as shown below data?
Need query for to pass username and city in profile and descrption in material?
MongoDB does not support joins in the way a relational DB (e.g., MySQL) does. There are a number of materials available on the subject, principally...
Discover Meteor's tutorial on reactive joins
Reactive and Non-Reactive Join with MongoDB
This HackPad about reactive join packages
What these all boil down to is this: It's not native in MongoDB, but with Meteor, you have three options:
Use a package to do it for you
De-normalize (include one collection entirely within the other)
Do it yourself with publication and routing
From your comment:
In Profile Id is there and material are also id there.So these two are same
it sounds like the id fields are what you'd like to join by -- the second option (de-normalize) here is really easy, if you can get away with it. Rather than having two Collections, have one Collection in the following format:
{
username,
material: {
version,
description,
usage
},
city,
postalcode
}
and then query like so:
Profiles.find({username: 'xxxx', city: 'yyyy', "material.description": "zzzz"});
This has obvious tradeoffs in terms of storage efficiency and re-usability (for instance, if your material Collection is used elsewhere, you can't really just embed it in the profile Collection). Note that this also works if you have many materials that have the same description.
If you need to keep them separate, you can narrow down the set of fields to look in manually (option 3) -- you can see how I did that on this MeteorPad, but the basic idea is in your publish function, query one Collection first, then use that information to query the other:
// Return all profiles with a certain material description -- includes multiple materials.
Meteor.publish('profiles', function(username, city, material) {
var materialIds = Materials.find({description: material}).map(function(mat) { return mat._id });
return Profiles.find({material: {$in: materialIds}, username: username, city: city});
});
There are a lot of choices for packages, so I will leave it up to you to find the one most suited to your needs and read the documentation if that's the route you choose.

Fusion Table with App Inventor: displaying map with location column

I am using App Inventor 2 from MIT.
I have a fusion table with location column of type location. Using the FusiontableControls component I am able to write into the table and view the table using the WebViewer component, I am able to view the URL of the Table and the data is there.
However, when I use the URL from the Map view of the table, I see the map display on my app but without the locations in the table marked. However, if I go to the web address of the fusion table on a web browser on a pc, hit the location button, the map updates with the location information and next time I use the app, the map shows with the locations marked.
Is there a way to display the updated map using App Inventor without having to go manually and update the map page?
Update 1: As #Taifun suggested, I tried clear cache. It doesn't work.
Update 2: Further investigations show that by default, location info in FusionTable is not geocoded and that is why map doesn't show it. The question now is whether there is an API that forces geocoding when I insert the location info into the fusion table using app inventor 2?
Update 3: Taifun's suggestion worked. Storing address as lat,long makes the map automatically geocode and display locations. Earlier I was using the address returned from location sensor which returns something like 123 Main St, city,st 12345. Even though it is a valid address, it doesn't auto geocode.
Thanks a lot Taifun. (also for editing my post for clarity)
Define your location as one column location like this
instead of using two separate columns (lat and long) in your table. This should update your map automatically. See also https://support.google.com/fusiontables/answer/1012281?hl=en

Drupal: map address geolocation search

I am using the gmap and location modules to display a map. I would like the users to be able to fill an address in a field and the map autocenters and autozooms to that address. Like maps.google.com does it.
Is there a module or any specific configuration I can do with drupal? Ultimately I would like to create an advance filter where user inputs country, province and address and posibly select from a drop down list. Something very similar to what it is done in the following link http://www.dei.gr/Default.aspx?id=30608&nt=18&lang=2&langid=1
Thanks.
The GMap Location Module is the one which fits the requirements most closely.
"Provides a map of all a site's nodes and a map of all of the site users."
If you'd like to create it by yourself:
Would suggest to create 2 tables - with labels and center-points - in order to populate these cascaded drop-downs.
The last input-box needs to geo-code the entered text - over the Google GeoCoder API.
Of course any centerpoint could be geo-coded - but you have a limit of 2.500 API requests per 24hrs on the PHP API,
unless being a premier customer (besides local results are just quicker). That's why it's recommend to store the center-points for each item in the drop-downs in a table - and only use the JS API (instead of the PHP API) for the last step.
The example which you provided reloads the whole page when changing the drop-downs, which should be avoided.

Resources