can i make the xml placemark, names, description be included in the search

44 views
Skip to first unread message

Christopher Watson

unread,
Aug 12, 2011, 5:44:47 PM8/12/11
to google-map...@googlegroups.com
hey all,


great but doesn't search, or auto complete places that i have inside my xml.

can these organisations <placemarks><name>, <address><description. be included in the autocomplete?

cant find places i know are in my xml from the search box by just using keywords. 

thanks

chris

Pil

unread,
Aug 13, 2011, 8:21:19 AM8/13/11
to Google Maps JavaScript API v3
The light weight xml files aren't indexable because tag and attribute
names are arbitrary, i.e they can mean everything and nothing.
Nowadays search engines aren't able to solve this problem.

That's probably the main reason why Google doesn't like xml.

So you'd have to wait for usable semantic search engines. Meanwhile
you may use the fatter KML if you want your files to be indexed.




On Aug 12, 11:44 pm, Christopher Watson
<chris.watso...@googlemail.com> wrote:
> hey all,
>
> i usedhttp://code.<http://code.google.com/apis/maps/documentation/javascript/examples/pl...>
> google.com/apis/maps/documentation/javascript/examples/places-autocomplete.html<http://code.google.com/apis/maps/documentation/javascript/examples/pl...>

Christopher Watson

unread,
Aug 13, 2011, 8:33:21 AM8/13/11
to google-map...@googlegroups.com
thanks pil,

how can i make the kml indexed? i assume that the kml's i can download from my saved places in google maps are ok kmls to be indexed? 



Chris Watson

Portfolio | http://vism.ag/inkplay 
Vis Mag | http://vism.ag
Creative Maps | http://vism.ag/maps 

Twitter tweeted: Peace Wall in Peckham | Peckham Shed: http://t.co/zvLM7J6
  Get this email app!  
--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
To post to this group, send email to google-map...@googlegroups.com.
To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.


Pil

unread,
Aug 13, 2011, 9:13:15 AM8/13/11
to Google Maps JavaScript API v3

geoco...@gmail.com

unread,
Aug 13, 2011, 9:58:32 AM8/13/11
to Google Maps JavaScript API v3
On Aug 13, 8:33 am, Christopher Watson <chris.watso...@googlemail.com>
wrote:
> thanks pil,
>
> how can i make the kml indexed? i assume that the kml's i can download from
> my saved places in google maps are ok kmls to be indexed?

KML is a form of xml.

You are using KML (at least in the pages I have seen, this thread
doesn't include a link to an example of what you are asking about).

This file is KML:
http://creativemaps.vism.ag/ALL.xml

http://www.feedvalidator.org/check.cgi?url=http%3A%2F%2Fcreativemaps.vism.ag%2FALL.xml

-- Larry


>
> Chris Watson
>
> Portfolio |http://vism.ag/inkplay
> Vis Mag |http://vism.ag<http://vism.ag/inkplay>
> Creative Maps |http://vism.ag/maps
> Blog | Photo Data
> App<http://visualisationmagazine.com/blogvisualthinkmap/2011/08/photo-dat...>
> [image: Twitter] <http://twitter.com/visualthinkmap>tweeted: Peace Wall in
> Peckham | Peckham Shed:http://t.co/zvLM7J6

geoco...@gmail.com

unread,
Aug 13, 2011, 1:25:59 PM8/13/11
to Google Maps JavaScript API v3
On Aug 13, 9:58 am, "geocode...@gmail.com" <geocode...@gmail.com>
wrote:
> On Aug 13, 8:33 am, Christopher Watson <chris.watso...@googlemail.com>
> wrote:
>
> > thanks pil,
>
> > how can i make the kml indexed? i assume that the kml's i can download from
> > my saved places in google maps are ok kmls to be indexed?
>
> KML is a form of xml.
>
> You are using KML (at least in the pages I have seen, this thread
> doesn't include a link to an example of what you are asking about).
>
> This file is KML:http://creativemaps.vism.ag/ALL.xml
>
> http://www.feedvalidator.org/check.cgi?url=http%3A%2F%2Fcreativemaps....

You can even view it on Google Maps:
http://maps.google.com/maps?q=http:%2F%2Fcreativemaps.vism.ag%2FALL.xml&z=2

Christopher Watson

unread,
Aug 13, 2011, 5:22:38 PM8/13/11
to google-map...@googlegroups.com
hey larry, 

yeah, when i make the xml i am just re-saving the kml's as .xml

Know where the kml is, wasn't sure how to index the kml data to search it or specify the <name> tag. 

Well, busy searching and tweaking, thanks again pil for the link to search kml.


uploaded a kml (far easier to manage its data i might add considering i am tweaking the kml's in notepad... madness) to a fusion table and linked it to the search. 

So now in a table the search in the builder index's the name and it just searches inside that field and displays results, WORKING here: 

i have been testing with the search term 'hat' because i know there are a few. 

just, a few things i am trying to do to the search results now (could help me fix anyone):

1. i am trying to use this: http://gmaps-samples.googlecode.com/svn/trunk/fusiontables/search_and_zoom.html so that the results are pan'd and zoomed

the link seems to be with geocoder, but cant quite focus how to change

    // If the status of the geocode is OK
    if (status == google.maps.GeocoderStatus.OK) {
      // Change the center and zoom of the map
      map.setCenter(results[0].geometry.location);
      map.setZoom(10);
      
      // OPTIONAL: find the new map bounds, and run a spatial query to return
      // Fusion Tables results within those bounds. 
      sw = map.getBounds().getSouthWest();
      ne = map.getBounds().getNorthEast();
      layer.setOptions({
        query: {
          select: 'lat',
          from: tableid,
          where: "ST_INTERSECTS(lat, RECTANGLE(LATLNG(" + sw.lat() + "," + sw.lng() + "), LATLNG(" + ne.lat() + "," + ne.lng() + ")))"
        }
      });
    } 
  });
}

