Can I get Google maps to ignore part of a search? - google-maps

I have a website which shows scheduled upcoming bike rides using Google Calendar. The location field automatically links to Google maps, but some of the information can make the Google maps search fail, and there's no way to turn off the map link.
Example: The upcoming ride has in the location field "Seven Hills Station, North side of the train tracks, 9am sharp". When you click on the map link, it just brings up a map of the US. If you search for "Seven Hills Station", it comes up with the train station in Seven Hills NSW, which is what we want. So if there was an operator that made the Google maps search ignore everything after "Hills" (like the question mark in URLs), I could keep displaying the calendar events in the same format and have working maps linked from it. Does anyone know of an operator that can make Google maps ignore part of a search?
Cheers,
Aston

I think you can use regex to delete everything after the ,
using the replace function, this is how you replace something in JS: str.replace(/,.*/g, "");
http://jsfiddle.net/gvzpe9h9/

Related

Google Maps API, get boundary of search results

How cloud I export coords of red polygon (e.g. boundaries of small administrative areas) from Google Maps API (JavaScript)?
You have to do this manually. This link returns a detail of a city. Like, if you search 'New York' the boundary of New York will be shown, like this:
Now if you click the detail button, you will get an OSM id which is '175905' for New York.
Now you have to go to this link and paste this OSM in the Id of relation text box and submit. You will get polyline informations in many formats.

Google Places/Maps API - Quick Facts Text?

I'm trying to figure out if Google Places (or Maps) API allows me to request the 'Quick Facts' text shown when you search for a city/town on Google Maps. For example, if you search for 'London on Google Maps on desktop, brings back this text in a panel on the left side of the page:
"London, England’s capital, set on the River Thames, is a 21st-century city with history stretching back to Roman times. At its centre stand the imposing Houses of Parliament, the iconic ‘Big Ben’ clock tower and Westminster Abbey, site of British monarch coronations. Across the Thames, the London Eye observation wheel provides panoramic views of the South Bank cultural complex, and the entire city."
I know I can get 'description text' back for actual places using Google Places API but I don't think this is the case for towns and cities themselves. Does anyone know how I can get this 'quick facts' text for cities/towns using an API?
You can use the SaveWidget control to create a custom UI for saving places. When you use the SaveWidget you can specify additional attribution data so that you user remembers where they saved the place from and can easily navigate back to your app.
In order to add a SaveWidget to your app, you will need to do the following:
Add a div to a page that contains a Google Map.
Indicate the place to be saved with a marker, so that your user knows which place they are saving.
Create a SaveWidgetOptions object that includes a place and attribution object literal.
Create a new SaveWidget object, passing the div and the options that you've added.
Follow this link to show the complete code sample: https://developers.google.com/maps/documentation/javascript/examples/save-widget

Search Through Markers with Google Maps API Like in Google's My Maps

I've created a map that has the ability to toggle data (markers) and added a search box, but I want to be able to search through my markers like in Google's My Maps, but everything that I've searched for doesn't have this feature and I've clicked just about every link there is on the first two pages and this is the closest I've found, but I'm trying to find (b) and the answer to (b) in this situation is to find any entrees within a certain radius.
This is the search feature that I'm trying to add: Example of Google's My Maps : If I search pancakes, the top results that I get are places that are on the map in which I've mentioned pancakes (instead of any place that serves pancakes).
Everything that I've done so far has been in html/javascript, so if it is possible, please try and stick to those languages.
I'm using Google's Maps API instead of My Maps because I wanted to do some extra toggling with the data that didn't seem possible with My Maps, eg make lower rated restaurants have lower opacity.
Thanks!

Google Maps API - Create a color coded map by neighborhood

I need to show neighborhood data on a map.
Each neighborhoods color would be based on the value it has.
In google maps the neighborhoods are highlighted by google when I search for them.
I do not see a way to create custom colors for them through the API.
To clarify I want to show a bunch of adjacent neighborhoods in different colors, not change the color of all neighborhoods.
More Info: Thanks Duncan, Google Maps has neighborhood outlines, eg typing menisa, edmonton into Google Maps highlights that neighborhood. Would that be geocoding via neighborhood?
This link is an example of what I am looking for.
http://www.bizjournals.com/boston/real_estate/2013/07/boston-liquor-licenses-database.html
Do I need to use google places to query for the google.maps.places.PlaceGeometry.viewport? And then use heatmaps to specify a weightedvalue?
From reading the documentation it looks to me like Google Maps API does not support this. If so could someone confirm that.
You can find the information to get you started here: Google Fusion Tables

get search box from google maps on my site with google maps api

I like google maps. There's smart search box. I want to have it on my own website with google maps api.
I have some experience with google maps places library - autocomplete, place searches and places search box - but it seems google maps website itself uses more complex search box that is offered by it's api.
Let's consider several search queries at maps.google.com and https://developers.google.com/maps/documentation/javascript/examples/places-searchbox pages:
type "moscow" and press enter (do not choose anything in the autocomplete box) - google maps works works fine, but search box api returns two objects (one in russia and another one in usa).
type "moscow" and choose first result from autocomplete - search box again returns two results - one for moscow, and another one for moskva small village.
type "camping" - google maps itself works excellent - it shows campings for the current map position and updates it while the map is dragged and zoomed. Search box doesn't update results. There's code with searchBox.setBounds for bounds_changed, but it does not trigger places_changed event, and markers don't update on the map.
These examples show that google maps itself uses more powerful version of the search box, that is offered in api. So is it possible to have this more powerful search box on my website?