Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7973981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T08:15:02+00:00 2026-06-04T08:15:02+00:00

for example i have a MySQL database that contains latitude and longitude, how do

  • 0

for example i have a MySQL database that contains latitude and longitude, how do I call these coordinates to be displayed in the map ? anyone can help me please?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T08:15:03+00:00Added an answer on June 4, 2026 at 8:15 am

    Since your question and information are a bit unclear, these are my assumptions:

    1. I assume that you have followed the instruction correctly to install the EGMap
      extension into your yii application.
    2. You want to place a marker at the said coordinates (latitude &
      longitude).

    Sample codes: (please adjust to fit your database tables and columns at the lines
    commented as “// Get LatLong from table Location”). Place this straight into your view file example: protected/views/site/index.php

    <!-- other html codes here -->
    <div id="map-container">
    <?php
    // Get LatLong from table Location
    $location=Location::model()->findByPk(1);
    $latitude = $location->latitude;
    $longitude = $location->longitude;
    
    Yii::import('ext.gmap.*');
    
    $gMap = new EGMap();
    $gMap->setJsName('map');
    $gMap->zoom = 10;
    $mapTypeControlOptions = array(
        'sensor'=>true,
        'position'=> EGMapControlPosition::LEFT_BOTTOM,
        'style'=>EGMap::MAPTYPECONTROL_STYLE_DROPDOWN_MENU
    );
    // Map settings
    $gMap->mapTypeControlOptions= $mapTypeControlOptions;
    $gMap->setWidth(800);
    $gMap->setHeight(600);
    $gMap->setCenter($latitude, $longitude);
    
    // Prepare icon
    $icon = new EGMapMarkerImage("http://google-maps-icons.googlecode.com/files/gazstation.png");
    $icon->setSize(32, 37);
    $icon->setAnchor(16, 16.5);
    $icon->setOrigin(0, 0);
    // Prepare marker
    $marker = new EGMapMarker($latitude, $longitude, array('title' => 'Gas Station','icon'=>$icon));
    $gMap->addMarker($marker);
    
    $gMap->renderMap();
    ?>
    </div>
    <!-- other html codes here -->
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I ran into an interesting problem. I have a MySQL database that contains some
I have a mysql database, in there I have 1 table. That table contains
I have a mysql database table that contains multiple user photos. I am trying
I have a MySql database that contains people's names. Of course there are names
For example I have a mysql query that gets some data. Then runs another
I have searched everywhere but can't find a simple example of paging in MySQL
I have a MySQL database called People which contains the following schema <id,name,foodchoice1,foodchoice2> .
I have a MySQL database which contains a table of users. The primary key
I have a MySQL database with a table called subm_items The table contains the
I have MySQL database, where I store the following BLOB (which contains JSON object)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.