Bing maps pushpins in REST - rest

I am using bing maps REST services and I need to add pushpins but surprisingly it's giving me a hard time. I found out how to easily add pushpins in AJAX services, but that would need me to include scripts and stuff to my pages which I'd really rather skip. I tried searching the internet for information on how to add pushpins in REST ( or simply an iframe with a URL ) but I failed to find any useful such. Does anyone know how I can add pushpins in REST?
EDIT: I'm using dynamic maps based on this link http://www.bing.com/maps/embed/viewer.aspx?showCopyright=false&cp=43.835109710693~25.957630157471&lvl=1&w=250&h=350&sty=r

Assuming that you are using the Bing Maps Imagery REST service, you will be able to add pushpin based on the URL parameters, see the MSDN: http://msdn.microsoft.com/en-us/library/ff701724.aspx
Here is an sample request that will allow you to add pushpins, take a look at the pp parameter:
http://dev.virtualearth.net/REST/v1/Imagery/Map/Road/47.619048,-122.35384/15?mapSize=500,500&pp=47.620495,-122.34931;21;AA&pp=47.619385,-122.351485;;AB&pp=47.616295,-122.3556;22&key=BingMapsKey
If you are using embedded maps, here is the list of parameters: http://msdn.microsoft.com/en-us/library/ee692180.aspx

Related

Single Line Address for MapQuest

I'm trying to provide other map options besides just Google. Unfortunately a single HTTP query (e.g. location=123+main+street) only seems to be readily supported by Google.
I had no luck trying to find anything about embedding in the documentation and decided to email them directly:
The MapQuest business products
(https://developer.mapquest.com/documentation/) support both single
line input "location=1555+Blake+St+Denver+CO+80202+US" and the
advanced, 5-box method
("street=1555+Blake+St&city=Denver&state=CO&postalCode=80202&country=US").
Our API and SDK also lets you add the mapping/geocoding/routing
functions to your site without embedding links to the consumer site at
www.MapQuest.com.
Okay, so location=123+main+street should be supported in theory. However no example was provided. So using the iframe URL from the more client-oriented approach I tried the following without luck:
https://www.mapquest.com/embed/?location=1555+Blake+St+Denver+CO+80202+US
That just shows the map of the US as a whole.
How do I get the single HTTP query location to work for MapQuest embedding?
Correct: location=1555+Blake+St+Denver+CO+80202+US (single HTTP query).
Incorrect: street=1555+Blake+St&city=Denver (multiple HTTP queries).
It looks like a mix of MapQuest APIs and MapQuest.com. Check out the Link to MapQuest documentation. I think the Map a Location > Fielded Location is what you're after.
On this page: https://developer.mapquest.com/documentation/tools/link-to-mapquest/
Scroll down to Link to MapQuest Wizard.
Click on Map a Location.
Click on Single Line Location.
Click on the Run Sample with Embed View Specifier button.
Copy the URL from the new tab.
An example of the working MapQuest single HTTP query embedded page:
https://www.mapquest.com/embed/search/results?query=1555%20Blake%20St%20Denver%20CO%2080202&centerOnResults=1

How to get EXTRA (complimentary) results from bing-search API

When we generally search for a term in www.bing.com (e.g. newyork), we get some extra information along with search results on the right most side of the page. Like for 'newyork' you would see some content from wikipedia, map location, it's twitter page etc.
Is there a way to get this information from current BING SEARCH API?
Some of this information is available in the Bing Entity Search API here: https://azure.microsoft.com/en-us/services/cognitive-services/bing-entity-search-api/.

Bing search api limit to certain sites

Can I define Bing search api only return result from subdomains from a site? For example, www.domain.com/dir/. This is something similar to what Google custom search does. But Google CSE has a hard limit on 10k/day. Is there an alternative search api available for this purpose?
You can simply put this into the query field, like this:
site:domain.com/dir/ whatIAmLookingFor
The query field can contain anything the Bing Engine supports, despite the keyword being site, it apparently supports also URLs
You can read the Bing Search API docs here.
madmuffin is correct, but I'm expanding on his answer to show how multiple sites can be searched. You can use the advanced search operator "site:" as part of your query "q" param.
Single Site Example
"heart disease" site:www.example.com
Multiple Site Example
"heart disease" (site:www.example1.com OR site:www.example2.com)

Google Analytics API, filter by parameter

Our app uses the Google Analytics Rest API. We'd like to get the number of page views generated by different links to the site.
For example, one link to our site might be:
http://oursite.com?linknum=12345
and another might be:
http://oursite.com?linknum=23456
We'd like to track the number of page views by all visitors who click on each link, so we need a way to filter by parameter.
So far, we just get the number of page views for all visitors without any filters:
curl 'https://www.googleapis.com/analytics/v3/data/ga?ids=ga:(our id) &metrics=ga:pageviews&start-date=2014-4-26&end-date=2011-12-08&access_token=(our access token)'
The best way to learn the API is to use the query explorer at
http://ga-dev-tools.appspot.com/explorer/
For your analysis, add dimension=ga:pagePath and sort=ga:pageviews.
In addition, you could ask for pages which match a filter expression.
For example filter=ga:pagePath=#linknum to only include pages with linknum.

How does foursquare add a custom image annotation on their Open Graph map?

When foursquare works with Open Graph after a user has performed a checkin on their application (and assuming said user is linked to Facebook), foursquare posts to Open Graph a sample of this checkin data. What's interesting is that they do not have a standard map. Their map has a pin point on it in which an annotation embeds a custom image. It looks a little something like this:
I'm curious how this is done? I can get a regular map to show up with a pin point or a simple image view, but I can't get this custom annotation embedded within a map view.
From what I can tell, there is nothing in the documentation which shows how to further customize the Map layout or add any additional meta data to a GeoPoint object in order to get this additional functionality.
It's currently only in use by Foursquare - effectively it's a test right now.
There are plans to open it up more widely but there's nothing to announce right now - it'll be announced on the blog when opened up further - https://developers.facebook.com/blog/