"Google Maps API"
sgenzer
Altair Employee
hi...not sure if someone has done this before but I figured out how to get Google Maps API to work within RM. This operator takes an address (attribute="address_for_google") and calculates the distance in miles to New York, NY. Note that if you use this, you will need to request an API key from developer.google.com
<operator activated="true" class="web:enrich_data_by_webservice" compatibility="5.3.002" expanded="true" height="60" name="Google Maps Distance Lookup" width="90" x="313" y="30">
<parameter key="query_type" value="XPath"/>
<list key="string_machting_queries"/>
<list key="regular_expression_queries"/>
<list key="regular_region_queries"/>
<list key="xpath_queries">
<parameter key="Distance" value="//distance/text/text()"/>
</list>
<list key="namespaces"/>
<parameter key="assume_html" value="false"/>
<list key="index_queries"/>
<list key="jsonpath_queries"/>
<parameter key="service_method" value="fgfgfgf"/>
<parameter key="body" value="text=<%title%>"/>
<parameter key="url" value=""/>
<parameter key="delay" value="20"/>
<list key="request_properties">
<parameter key="key" value="ENTER YOUR API KEY HERE"/>
</list>
</operator>
Tagged:
0
Answers
-
Hi,
cool, thanks for sharing
Regards,
Marco0 -
That's cool
I build an libary process to show google map as sticky on a map. But this REALLY helps.
Thanks a lot!
Martin0 -
thanks, guys. It was fun.
BTW if you try it, you should increase the delay to 150ms or so. Google throttles the Distance Matrix API use at the "free" tier:
100 elements per query.
100 elements per 10 seconds.
2 500 elements per 24 hour period
Scott
0