SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2008
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Google map and defined target

    I have seen article like:
    Embellishing Your Google Map with CSS3 and jQuery
    URL:http://www.sitepoint.com/embellishin...s3-and-jquery/


    Is there possibility target like: target=_blank
    var melburn = new google.maps.LatLng(XXX,YYY);
    var mapOptions = {
    zoom: 16,

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,678
    Mentioned
    99 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by toplisek View Post
    Is there possibility target like: target=_blank
    I don't understand. How do you intend to use this?
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    SitePoint Enthusiast
    Join Date
    Jun 2008
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm testing various options to set map default parameters.

    1. When user clicks resource details page it will open another frame or window like: target=_blank.

    2. I like to set language which are supported
    http://support.google.com/maps/bin/a...n&answer=63471

    3. I like to set Filter of resources. Example: All tourist locations inside particular city like:
    var mapOptions = {
    zoom: 12,
    center: melbourne,
    mapTypeId: google.maps.MapTypeId.ROADMAP//SATELLITE,HYBRID,TERRAIN
    Is there possible to set filter?

  4. #4
    SitePoint Enthusiast
    Join Date
    Jun 2008
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Additional setttings:

    4. Dynamic Google Maps

    How to set dynamic map from database (street addresses)?

    Setting javascript file and its line:
    center: new google.maps.LatLng(<?=$lat?>, <?=$lng?>),

    Geo coder and pull data from database:
    PHP Code:
    // get address from database
    mysql_connect('host''user''pass');
    mysql_select_db('dbname');
    $address=str_replace(" ","+",$address);

    $url "http://maps.googleapis.com/maps/api/geocode/xml?address=".$address."&sensor=false";

    # INITIATE CURL.
    $curl curl_init();

    # CURL SETTINGS.
    curl_setopt($curlCURLOPT_URL,"$url");
    curl_setopt($curlCURLOPT_RETURNTRANSFER1);
    curl_setopt($curlCURLOPT_CONNECTTIMEOUT0);

    # GRAB THE XML FILE.
    $result curl_exec($curl);

    curl_close($curl);

    # SET UP XML OBJECT.
    $xml = new SimpleXMLElement($result);

    $flag=0;
    foreach (
    $xml->result->geometry as $item){
        if(
    $flag==0){
        
    $lat=$item->location->lat;
        
    $lng=$item->location->lng;
        
    $flag=1;
        }
    }

    setcookie("lat",$lattime()+3600*24);
    setcookie("lng",$lngtime()+3600*24);

    header("location: index20.php");

    ?> 
    Can be improved this PHP code?

  5. #5
    SitePoint Enthusiast
    Join Date
    Jun 2008
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Need help. Can be replied?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •