"Google Maps API"

sgenzer
sgenzer
Altair Employee
edited November 2024 in Community Q&A
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=&lt;%title%&gt;"/>
            <parameter key="url" value=""/>
            <parameter key="delay" value="20"/>
            <list key="request_properties">
              <parameter key="key" value="ENTER YOUR API KEY HERE"/>
            </list>
          </operator>

Welcome!

It looks like you're new here. Sign in or register to get started.

Answers

  • Marco_Boeck
    Marco_Boeck New Altair Community Member
    Hi,

    cool, thanks for sharing :)

    Regards,
    Marco
  • MartinLiebig
    MartinLiebig
    Altair Employee
    That's cool :D

    I build an libary process to show google map as sticky on a map. But this REALLY helps.

    Thanks a lot!


    Martin
  • sgenzer
    sgenzer
    Altair Employee
    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

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.