to perform somethign like this;

  function changeMap() {   
  
  var searchString = document.getElementById('searchString').value.replace("'", "\\'");   
  layer.setQuery("SELECT 'geometry' FROM " + tableid + " WHERE 'name' CONTAINS IGNORING CASE '" + searchString + "'"); 


    // If the status of the searchString is OK
    if (status == google.maps.layer.setQueryStatus.OK) {
      // Change the center and zoom of the map
      map.setCenter(results[0].geometry.location);
      map.setZoom(10);
      
      // OPTIONAL: find the new map bounds, and run a spatial query to return
      // Fusion Tables results within those bounds. 
      sw = map.getBounds().getSouthWest();
      ne = map.getBounds().getNorthEast();
      layer.setOptions({
        query: {
          select: 'lat',
          from: tableid,
          where: "ST_INTERSECTS(lat, RECTANGLE(LATLNG(" + sw.lat() + "," + sw.lng() + "), LATLNG(" + ne.lat() + "," + ne.lng() + ")))"
        }
      });
    } 
  });
}
thats how i picture it but doubt its as simple as i tweaked it

2. trying to change the icon rather than using the flat red circle to my own as you just cant see the flat red circle,

  var marker = new google.maps.Marker({
   map: map,
   icon: image2,
   
    });

3. not attempted yet, but looking to hide all other pins and only display the search results... phoaaar! can see that been a definite need help as i try adapt examples i find. 

4. would ideally like the icon displayed for the results to identify its corresponding <styleUrl>#Studios</styleUrl> in the xml. hmm... 

5. not necessary, but would like the function coreAddress using geocoder to work within the same search box, i assumed i could just change the search id= to match each other and them both be available to perform within the same function, might need a differentiated search and radio buttons

6. hoping i can have a layer of description been search too, seeing as its easier to edit the data through fusion tables, can essentially start meta tagging

  function changeMap() {   
  
  var searchString = document.getElementById('searchString').value.replace("'", "\\'");   
  layer.setQuery("SELECT 'geometry' FROM " + tableid + " WHERE 'name' CONTAINS IGNORING CASE '" + searchString + "'"); 
  layer.setQuery("SELECT 'geometry' FROM " + tableid + " WHERE 'description' CONTAINS IGNORING CASE '" + searchString + "'"); 

think there is an exmaple in the samples of multiple layers.



Sorry... listing them helping clear my mind to focus on the pan & zoom. but if anyone knows of working examples / solutions in code to any of the list please post. i'm hoping fusion table queries are ok in here as opposed to in the ftl group. 

Brwosing through these to try and achieve the effect i want:


all help greatly appreciated











Chris Watson

Portfolio | http://vism.ag/inkplay 
Vis Mag | http://vism.ag

Creative Maps | http://vism.ag/maps 

Twitter tweeted: The Visual Think Map Daily is out! http://t.co/lLMGBTa
  Get this email app!  
Reply all
Reply to author
Forward
0 new messages