0

I have a database containing some building's GPS in my city,

i need my yii2 app to use this database in displaying a map (like a google map) containing all buildings in my database with some highlights depending on a building status.

Then my application should be able to guide users by providing directional arrows up to a specific building.

My question is, should i learn GIS to handle this situation? Or is there any simple method or library apart from GIS ? Regards.

1 Answers1

2

Example how quick start with google maps in your view https://www.w3schools.com/graphics/google_maps_intro.asp

But if you work with yii2, needed create some asset in frontend/assets like:

<?php

namespace frontend\assets;

use yii;
use yii\web\AssetBundle;

/**
 * Main frontend application asset bundle.
 */
class GoogleMapAsset extends AssetBundle
{
     public $basePath = '@webroot';
     public $baseUrl = '@web';
     public $css = [];
     public $js = [
        "https://maps.googleapis.com/maps/api/js?key=YOUR_KEY&callback=myMap"
     ];

And in view file where you need work with google maps past GoogleMapAsset::register($this);

Sergio Codev
  • 104
  • 1
  • 7
  • Thanks, but i need to mark buildings with some coror depending on the building's status in my database, also i need my user to see building details when he click on it. Is this possible with google api? – AbuuJurayj Swabur Buruhan Oct 24 '19 at 12:00
  • Yes, you can mark the building, but what is meant to see the details? – Sergio Codev Oct 24 '19 at 12:15
  • I mean building details from database, example building name as registered in database, registered date and so on – AbuuJurayj Swabur Buruhan Oct 24 '19 at 14:08
  • Glad if at least something helped. I once did a similar project with google maps. I got latitude and longitude data from the database and substituted these variables in javascript api googlemaps. – Sergio Codev Oct 24 '19 at 14:35
  • I would advise adding more tags to the question so that those who can help with working with Google maps are found – Sergio Codev Oct 24 '19 at 14:38