Showing posts with label maps. Show all posts
Showing posts with label maps. Show all posts

Tuesday, 7 April 2015

Google Maps overlays with mouseOver hover events

So, I've now created a map, with overlays. Now the need to create mouse over events so that people can interact with them.

Here's some places I've found information:
How to make a map with overlays
How to create an event on mouseOver -> with reference to this post
A similar post, but different solution
Not sure if relevent, but a mouseover tooltip for markers


Some docuemtnation on overlay types and Map Type registry


Thursday, 27 November 2014

Adding Google street view to Joomla Estate Agencie JEA

So, even though I have only edited the code in minor ways, it actually took me a long time to do it, but here is the final result! Posted here on JEA forums

Hi, I've had a go at this myself, and finally came up with a solution.
The first thing I did was to go into my template and create an override for JEA Property.
I then edited the "default_googlemap.php" file. From line 44 to the bottom, replace the script with this script:
$script = <<
 
function initMap(mapOptions, panoOptions, MarkerLatlng) {
    map = new google.maps.Map(document.id('jea_property_map'), mapOptions);
    var marker = new google.maps.Marker({
        position: MarkerLatlng, 
        map: map, 
        title: '{$this->row->ref}'
    });
    var panorama = new google.maps.StreetViewPanorama(document.getElementById('jea_property_map_pano'), panoOptions);
  map.setStreetView(panorama);
}
 
window.addEvent("domready", function(){
    var longitude  = {$longitude};
    var latitude   = {$latitude};
 
    if (longitude && latitude) {
        var myLatlng = new google.maps.LatLng(latitude, longitude);
        var options = {
          zoom : 15,
          center : myLatlng,
          mapTypeId : google.maps.MapTypeId.ROADMAP
        };
        var panoramaOptions = {
    position: myLatlng,
  };
        initMap(options, panoramaOptions, myLatlng);
 
    } else {
        var geocoder = new google.maps.Geocoder();
        var opts = {'address':'$address', 'language':'$lang', 'region':'$region'};
        geocoder.geocode(opts, function(results, status) {
            if (status == google.maps.GeocoderStatus.OK) {
                var myLatlng = results[0].geometry.location;
                var options = {
                  center : myLatlng,
                  mapTypeId : google.maps.MapTypeId.ROADMAP
                };
                var panoramaOptions = {
    position: myLatlng,
  };
                initMap(options, panoramaOptions, myLatlng);
                map.fitBounds(results[0].geometry.viewport);
             }
        });
    }
});
 
EOD;
 
$this->document->addScriptDeclaration($script);
?>
 
I've only modified the original code to add panoramaOptions variable, and pass it to the initMap function. I then added the panorama variable.
 
At the bottom I also added a div tag called "jea_property_map_pano", but you have to give it a height property otherwise you won't be able to see it. The street view loads up in this div tag.

Thursday, 27 June 2013

Google maps overlays

I'm going to start a project which involves overlaying different maps from past, present and future maps. My primary thoughts involved utilising Google maps API for this.

Looks like there's quite a bit of info. Here's some links:

Notes:

Some limitations

Stated in the beginning there are limits to the free use of the API. This is 25000 map initialisations per day, which I consider very high.

Not sure how many overlays you can have, and hopefully control which ones are on and off using sliders and buttons. - Yep, above. "Showing and hiding Overlays"

Half way down the page on Info on Overlays theres a nice example of Animating Symbols

Friday, 3 May 2013

Joomla and google maps

Just adding a location page. Best thing is to put google maps in. Turns out there are lots of Joomla extensions for this.

I've just tried Googlemaps plugin. Worked brilliantly! Lots and lots of settings you can use as well. A nice tutorial here. Just use {mosmap} in an article!

Found this article with describes all the parameters you can put in.

I ended up using this:

{mosmap width='800px'|lat='53.264392'|lon='-1.440947'|zoom='15'|zoomType='Large'|zoomNew='1'|mapType='Hybrid'|showMaptype='1'|dir='5'|
overview='1'|text='
Chesterfield Panthers RUFC, 2012 Dunston Road, Chesterfield
'}