[ka-Map-users] Resizing map?

Andy Gross andy at andygross.org
Mon Jul 25 19:38:17 EDT 2005


I've figured this out - the drawPage() javascript function sets the  
viewport based on the browser window size.

Here's another (possibly dumb) question - is there a way to calculate  
latitudes and longitudes in the browser?   I'd like to put some  
elements that get loaded dynamically (from a 3rd party service)  via  
XMLHTTPRequest over the map, but can't seem to figure out how to  
position them correctly.  I realize this may be more of a general  
trig question, and not something specific to ka-Map, but maybe  
someone has done this before and could help me out.

So, given an array of lat/long coordinates, I'd like to (in  
javascript) :

1) Convert the lat/long to pixel offsets
2) Test if the current viewport contains the point
3)  If so, add an element to the page at the proper offset.

1 and 2 are what I'm having trouble with.   #3 is easy enough (i'll  
track the dynamically created elements and move them along with the  
rest of the tiles)

Anyone have any suggestions?


/arg






On Jul 25, 2005, at 3:49 PM, Andy Gross wrote:


>
> Hello, ka-map-users -
>
> Great app!  I've been wanting to make an AJAX map for awhile but  
> the javascript kills me every time :)  You all have done a great  
> service !
>
> Anyways, I'd like to integrate the map into my page, but would like  
> it to be smaller.   Naive attempts at changing it via the CSS, tile  
> size, table width, etc, seem to have failed.   Is there an easy way  
> to do this?
>
> Also, what element ids and document structure does the javascript  
> depend on/assume are in the HTML page?  Divs called 'legend',  
> 'viewport', 'scalebar', etc, obviously, but are there any  
> guidelines for embedding a ka-Map in an existing page?
>
>
> Thanks in advance,
>
> andy
>
> _______________________________________________
> ka-Map-users mailing list
> ka-Map-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/ka-map-users
>
>




More information about the ka-Map-users mailing list