View unanswered posts | View active topics It is currently Mon May 27, 2019 10:12 am

All times are UTC + 10 hours [ DST ]

Reply to topic  [ 3 posts ] 
Location Capture Widget - displaying data 
Author Message
ANDS Partners

Joined: Tue Feb 11, 2014 3:13 pm
Posts: 4

I was wondering if there is a code snippet to display the data returned from the Location Capture Widget?

IE As it is displayed on a view such as here



Wed Feb 12, 2014 10:00 am
ANDS Staff
User avatar

Joined: Sat Mar 26, 2011 10:57 am
Posts: 1

The location capture widget can and will return a lonlat string with a return callback, so you can do something like:
 return_callback: function(data){
 //data is the lonlat string when complete the drawing in the widget

The location capture widget also provides a way to put the lonlat string in a new widget
   lonLat:"151.503462,-33.251348 150.558638,-33.039778 149.767623,-34.137978 150.844283,-34.754050 151.283736,-33.937689 151.503462,-33.251348"

To achieve something like, you will need the lonlat string and knowledge on how to use the google map API, so basically we draw the lonlat string using polygons. You can view the open sourced code here in the drawMap() function

Try that and let me know if you need any help

Fri Feb 14, 2014 11:16 am
ANDS Partners

Joined: Tue Feb 11, 2014 3:13 pm
Posts: 4
Thanks, got it working.

Basically I used CSS
#spatial_coverage_map {
width: 440px;
height: 320px;
margin-bottom: 10px;
margin-top: 10px;

#spatial_coverage_map div {
margin-bottom: 0px;
<script type="text/javascript" src=";sensor=false"></script>
<script type="text/javascript" src="/js/jquery/jquery-1.10.2.min.js"></script>
<link rel="stylesheet" href="/js/blah.css" type="text/css" media="screen">
<script type="text/javascript">
$(document).ready(function() {
function drawMap(){ //drawing the map on the left side

function stringToLatLng(str){

<div id="spatial_coverage_map"></div>
<p class="coverage hide">136.406250,-19.864894 131.835938,-25.378772 146.953125,-29.434814 136.406250,-19.864894</p> /*sample coordinates */

Wed Feb 19, 2014 4:50 pm
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

All times are UTC + 10 hours [ DST ]

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software for PTF.