Jump to content
  • 0

Distance Search & Google Map Mashup


datasador

Question

Hi everyone,

I am trying in get the input of the distance search coordinates along side with the records pin on the google map.

So I have a datapage with real estate properties which has a field for the Lat and Lon, I am using the google map mashup, so when I do a search all the records are pin in the map. This works great, however

when I used the Search by Distance, I need that the Lat and Lon values input, to also be pin in the map.  I am able to  get the Lat and the Lon from the search by parameters. 

So the other part is how can I take those coordinates and pin them in the map also.  I am using the caspio map mashup settings.

If anybody has a work around or has able to to this, please let me know where could be the problem.

Thanks!

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Hi @datasador

I didn't try it myself, but I have the following idea.

The script takes longitude and latitude values from div Elements from HTML block 
 

<span id="MapItLink:[@field:PK_ID]:[@cbAppKey]"></span>

<div id="Latitude:[@field:PK_ID]:[@cbAppKey]" style="display:none">[@field:Latitude]</div>
<div id="Longitude:[@field:PK_ID]:[@cbAppKey]" style="display:none">[@field:Longitude]</div>

<script type="text/javascript">try{ mapEnvironment. SetDetailsMapSettings( "[@cbAppKey]", "[@field:PK_ID]" );
}catch(e){}</script>


Based on this, in addition to code in HTML block, you can add modified code in the header of your report, where instead of [@field:Latitude] and [@field:Longitude] you will be using [@Latitude] and [@Longitude] parameters and instead of [@field:PK_ID] you will use something like "SearchInput"
Here is how the code in the header will look:
 

<span id="MapItLink:SearchInput:[@cbAppKey]"></span>


<div id="Latitude:SearchInput:[@cbAppKey]" style="display:none">[@Latitude]</div>
<div id="Longitude:SearchInput:[@cbAppKey]" style="display:none">[@Longitude]</div>

<script type="text/javascript">try{ mapEnvironment.AddDpItemMapSettings( "[@cbAppKey]", "SearchInput" );
}catch(e){}</script>



[@Latitude] and [@Longitude] parameters must be passed on exit from search form.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...