cyberhobo / wordpress-geo-mashup

Official repository for Geo Mashup, the plugin that makes WordPress into a GeoCMS. Documentation:
https://github.com/cyberhobo/wordpress-geo-mashup/wiki/Getting-Started
63 stars 15 forks source link

Can't change Map Type to Satellite View #863

Closed el-saadi closed 4 years ago

el-saadi commented 4 years ago

Hello, i want to change the maptype of my global map to Satellite view, but it always stays at the defaul Road/Normal view. In the documentation there are these parameters map_type - G_NORMAL_MAP, G_SATELLITE_MAP, G_HYBRID_MAP, G_PHYSICAL_MAP, but this won't work for me. Here is my code snippet of the global map in Template.

` <?php $map_params = array( "map_content" => "global", "map_type" => "G_SATELLITE_MAP", "height" => "800p", "width" => "100%", "zoom" => '15', "map_control" => "GSmallZoomControl", "add_map_type_control" => array("G_NORMAL_MAP", "G_SATELLITE_MAP", "G_PHYSICAL_MAP"), "add_overview_control" => "true", "marker_select_highlight" => "true", "marker_min_zoom" => "true" ); echo GeoMashup::map($map_params) ?>

Codesnippet

What's the issue with my parameters, or is there a setting i have to made before hand? I hope you could help me with my problem.

`

cyberhobo commented 4 years ago

That looks right to me, could be a bug. Is your Map Provider set to Google?

el-saadi commented 4 years ago

Thank you for your fast answer. No, I use the Leaflet as my Map Provider. Here is a demo of our site, where we want to use the Geo Mashup Plugin. I just want to set the control panel the SATELLITE view at default. Link to our website

cyberhobo commented 4 years ago

I can reproduce that bug with Leaflet, should be able to fix it in the next release.

netzgestaltung commented 4 years ago

Hi there,

i tested the update on my test environment and now the Leaflet map here always shows the satelite view at page loading.

i added the mentioned "map_type" config

search-map.php

<?php echo GeoMashup::map( array(
    'name' => 'search-results-map',
    'search_text' => $search_text,
    'object_ids' => $geo_mashup_search->get_the_ID_list(),
    'center_lat' => $near_location['lat'],
    'center_lng' => $near_location['lng'],
    'search_lat' => $near_location['lat'],
    'search_lng' => $near_location['lng'],
    'map_content' => 'global',
    'object_name'=> $object_name,
    'zoom' =>   $approximate_zoom + 6, // Adjust to taste
    'map_type' => 'G_NORMAL_MAP',
  ) ); ?>

but it shows the satelite view anyways.

maybe this is related but i cant estimate it.

on my live page with these options (wihtout map_type) and without the update it shows the street map_type

cyberhobo commented 4 years ago

Thanks for checking, looks like I released a new bug in place of the old one: #865