• Resolved bratki

    (@bratki)


    After mappress update I have some problems:
    – My maps are of roadmap view, but I need satellite one (as before upgrade). So the first question is “How to set satellite view as a default for mappress?”.
    – The size of each map is changed so how to set them all in appropriate size.
    P.S. I don`t think that I should rewrite every post.
    P.P.S. Trying to change source code and nothing happens.
    // Convert map types

    $mapTypeId = $mapdata['maptype'];
      if ($mapTypeId != 'roadmap' && $mapTypeId != 'satellite' && $mapTypeId != 'terrain' && $mapTypeId != 'hybrid')
         $mapTypeId = 'roadmap'; // Here from 'roadmap' to 'satellite'
      else
         $mapTypeId = strtolower($mapTypeId);

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author chrisvrichardson

    (@chrisvrichardson)

    Hi, what version did you upgrade from? I’m guessing it was pretty ancient, as I haven’t heard of any map type problem before.

    You can use the ‘resize maps’ function on the settings screen to resize all maps as you like.

    There’s nothing similar for changing map type, but if you’re changing the code maybe just force the type, i.e. replace this:

    $mapTypeId = $mapdata['maptype'];
      if ($mapTypeId != 'roadmap' && $mapTypeId != 'satellite' && $mapTypeId != 'terrain' && $mapTypeId != 'hybrid')
         $mapTypeId = 'roadmap'; // Here from 'roadmap' to 'satellite'
      else
         $mapTypeId = strtolower($mapTypeId);

    with this:

    $mapTypeId = "satellite"

    Thread Starter bratki

    (@bratki)

    Really I don`t know what was the previous version? And I think it was pretty ancient too. So
    1. ‘resize maps’ function works good, then i fixed the size of the map.
    2. But still cant change it to satellite view as default. Ive replaced the block code:

    $mapTypeId = $mapdata['maptype'];
      if ($mapTypeId != 'roadmap' && $mapTypeId != 'satellite' && $mapTypeId != 'terrain' && $mapTypeId != 'hybrid')
         $mapTypeId = 'roadmap'; // Here from 'roadmap' to 'satellite'
      else
         $mapTypeId = strtolower($mapTypeId);

    with this one:
    $mapTypeId = "satellite"
    but nothing happens.
    Any ideas?

    Plugin Author chrisvrichardson

    (@chrisvrichardson)

    Hi,

    There’s no bulk-map-type-update in the plugin, so your best bet may be to just edit the individual maps. If you prefer you can force your maps to satellite by adding this line in mappress_api.php (it’s the last line shown below):

    function display($atts = null) {
    		global $mappress;
    		static $div = 0;
    
    		$options = Mappress_Options::get();
    
    		// Update the options and map settings with any passed attributes
    		$options->update($atts);
    		$this->update($atts);
    
    		$this->mapTypeId = 'satellite';
    ...

    Also if it’s helpful: you can also specify the map type in the [mappress] shortcode, so you could use that instead to override the type on individual posts.

    Thread Starter bratki

    (@bratki)

    Hi,

    Thanks chrisvrichardson for your help…
    this works:

    // Update the options and map settings with any passed attributes
    $options->update($atts);
    $this->update($atts);

    $this->mapTypeId = ‘satellite’;

    //add this

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Mappress Satellite View As a Deafult’ is closed to new replies.